From fc862f3a4c433c67605f12ad2d9addc6fc1bc831 Mon Sep 17 00:00:00 2001 From: Dheeraj CVR Date: Thu, 11 Jun 2015 16:44:25 +0400 Subject: libsensors: switch to portable typedefs to match callbacks Using a strict basetype only coding style is not a good idea especially when we are dealing with callbacks which use portable typedef like int64_t. This kind of coding style would most likely end up in overflows at various places especially when dealing with timestamps and sensor delays which are caused when typecasting datatypes of different size. Switch to portable typedefs and get rid of "long". Change-Id: I75b9cace7602345dba9095f046292e6d4db07df4 --- libsensors/akm8975.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libsensors/akm8975.c') diff --git a/libsensors/akm8975.c b/libsensors/akm8975.c index 00f69ff..47771fb 100644 --- a/libsensors/akm8975.c +++ b/libsensors/akm8975.c @@ -42,7 +42,7 @@ struct akm8975_data { AK8975PRMS akfs_params; sensors_vec_t magnetic; - long int delay; + int64_t delay; int device_fd; int uinput_fd; @@ -166,7 +166,7 @@ void *akm8975_thread(void *thread_data) char i2c_data[SENSOR_DATA_SIZE] = { 0 }; short magnetic_data[3]; short mode; - long long int before, after; + int64_t before, after; int diff; int device_fd; int uinput_fd; @@ -520,11 +520,11 @@ int akm8975_deactivate(struct smdk4x12_sensors_handlers *handlers) return 0; } -int akm8975_set_delay(struct smdk4x12_sensors_handlers *handlers, long int delay) +int akm8975_set_delay(struct smdk4x12_sensors_handlers *handlers, int64_t delay) { struct akm8975_data *data; - ALOGD("%s(%p, %ld)", __func__, handlers, delay); + ALOGD("%s(%p, %" PRId64 ")", __func__, handlers, delay); if (handlers == NULL || handlers->data == NULL) return -EINVAL; -- cgit v1.1