summaryrefslogtreecommitdiffstats
path: root/core/jni/android_hardware_SensorManager.cpp
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-09-13 23:17:30 -0700
committerJeff Brown <jeffbrown@google.com>2010-09-14 01:59:45 -0700
commit4fe6c3e51be77e35f40872cdbca6c80f8f8b7ecb (patch)
tree5cbcfad147ad1bf26deb384e41d27f4e6bfcdb80 /core/jni/android_hardware_SensorManager.cpp
parentc891d2b3529b9cf24ef4781a585cd4784815e711 (diff)
downloadframeworks_base-4fe6c3e51be77e35f40872cdbca6c80f8f8b7ecb.zip
frameworks_base-4fe6c3e51be77e35f40872cdbca6c80f8f8b7ecb.tar.gz
frameworks_base-4fe6c3e51be77e35f40872cdbca6c80f8f8b7ecb.tar.bz2
Replace epoll() with poll() and rename PollLoop to Looper.
As part of this change, consolidated and cleaned up the Looper API so that there are fewer distinctions between the NDK and non-NDK declarations (no need for two callback types, etc.). Removed the dependence on specific constants from sys/poll.h such as POLLIN. Instead looper.h defines events like LOOPER_EVENT_INPUT for the events that it supports. That should help make any future under-the-hood implementation changes easier. Fixed a couple of compiler warnings along the way. Change-Id: I449a7ec780bf061bdd325452f823673e2b39b6ae
Diffstat (limited to 'core/jni/android_hardware_SensorManager.cpp')
-rw-r--r--core/jni/android_hardware_SensorManager.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/jni/android_hardware_SensorManager.cpp b/core/jni/android_hardware_SensorManager.cpp
index e29495c..10ceb7b 100644
--- a/core/jni/android_hardware_SensorManager.cpp
+++ b/core/jni/android_hardware_SensorManager.cpp
@@ -60,7 +60,7 @@ sensors_module_get_next_sensor(JNIEnv *env, jobject clazz, jobject sensor, jint
Sensor const* const* sensorList;
size_t count = mgr.getSensorList(&sensorList);
- if (next >= count)
+ if (size_t(next) >= count)
return -1;
Sensor const* const list = sensorList[next];
@@ -78,7 +78,7 @@ sensors_module_get_next_sensor(JNIEnv *env, jobject clazz, jobject sensor, jint
env->SetIntField(sensor, sensorOffsets.minDelay, list->getMinDelay());
next++;
- return next<count ? next : 0;
+ return size_t(next) < count ? next : 0;
}
//----------------------------------------------------------------------------