OSDN Git Service

Remove unused variables and labels android-x86-8.1-r2
authorChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 13 Mar 2019 04:31:00 +0000 (12:31 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Wed, 13 Mar 2019 04:31:00 +0000 (12:31 +0800)
iio-sensors.cpp
w500_sensor.c

index a94e06b..dead259 100644 (file)
@@ -169,10 +169,9 @@ int SensorBase::activate(bool e)
        return 0;
 }
 
-int SensorBase::readEvents(sensors_event_t *data, int)
+int SensorBase::readEvents(sensors_event_t *, int)
 {
        nanosleep(&delay, 0);
-       SensorEvent *e = new (data) SensorEvent(handle, type);
        return 1;
 }
 
index 6c76d56..a11d92d 100644 (file)
@@ -165,8 +165,6 @@ static int poll_data(struct sensors_poll_device_t *dev, sensors_event_t *data)
        struct input_event iev;
        struct sensor_context *ctx = (struct sensor_context *)dev;
        size_t res;
-       float val;
-       int i;
 
        /* Orientation sensor */
        for (;;) {
@@ -416,7 +414,6 @@ static int open_sensors(const struct hw_module_t *module, const char* id,
                        struct hw_device_t **device)
 {
        struct sensor_context *ctx;
-       int fd;
 
        if (strcmp(id, SENSORS_HARDWARE_POLL))
                return -EINVAL;
@@ -448,9 +445,7 @@ static int open_sensors(const struct hw_module_t *module, const char* id,
 
        return 0;
 
-err_light:
        close(ctx->accel_fd);
-err_accel:
        free(ctx);
        return -ENOMEM;
 }