aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2016-01-29 11:59:29 -0800
committerDan Albert <danalbert@google.com>2016-01-29 11:59:29 -0800
commit2182f792a453c9fa65cd83aae827c501c210a51b (patch)
tree9d7d3c25e2c8cd5115318fa92b7a987fe87cd847
parent9ec0fcb7ec691bebf3dae16600fafa75ffddafe6 (diff)
downloadndk-2182f792a453c9fa65cd83aae827c501c210a51b.tar.gz
Fix cpufeatures for -Wall/-Wextra.
Bug: http://b/26403333 Change-Id: Ia776b21f660d653ecd2e35e4c810ece9d0e4028f
-rw-r--r--sources/android/cpufeatures/Android.mk1
-rw-r--r--sources/android/cpufeatures/cpu-features.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/sources/android/cpufeatures/Android.mk b/sources/android/cpufeatures/Android.mk
index 46044716f..7c453fabe 100644
--- a/sources/android/cpufeatures/Android.mk
+++ b/sources/android/cpufeatures/Android.mk
@@ -14,6 +14,7 @@ else # NDK build system
include $(CLEAR_VARS)
LOCAL_MODULE := cpufeatures
LOCAL_SRC_FILES := cpu-features.c
+LOCAL_CFLAGS := -Wall -Wextra -Werror
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_EXPORT_LDLIBS := -ldl
include $(BUILD_STATIC_LIBRARY)
diff --git a/sources/android/cpufeatures/cpu-features.c b/sources/android/cpufeatures/cpu-features.c
index 06cfa0b63..b2069c021 100644
--- a/sources/android/cpufeatures/cpu-features.c
+++ b/sources/android/cpufeatures/cpu-features.c
@@ -198,6 +198,7 @@ read_file(const char* pathname, char* buffer, size_t buffsize)
return count;
}
+#ifdef __arm__
/* Extract the content of a the first occurence of a given field in
* the content of /proc/cpuinfo and return it as a heap-allocated
* string that must be freed by the caller.
@@ -283,6 +284,7 @@ has_list_item(const char* list, const char* item)
}
return 0;
}
+#endif /* __arm__ */
/* Parse a number starting from 'input', but not going further
* than 'limit'. Return the value into '*result'.
@@ -327,11 +329,13 @@ parse_decimal(const char* input, const char* limit, int* result)
return parse_number(input, limit, 10, result);
}
+#ifdef __arm__
static const char*
parse_hexadecimal(const char* input, const char* limit, int* result)
{
return parse_number(input, limit, 16, result);
}
+#endif /* __arm__ */
/* This small data type is used to represent a CPU list / mask, as read
* from sysfs on Linux. See http://www.kernel.org/doc/Documentation/cputopology.txt