From 9c1c90e92e13a56401b16ce77a23959dc4a5ab63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= Date: Wed, 12 Nov 2014 14:45:58 +0100 Subject: [PATCH] Fix unused variables. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The return value of jniRegisterNativeMethods is checked only in LOG_FATAL_IF, which defines to nothing in the LOG_NDEBUG case. Fake a use of the 'res' variable to shut off warnings when LOG_NDEBUG. Change-Id: I8263610f327c56897f76796fe1fbc2b325b0559f Signed-off-by: Bernhard Rosenkränzer --- .../core/jni/com_android_server_input_InputApplicationHandle.cpp | 1 + .../core/jni/com_android_server_input_InputManagerService.cpp | 1 + services/core/jni/com_android_server_input_InputWindowHandle.cpp | 1 + .../core/jni/com_android_server_power_PowerManagerService.cpp | 1 + 4 files changed, 4 insertions(+) diff --git a/services/core/jni/com_android_server_input_InputApplicationHandle.cpp b/services/core/jni/com_android_server_input_InputApplicationHandle.cpp index f943d168e7d66..11388d80a9d26 100644 --- a/services/core/jni/com_android_server_input_InputApplicationHandle.cpp +++ b/services/core/jni/com_android_server_input_InputApplicationHandle.cpp @@ -137,6 +137,7 @@ static JNINativeMethod gInputApplicationHandleMethods[] = { int register_android_server_InputApplicationHandle(JNIEnv* env) { int res = jniRegisterNativeMethods(env, "com/android/server/input/InputApplicationHandle", gInputApplicationHandleMethods, NELEM(gInputApplicationHandleMethods)); + (void) res; // Faked use when LOG_NDEBUG. LOG_FATAL_IF(res < 0, "Unable to register native methods."); jclass clazz; diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp index 5d73af8ea4e8d..7c5980a74a8a3 100644 --- a/services/core/jni/com_android_server_input_InputManagerService.cpp +++ b/services/core/jni/com_android_server_input_InputManagerService.cpp @@ -1416,6 +1416,7 @@ static JNINativeMethod gInputManagerMethods[] = { int register_android_server_InputManager(JNIEnv* env) { int res = jniRegisterNativeMethods(env, "com/android/server/input/InputManagerService", gInputManagerMethods, NELEM(gInputManagerMethods)); + (void) res; // Faked use when LOG_NDEBUG. LOG_FATAL_IF(res < 0, "Unable to register native methods."); // Callbacks diff --git a/services/core/jni/com_android_server_input_InputWindowHandle.cpp b/services/core/jni/com_android_server_input_InputWindowHandle.cpp index 03bf7eb2df991..5e15db5737008 100644 --- a/services/core/jni/com_android_server_input_InputWindowHandle.cpp +++ b/services/core/jni/com_android_server_input_InputWindowHandle.cpp @@ -230,6 +230,7 @@ static JNINativeMethod gInputWindowHandleMethods[] = { int register_android_server_InputWindowHandle(JNIEnv* env) { int res = jniRegisterNativeMethods(env, "com/android/server/input/InputWindowHandle", gInputWindowHandleMethods, NELEM(gInputWindowHandleMethods)); + (void) res; // Faked use when LOG_NDEBUG. LOG_FATAL_IF(res < 0, "Unable to register native methods."); jclass clazz; diff --git a/services/core/jni/com_android_server_power_PowerManagerService.cpp b/services/core/jni/com_android_server_power_PowerManagerService.cpp index db642ddcf5eb1..6dcdd9d08de63 100644 --- a/services/core/jni/com_android_server_power_PowerManagerService.cpp +++ b/services/core/jni/com_android_server_power_PowerManagerService.cpp @@ -189,6 +189,7 @@ static JNINativeMethod gPowerManagerServiceMethods[] = { int register_android_server_PowerManagerService(JNIEnv* env) { int res = jniRegisterNativeMethods(env, "com/android/server/power/PowerManagerService", gPowerManagerServiceMethods, NELEM(gPowerManagerServiceMethods)); + (void) res; // Faked use when LOG_NDEBUG. LOG_FATAL_IF(res < 0, "Unable to register native methods."); // Callbacks