// Returns the device pointer, or NULL if the global handle is invalid.
sensors_poll_device_t* sensors_poll_context_t::get_v0_device_by_handle(int global_handle) {
int sub_index = get_module_index(global_handle);
- if (sub_index < 0 || sub_index >= this->sub_hw_devices.size()) {
+ if (sub_index < 0 || sub_index >= (int) this->sub_hw_devices.size()) {
return NULL;
}
return (sensors_poll_device_t*) this->sub_hw_devices[sub_index];
// Returns the device pointer, or NULL if the global handle is invalid.
sensors_poll_device_1_t* sensors_poll_context_t::get_v1_device_by_handle(int global_handle) {
int sub_index = get_module_index(global_handle);
- if (sub_index < 0 || sub_index >= this->sub_hw_devices.size()) {
+ if (sub_index < 0 || sub_index >= (int) this->sub_hw_devices.size()) {
return NULL;
}
return (sensors_poll_device_1_t*) this->sub_hw_devices[sub_index];
}
static struct hw_module_methods_t sensors_module_methods = {
- open : open_sensors
+ .open = open_sensors
};
struct sensors_module_t HAL_MODULE_INFO_SYM = {
- common :{
- tag : HARDWARE_MODULE_TAG,
- version_major : 1,
- version_minor : 1,
- id : SENSORS_HARDWARE_MODULE_ID,
- name : "MultiHal Sensor Module",
- author : "Google, Inc",
- methods : &sensors_module_methods,
- dso : NULL,
- reserved : {0},
+ .common = {
+ .tag = HARDWARE_MODULE_TAG,
+ .version_major = 1,
+ .version_minor = 1,
+ .id = SENSORS_HARDWARE_MODULE_ID,
+ .name = "MultiHal Sensor Module",
+ .author = "Google, Inc",
+ .methods = &sensors_module_methods,
+ .dso = NULL,
+ .reserved = {0},
},
- get_sensors_list : module__get_sensors_list
+ .get_sensors_list = module__get_sensors_list
};
static int open_sensors(const struct hw_module_t* hw_module, const char* name,