GCC is weird sometimes. It warns about comparing an unsigned to
a signed int, and casting does not make that go away, but using
an intermediate variable and affectation is fine.
The value was always known at compile time and could fit in a
single byte anyway.
Issue: STPK-1429
Change-Id: I4373c84d55a906cdbbeef1a7be6ffcf316189893
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
int has_mag = 0;
int has_rot = 0;
int has_ori = 0;
+ int catalog_size = CATALOG_SIZE;
for (i=0; i<sensor_count; i++)
switch (sensor_catalog[sensor_info[i].catalog_index].type) {
}
if (has_acc && has_gyr && has_mag && !has_rot && !has_ori)
- for (i=0; i<CATALOG_SIZE; i++)
+ for (i=0; i<catalog_size; i++)
if (sensor_catalog[i].type == SENSOR_TYPE_ORIENTATION) {
ALOGI("Adding placeholder orientation sensor");
add_sensor(0, i, 1);