summaryrefslogtreecommitdiffstats
path: root/libsensors/input.c
diff options
context:
space:
mode:
authorDheeraj CVR <cvr.dheeraj@gmail.com>2015-06-11 16:44:25 +0400
committerforkbomb <keepcalm444@gmail.com>2015-11-25 08:34:55 +1100
commitfc862f3a4c433c67605f12ad2d9addc6fc1bc831 (patch)
treea753c448934c1ef459b302d5d60d46a07f694d6b /libsensors/input.c
parentea6c7d9c8609022e19200d888f449139139d9173 (diff)
downloaddevice_samsung_i9300-fc862f3a4c433c67605f12ad2d9addc6fc1bc831.zip
device_samsung_i9300-fc862f3a4c433c67605f12ad2d9addc6fc1bc831.tar.gz
device_samsung_i9300-fc862f3a4c433c67605f12ad2d9addc6fc1bc831.tar.bz2
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
Diffstat (limited to 'libsensors/input.c')
-rw-r--r--libsensors/input.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libsensors/input.c b/libsensors/input.c
index d78dc64..eef2a8d 100644
--- a/libsensors/input.c
+++ b/libsensors/input.c
@@ -44,7 +44,7 @@ void input_event_set(struct input_event *event, int type, int code, int value)
gettimeofday(&event->time, NULL);
}
-long long int timestamp(struct timeval *time)
+int64_t timestamp(struct timeval *time)
{
if (time == NULL)
return -1;
@@ -52,7 +52,7 @@ long long int timestamp(struct timeval *time)
return time->tv_sec * 1000000000LL + time->tv_usec * 1000;
}
-long long int input_timestamp(struct input_event *event)
+int64_t input_timestamp(struct input_event *event)
{
if (event == NULL)
return -1;