diff options
author | Chih-hung Hsieh <chh@google.com> | 2015-01-05 23:37:54 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-01-05 23:37:54 +0000 |
commit | 7c27118d72d3d758a3633e999e5cc3bfdac39337 (patch) | |
tree | 95b9d5a4687da27f11986e9114421c41a34ce04c | |
parent | f8c01e46ab99e08b7d866836c8cb72f8c4239dbe (diff) | |
parent | b5607e4c8db3ae78fc0f2c72287db6def109ef79 (diff) | |
download | invensense-7c27118d72d3d758a3633e999e5cc3bfdac39337.tar.gz |
Merge "Fix aosp_manta-userdebug build with clang"
-rw-r--r-- | 60xx/libsensors_iio/CompassSensor.IIO.9150.cpp | 7 | ||||
-rw-r--r-- | 60xx/libsensors_iio/MPLSensor.cpp | 17 | ||||
-rw-r--r-- | 60xx/libsensors_iio/software/core/mpl/gyro_tc.h | 2 |
3 files changed, 10 insertions, 16 deletions
diff --git a/60xx/libsensors_iio/CompassSensor.IIO.9150.cpp b/60xx/libsensors_iio/CompassSensor.IIO.9150.cpp index ce0c5b0..14b92e7 100644 --- a/60xx/libsensors_iio/CompassSensor.IIO.9150.cpp +++ b/60xx/libsensors_iio/CompassSensor.IIO.9150.cpp @@ -239,7 +239,7 @@ int CompassSensor::readSample(long *data, int64_t *timestamp) { VHANDLER_LOG; - int numEventReceived = 0, done = 0; + int done = 0; ssize_t n = mCompassInputReader.fill(compass_fd); if (n < 0) { @@ -332,10 +332,9 @@ int CompassSensor::inv_init_sysfs_attributes(void) VFUNC_LOG; unsigned char i = 0; - char sysfs_path[MAX_SYSFS_NAME_LEN], iio_trigger_path[MAX_SYSFS_NAME_LEN], tbuf[2]; + char sysfs_path[MAX_SYSFS_NAME_LEN], iio_trigger_path[MAX_SYSFS_NAME_LEN]; char *sptr; char **dptr; - int num; pathP = (char*)malloc( sizeof(char[COMPASS_MAX_SYSFS_ATTRB][MAX_SYSFS_NAME_LEN])); @@ -359,6 +358,8 @@ int CompassSensor::inv_init_sysfs_attributes(void) inv_get_iio_trigger_path(iio_trigger_path); #if defined COMPASS_AK8975 + char tbuf[2]; + int num; inv_get_input_number(COMPASS_NAME, &num); tbuf[0] = num + 0x30; tbuf[1] = 0; diff --git a/60xx/libsensors_iio/MPLSensor.cpp b/60xx/libsensors_iio/MPLSensor.cpp index d88728d..d070231 100644 --- a/60xx/libsensors_iio/MPLSensor.cpp +++ b/60xx/libsensors_iio/MPLSensor.cpp @@ -177,12 +177,8 @@ MPLSensor::MPLSensor(CompassSensor *compass, int (*m_pt2AccelCalLoadFunc)(long * VFUNC_LOG; inv_error_t rv; - int i, fd; - char *port = NULL; + int fd; char *ver_str; - unsigned long mSensorMask; - int res; - FILE *fptr; mCompassSensor = compass; @@ -757,7 +753,7 @@ int MPLSensor::onPower(int en) int res; - int count, curr_power_state; + int curr_power_state; LOGV_IF(SYSFS_VERBOSE, "HAL:sysfs:echo %d > %s (%lld)", en, mpu.power_state, getTimestamp()); @@ -1365,7 +1361,6 @@ int MPLSensor::enable(int32_t handle, int en) // pthread_mutex_lock(&mHALMutex); if ((uint32_t(newState) << what) != (mEnabled & (1 << what))) { - uint32_t sensor_type; short flags = newState; uint32_t lastEnabled = mEnabled, changed = 0; @@ -1768,7 +1763,7 @@ int MPLSensor::readAccelEvents(sensors_event_t* /*data*/, int count) int numEventReceived = 0; input_event const* event; - int nb, done = 0; + int done = 0; while (!done && count && mAccelInputReader.readEvent(&event)) { int type = event->type; @@ -1858,7 +1853,7 @@ int MPLSensor::readEvents(sensors_event_t* /*data*/, int /*count*/) { int lp_quaternion_on = 0, nbyte; - int i, nb, mask = 0, numEventReceived = 0, + int i, mask = 0, numEventReceived = 0, sensors = ((mLocalSensorMask & INV_THREE_AXIS_GYRO)? 1 : 0) + ((mLocalSensorMask & INV_THREE_AXIS_ACCEL)? 1 : 0) + (((mLocalSensorMask & INV_THREE_AXIS_COMPASS) && mCompassSensor->isIntegrated())? 1 : 0); @@ -2036,7 +2031,6 @@ int MPLSensor::readCompassEvents(sensors_event_t* /*data*/, int count) int numEventReceived = 0; int done = 0; - int nb; // pthread_mutex_lock(&mMplMutex); // pthread_mutex_lock(&mHALMutex); @@ -2113,7 +2107,7 @@ int MPLSensor::getCompassFd() const } int MPLSensor::turnOffAccelFifo() { - int i, res, tempFd; + int i, res; char *accel_fifo_enable[3] = {mpu.accel_x_fifo_enable, mpu.accel_y_fifo_enable, mpu.accel_z_fifo_enable}; @@ -2671,7 +2665,6 @@ int MPLSensor::inv_init_sysfs_attributes(void) char sysfs_path[MAX_SYSFS_NAME_LEN], iio_trigger_path[MAX_SYSFS_NAME_LEN]; char *sptr; char **dptr; - int num; sysfs_names_ptr = (char*)calloc(1, sizeof(char[MAX_SYSFS_ATTRB][MAX_SYSFS_NAME_LEN])); diff --git a/60xx/libsensors_iio/software/core/mpl/gyro_tc.h b/60xx/libsensors_iio/software/core/mpl/gyro_tc.h index 8f1d50e..69918d5 100644 --- a/60xx/libsensors_iio/software/core/mpl/gyro_tc.h +++ b/60xx/libsensors_iio/software/core/mpl/gyro_tc.h @@ -11,7 +11,7 @@ * *****************************************************************************/ -#ifndef _GYRO_TC_H +#ifndef _GYRO_TC_H_ #define _GYRO_TC_H_ #include "mltypes.h" |