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:
@@ -17,6 +17,7 @@
|
|||||||
#define LOG_TAG "NetworkStats"
|
#define LOG_TAG "NetworkStats"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <inttypes.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
@@ -187,7 +188,7 @@ static int readNetworkStatsDetail(JNIEnv* env, jclass clazz, jobject stats,
|
|||||||
if (endPos - pos == 3) {
|
if (endPos - pos == 3) {
|
||||||
rawTag = 0;
|
rawTag = 0;
|
||||||
} else {
|
} else {
|
||||||
if (sscanf(pos, "%llx", &rawTag) != 1) {
|
if (sscanf(pos, "%" PRIx64, &rawTag) != 1) {
|
||||||
ALOGE("bad tag: %s", pos);
|
ALOGE("bad tag: %s", pos);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
return -1;
|
return -1;
|
||||||
@@ -204,7 +205,7 @@ static int readNetworkStatsDetail(JNIEnv* env, jclass clazz, jobject stats,
|
|||||||
while (*pos == ' ') pos++;
|
while (*pos == ' ') pos++;
|
||||||
|
|
||||||
// Parse remaining fields.
|
// 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.uid, &s.set, &s.rxBytes, &s.rxPackets,
|
||||||
&s.txBytes, &s.txPackets) == 6) {
|
&s.txBytes, &s.txPackets) == 6) {
|
||||||
if (limitUid != -1 && limitUid != s.uid) {
|
if (limitUid != -1 && limitUid != s.uid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user