From a5c106a4f0afcf061728a1cb7c8c3b908728575d Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Thu, 19 Apr 2012 18:18:24 -0700 Subject: [PATCH] fix a typo causing sensor event to be sorted in reverse chronological order Change-Id: I041c64616d88ed1abb5efc90ed9eb0d9baeb4832 --- services/sensorservice/SensorService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp index 16ddd9115..d3b667f13 100644 --- a/services/sensorservice/SensorService.cpp +++ b/services/sensorservice/SensorService.cpp @@ -316,7 +316,7 @@ void SensorService::sortEventBuffer(sensors_event_t* buffer, size_t count) static int cmp(void const* lhs, void const* rhs) { sensors_event_t const* l = static_cast(lhs); sensors_event_t const* r = static_cast(rhs); - return r->timestamp - l->timestamp; + return l->timestamp - r->timestamp; } }; qsort(buffer, count, sizeof(sensors_event_t), compar::cmp);