From 76d0e9f03ee6f239e8fe5822c05d251babf66919 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 12 Nov 2014 08:03:48 -0800 Subject: [PATCH] Frameworks/base: Wall Werror in core/jni Turn on -Wall -Werror in core/jni. Fix warnings. Clang TODO: For GCC we need to turn off Wunused-but-set-variable in the GL bindings. However, Clang doesn't have that warning and thus complains about an unknown pragma. It is necessary to make the pragma #ifdef-ed on the compiler being GCC. Change-Id: I14cab48d45c2771eef0432082356c47ed44a3d7f --- core/jni/com_android_internal_net_NetworkStatsFactory.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/jni/com_android_internal_net_NetworkStatsFactory.cpp b/core/jni/com_android_internal_net_NetworkStatsFactory.cpp index 2e2d0c7d8d..1fbe016740 100644 --- a/core/jni/com_android_internal_net_NetworkStatsFactory.cpp +++ b/core/jni/com_android_internal_net_NetworkStatsFactory.cpp @@ -17,6 +17,7 @@ #define LOG_TAG "NetworkStats" #include +#include #include #include @@ -187,7 +188,7 @@ static int readNetworkStatsDetail(JNIEnv* env, jclass clazz, jobject stats, if (endPos - pos == 3) { rawTag = 0; } else { - if (sscanf(pos, "%llx", &rawTag) != 1) { + if (sscanf(pos, "%" PRIx64, &rawTag) != 1) { ALOGE("bad tag: %s", pos); fclose(fp); return -1; @@ -204,7 +205,7 @@ static int readNetworkStatsDetail(JNIEnv* env, jclass clazz, jobject stats, while (*pos == ' ') pos++; // Parse remaining fields. - if (sscanf(pos, "%u %u %llu %llu %llu %llu", + if (sscanf(pos, "%u %u %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64, &s.uid, &s.set, &s.rxBytes, &s.rxPackets, &s.txBytes, &s.txPackets) == 6) { if (limitUid != -1 && limitUid != s.uid) {