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
This commit is contained in:
Andreas Gampe
2014-11-12 08:03:48 -08:00
parent aa420b146b
commit 76d0e9f03e

View File

@@ -17,6 +17,7 @@
#define LOG_TAG "NetworkStats"
#include <errno.h>
#include <inttypes.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -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) {