diff options
author | Mark Salyzyn <salyzyn@google.com> | 2014-03-12 13:12:44 -0700 |
---|---|---|
committer | Mark Salyzyn <salyzyn@google.com> | 2014-03-12 13:12:44 -0700 |
commit | 92dc3fc52cf097bd105460cf377779bdcf146d62 (patch) | |
tree | aa1c6a8230541a45e941eb4c459b19b8487e08d3 /services/sensorservice | |
parent | 06ed9491418ce84e4272bf4201545fa6cfe3932e (diff) | |
download | frameworks_native-92dc3fc52cf097bd105460cf377779bdcf146d62.zip frameworks_native-92dc3fc52cf097bd105460cf377779bdcf146d62.tar.gz frameworks_native-92dc3fc52cf097bd105460cf377779bdcf146d62.tar.bz2 |
native frameworks: 64-bit compile issues
- Fix format (print/scanf)
- Suppress unused argument warning messages (bonus)
Change-Id: I05c7724d2aba6da1e82a86000e11f3a8fef4e728
Diffstat (limited to 'services/sensorservice')
-rw-r--r-- | services/sensorservice/CorrectedGyroSensor.cpp | 2 | ||||
-rw-r--r-- | services/sensorservice/GravitySensor.cpp | 2 | ||||
-rw-r--r-- | services/sensorservice/OrientationSensor.cpp | 2 | ||||
-rw-r--r-- | services/sensorservice/RotationVectorSensor.cpp | 4 | ||||
-rw-r--r-- | services/sensorservice/SensorDevice.cpp | 6 | ||||
-rw-r--r-- | services/sensorservice/SensorFusion.cpp | 2 | ||||
-rw-r--r-- | services/sensorservice/SensorInterface.cpp | 2 | ||||
-rw-r--r-- | services/sensorservice/SensorInterface.h | 6 | ||||
-rw-r--r-- | services/sensorservice/SensorService.cpp | 17 | ||||
-rw-r--r-- | services/sensorservice/main_sensorservice.cpp | 2 |
10 files changed, 23 insertions, 22 deletions
diff --git a/services/sensorservice/CorrectedGyroSensor.cpp b/services/sensorservice/CorrectedGyroSensor.cpp index 31487a7..b07d544 100644 --- a/services/sensorservice/CorrectedGyroSensor.cpp +++ b/services/sensorservice/CorrectedGyroSensor.cpp @@ -61,7 +61,7 @@ status_t CorrectedGyroSensor::activate(void* ident, bool enabled) { return mSensorFusion.activate(ident, enabled); } -status_t CorrectedGyroSensor::setDelay(void* ident, int handle, int64_t ns) { +status_t CorrectedGyroSensor::setDelay(void* ident, int /*handle*/, int64_t ns) { mSensorDevice.setDelay(ident, mGyro.getHandle(), ns); return mSensorFusion.setDelay(ident, ns); } diff --git a/services/sensorservice/GravitySensor.cpp b/services/sensorservice/GravitySensor.cpp index dd1f650..3cb3745 100644 --- a/services/sensorservice/GravitySensor.cpp +++ b/services/sensorservice/GravitySensor.cpp @@ -70,7 +70,7 @@ status_t GravitySensor::activate(void* ident, bool enabled) { return mSensorFusion.activate(ident, enabled); } -status_t GravitySensor::setDelay(void* ident, int handle, int64_t ns) { +status_t GravitySensor::setDelay(void* ident, int /*handle*/, int64_t ns) { return mSensorFusion.setDelay(ident, ns); } diff --git a/services/sensorservice/OrientationSensor.cpp b/services/sensorservice/OrientationSensor.cpp index 10b391c..6d85cca 100644 --- a/services/sensorservice/OrientationSensor.cpp +++ b/services/sensorservice/OrientationSensor.cpp @@ -69,7 +69,7 @@ status_t OrientationSensor::activate(void* ident, bool enabled) { return mSensorFusion.activate(ident, enabled); } -status_t OrientationSensor::setDelay(void* ident, int handle, int64_t ns) { +status_t OrientationSensor::setDelay(void* ident, int /*handle*/, int64_t ns) { return mSensorFusion.setDelay(ident, ns); } diff --git a/services/sensorservice/RotationVectorSensor.cpp b/services/sensorservice/RotationVectorSensor.cpp index a2157b4..cb305eb 100644 --- a/services/sensorservice/RotationVectorSensor.cpp +++ b/services/sensorservice/RotationVectorSensor.cpp @@ -56,7 +56,7 @@ status_t RotationVectorSensor::activate(void* ident, bool enabled) { return mSensorFusion.activate(ident, enabled); } -status_t RotationVectorSensor::setDelay(void* ident, int handle, int64_t ns) { +status_t RotationVectorSensor::setDelay(void* ident, int /*handle*/, int64_t ns) { return mSensorFusion.setDelay(ident, ns); } @@ -105,7 +105,7 @@ status_t GyroDriftSensor::activate(void* ident, bool enabled) { return mSensorFusion.activate(ident, enabled); } -status_t GyroDriftSensor::setDelay(void* ident, int handle, int64_t ns) { +status_t GyroDriftSensor::setDelay(void* ident, int /*handle*/, int64_t ns) { return mSensorFusion.setDelay(ident, ns); } diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp index 19caa5c..3b64f0a 100644 --- a/services/sensorservice/SensorDevice.cpp +++ b/services/sensorservice/SensorDevice.cpp @@ -78,7 +78,7 @@ void SensorDevice::dump(String8& result) Mutex::Autolock _l(mLock); for (size_t i=0 ; i<size_t(count) ; i++) { const Info& info = mActivationCount.valueFor(list[i].handle); - result.appendFormat("handle=0x%08x, active-count=%d, batch_period(ms)={ ", list[i].handle, + result.appendFormat("handle=0x%08x, active-count=%zu, batch_period(ms)={ ", list[i].handle, info.batchParams.size()); for (size_t j = 0; j < info.batchParams.size(); j++) { BatchParams params = info.batchParams.valueAt(j); @@ -87,7 +87,7 @@ void SensorDevice::dump(String8& result) } result.appendFormat(" }, selected=%4.1f ms\n", info.bestBatchParams.batchDelay / 1e6f); - result.appendFormat("handle=0x%08x, active-count=%d, batch_timeout(ms)={ ", list[i].handle, + result.appendFormat("handle=0x%08x, active-count=%zu, batch_timeout(ms)={ ", list[i].handle, info.batchParams.size()); for (size_t j = 0; j < info.batchParams.size(); j++) { BatchParams params = info.batchParams.valueAt(j); @@ -309,7 +309,7 @@ int SensorDevice::getHalDeviceVersion() const { return mSensorDevice->common.version; } -status_t SensorDevice::flush(void* ident, int handle) { +status_t SensorDevice::flush(void* /*ident*/, int handle) { if (getHalDeviceVersion() < SENSORS_DEVICE_API_VERSION_1_1) { return INVALID_OPERATION; } diff --git a/services/sensorservice/SensorFusion.cpp b/services/sensorservice/SensorFusion.cpp index 03f94be..bb97286 100644 --- a/services/sensorservice/SensorFusion.cpp +++ b/services/sensorservice/SensorFusion.cpp @@ -147,7 +147,7 @@ int32_t SensorFusion::getMinDelay() const { void SensorFusion::dump(String8& result) { const Fusion& fusion(mFusion); - result.appendFormat("9-axis fusion %s (%d clients), gyro-rate=%7.2fHz, " + result.appendFormat("9-axis fusion %s (%zd clients), gyro-rate=%7.2fHz, " "q=< %g, %g, %g, %g > (%g), " "b=< %g, %g, %g >\n", mEnabled ? "enabled" : "disabled", diff --git a/services/sensorservice/SensorInterface.cpp b/services/sensorservice/SensorInterface.cpp index f1d1663..2bf5e72 100644 --- a/services/sensorservice/SensorInterface.cpp +++ b/services/sensorservice/SensorInterface.cpp @@ -50,7 +50,7 @@ status_t HardwareSensor::activate(void* ident, bool enabled) { return mSensorDevice.activate(ident, mSensor.getHandle(), enabled); } -status_t HardwareSensor::batch(void* ident, int handle, int flags, +status_t HardwareSensor::batch(void* ident, int /*handle*/, int flags, int64_t samplingPeriodNs, int64_t maxBatchReportLatencyNs) { return mSensorDevice.batch(ident, mSensor.getHandle(), flags, samplingPeriodNs, maxBatchReportLatencyNs); diff --git a/services/sensorservice/SensorInterface.h b/services/sensorservice/SensorInterface.h index c295e22..3e76377 100644 --- a/services/sensorservice/SensorInterface.h +++ b/services/sensorservice/SensorInterface.h @@ -40,7 +40,7 @@ public: virtual status_t setDelay(void* ident, int handle, int64_t ns) = 0; // Not all sensors need to support batching. - virtual status_t batch(void* ident, int handle, int flags, int64_t samplingPeriodNs, + virtual status_t batch(void* ident, int handle, int /*flags*/, int64_t samplingPeriodNs, int64_t maxBatchReportLatencyNs) { if (maxBatchReportLatencyNs == 0) { return setDelay(ident, handle, samplingPeriodNs); @@ -48,13 +48,13 @@ public: return -EINVAL; } - virtual status_t flush(void* ident, int handle) { + virtual status_t flush(void* /*ident*/, int /*handle*/) { return -EINVAL; } virtual Sensor getSensor() const = 0; virtual bool isVirtual() const = 0; - virtual void autoDisable(void *ident, int handle) { } + virtual void autoDisable(void* /*ident*/, int /*handle*/) { } }; // --------------------------------------------------------------------------- diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp index a2f4332..9cc75c6 100644 --- a/services/sensorservice/SensorService.cpp +++ b/services/sensorservice/SensorService.cpp @@ -14,8 +14,9 @@ * limitations under the License. */ -#include <stdint.h> +#include <inttypes.h> #include <math.h> +#include <stdint.h> #include <sys/types.h> #include <cutils/properties.h> @@ -153,7 +154,7 @@ void SensorService::onFirstRef() char line[128]; if (fp != NULL && fgets(line, sizeof(line), fp) != NULL) { line[sizeof(line) - 1] = '\0'; - sscanf(line, "%u", &mSocketBufferSize); + sscanf(line, "%zu", &mSocketBufferSize); if (mSocketBufferSize > MAX_SOCKET_BUFFER_SIZE_BATCHED) { mSocketBufferSize = MAX_SOCKET_BUFFER_SIZE_BATCHED; } @@ -200,7 +201,7 @@ SensorService::~SensorService() static const String16 sDump("android.permission.DUMP"); -status_t SensorService::dump(int fd, const Vector<String16>& args) +status_t SensorService::dump(int fd, const Vector<String16>& /*args*/) { String8 result; if (!PermissionCache::checkCallingPermission(sDump)) { @@ -257,7 +258,7 @@ status_t SensorService::dump(int fd, const Vector<String16>& args) result.appendFormat( "last=<%f>\n", e.data[0]); break; case SENSOR_TYPE_STEP_COUNTER: - result.appendFormat( "last=<%llu>\n", e.u64.step_counter); + result.appendFormat( "last=<%" PRIu64 ">\n", e.u64.step_counter); break; default: // default to 3 values @@ -273,19 +274,19 @@ status_t SensorService::dump(int fd, const Vector<String16>& args) result.append("Active sensors:\n"); for (size_t i=0 ; i<mActiveSensors.size() ; i++) { int handle = mActiveSensors.keyAt(i); - result.appendFormat("%s (handle=0x%08x, connections=%d)\n", + result.appendFormat("%s (handle=0x%08x, connections=%zu)\n", getSensorName(handle).string(), handle, mActiveSensors.valueAt(i)->getNumConnections()); } - result.appendFormat("%u Max Socket Buffer size\n", mSocketBufferSize); - result.appendFormat("%d active connections\n", mActiveConnections.size()); + result.appendFormat("%zu Max Socket Buffer size\n", mSocketBufferSize); + result.appendFormat("%zd active connections\n", mActiveConnections.size()); for (size_t i=0 ; i < mActiveConnections.size() ; i++) { sp<SensorEventConnection> connection(mActiveConnections[i].promote()); if (connection != 0) { - result.appendFormat("Connection Number: %d \n", i); + result.appendFormat("Connection Number: %zu \n", i); connection->dump(result); } } diff --git a/services/sensorservice/main_sensorservice.cpp b/services/sensorservice/main_sensorservice.cpp index 303b65f..0a96f42 100644 --- a/services/sensorservice/main_sensorservice.cpp +++ b/services/sensorservice/main_sensorservice.cpp @@ -19,7 +19,7 @@ using namespace android; -int main(int argc, char** argv) { +int main(int /*argc*/, char** /*argv*/) { SensorService::publishAndJoinThreadPool(); return 0; } |