Avoid C-style cast warnings
hardware/libhardware/include was being included with -isystem, which
hides warnings. Use a macro to convert modules to hw_device_t** to call
the open function that works in C++ and C.
Bug: 32018017
Test: m -j
Change-Id: If68bf15581975f1217fcab366cef7bc784894641
diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h
index 5a0dce1..c872d8e 100644
--- a/include/hardware/sensors.h
+++ b/include/hardware/sensors.h
@@ -1388,7 +1388,7 @@
static inline int sensors_open(const struct hw_module_t* module,
struct sensors_poll_device_t** device) {
return module->methods->open(module,
- SENSORS_HARDWARE_POLL, (struct hw_device_t**)device);
+ SENSORS_HARDWARE_POLL, TO_HW_DEVICE_T_OPEN(device));
}
static inline int sensors_close(struct sensors_poll_device_t* device) {
@@ -1398,7 +1398,7 @@
static inline int sensors_open_1(const struct hw_module_t* module,
sensors_poll_device_1_t** device) {
return module->methods->open(module,
- SENSORS_HARDWARE_POLL, (struct hw_device_t**)device);
+ SENSORS_HARDWARE_POLL, TO_HW_DEVICE_T_OPEN(device));
}
static inline int sensors_close_1(sensors_poll_device_1_t* device) {