diff options
author | Chih-hung Hsieh <chh@google.com> | 2017-10-12 01:35:35 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-10-12 01:35:35 +0000 |
commit | e142c9411326745b316f23d8b6d5992eb55b8f22 (patch) | |
tree | 639808cd095066630410be3987800e15198168a4 | |
parent | 266f541100e88a295277d594bc026a9a866349dc (diff) | |
parent | d67dcc5fc8a63f5b575df189114f2a9e1364ce51 (diff) | |
download | libhardware-e142c9411326745b316f23d8b6d5992eb55b8f22.tar.gz |
Merge "Use -Werror in hardware/libhardware" am: d1a2b9f7c1
am: d67dcc5fc8
Change-Id: Id15a9a3ae5769ddd6a143691de98e80eb72e06a8
-rw-r--r-- | Android.bp | 6 | ||||
-rw-r--r-- | modules/consumerir/Android.bp | 1 | ||||
-rw-r--r-- | modules/fingerprint/Android.bp | 1 | ||||
-rw-r--r-- | modules/local_time/Android.bp | 1 | ||||
-rw-r--r-- | modules/local_time/local_time_hw.c | 2 | ||||
-rw-r--r-- | modules/nfc-nci/Android.bp | 1 | ||||
-rw-r--r-- | modules/nfc/Android.bp | 1 | ||||
-rw-r--r-- | modules/power/Android.bp | 1 | ||||
-rw-r--r-- | modules/sensors/Android.bp | 1 | ||||
-rw-r--r-- | modules/sensors/multihal.cpp | 10 | ||||
-rw-r--r-- | modules/tv_input/Android.bp | 1 | ||||
-rw-r--r-- | modules/vibrator/Android.bp | 1 | ||||
-rw-r--r-- | modules/vibrator/vibrator.c | 1 | ||||
-rw-r--r-- | tests/fingerprint/Android.bp | 1 | ||||
-rw-r--r-- | tests/nusensors/Android.bp | 2 |
15 files changed, 18 insertions, 13 deletions
@@ -29,7 +29,11 @@ cc_library_shared { "libdl", "libvndksupport", ], - cflags: ["-DQEMU_HARDWARE"], + cflags: [ + "-DQEMU_HARDWARE", + "-Wall", + "-Werror", + ], header_libs: ["libhardware_headers"], export_header_lib_headers: ["libhardware_headers"], diff --git a/modules/consumerir/Android.bp b/modules/consumerir/Android.bp index 6ba37b62..4f700c2a 100644 --- a/modules/consumerir/Android.bp +++ b/modules/consumerir/Android.bp @@ -17,6 +17,7 @@ cc_library_shared { relative_install_path: "hw", proprietary: true, srcs: ["consumerir.c"], + cflags: ["-Wall", "-Werror"], header_libs: ["libhardware_headers"], shared_libs: [ "liblog", diff --git a/modules/fingerprint/Android.bp b/modules/fingerprint/Android.bp index a8246082..22648b1b 100644 --- a/modules/fingerprint/Android.bp +++ b/modules/fingerprint/Android.bp @@ -17,6 +17,7 @@ cc_library_shared { relative_install_path: "hw", proprietary: true, srcs: ["fingerprint.c"], + cflags: ["-Wall", "-Werror"], header_libs: ["libhardware_headers"], shared_libs: ["liblog"], } diff --git a/modules/local_time/Android.bp b/modules/local_time/Android.bp index 153b7e4a..9f140b34 100644 --- a/modules/local_time/Android.bp +++ b/modules/local_time/Android.bp @@ -26,6 +26,7 @@ cc_library_shared { relative_install_path: "hw", proprietary: true, srcs: ["local_time_hw.c"], + cflags: ["-Wall", "-Werror"], header_libs: ["libhardware_headers"], shared_libs: [ "liblog", diff --git a/modules/local_time/local_time_hw.c b/modules/local_time/local_time_hw.c index a2d1a9e5..0350e242 100644 --- a/modules/local_time/local_time_hw.c +++ b/modules/local_time/local_time_hw.c @@ -72,8 +72,6 @@ static int ltdev_open(const hw_module_t* module, const char* name, hw_device_t** device) { struct stub_local_time_device *ltdev; - struct timespec ts; - int ret; if (strcmp(name, LOCAL_TIME_HARDWARE_INTERFACE) != 0) return -EINVAL; diff --git a/modules/nfc-nci/Android.bp b/modules/nfc-nci/Android.bp index f4ef64e2..669f7202 100644 --- a/modules/nfc-nci/Android.bp +++ b/modules/nfc-nci/Android.bp @@ -21,4 +21,5 @@ cc_library_shared { "liblog", "libcutils", ], + cflags: ["-Wall", "-Werror"], } diff --git a/modules/nfc/Android.bp b/modules/nfc/Android.bp index b4bc9b1f..7c69f114 100644 --- a/modules/nfc/Android.bp +++ b/modules/nfc/Android.bp @@ -17,6 +17,7 @@ cc_library_shared { relative_install_path: "hw", proprietary: true, srcs: ["nfc_pn544_example.c"], + cflags: ["-Wall", "-Werror"], header_libs: ["libhardware_headers"], shared_libs: [ "liblog", diff --git a/modules/power/Android.bp b/modules/power/Android.bp index 41ac45c6..6b0b31fb 100644 --- a/modules/power/Android.bp +++ b/modules/power/Android.bp @@ -17,6 +17,7 @@ cc_library_shared { relative_install_path: "hw", proprietary: true, srcs: ["power.c"], + cflags: ["-Wall", "-Werror"], header_libs: [ "libhardware_headers", "libutils_headers", diff --git a/modules/sensors/Android.bp b/modules/sensors/Android.bp index 1d150655..64cf2a9e 100644 --- a/modules/sensors/Android.bp +++ b/modules/sensors/Android.bp @@ -12,4 +12,5 @@ cc_library_static { "libdl" ], export_include_dirs: ["."], + cflags: ["-Wall", "-Werror"], } diff --git a/modules/sensors/multihal.cpp b/modules/sensors/multihal.cpp index b5360cc8..a1f01046 100644 --- a/modules/sensors/multihal.cpp +++ b/modules/sensors/multihal.cpp @@ -515,6 +515,7 @@ static int device__close(struct hw_device_t *dev) { if (ctx != NULL) { int retval = ctx->close(); delete ctx; + return retval; } if (sub_hw_modules != nullptr) { @@ -586,15 +587,6 @@ static int device__config_direct_report(struct sensors_poll_device_1 *dev, static int open_sensors(const struct hw_module_t* module, const char* name, struct hw_device_t** device); -static bool starts_with(const char* s, const char* prefix) { - if (s == NULL || prefix == NULL) { - return false; - } - size_t s_size = strlen(s); - size_t prefix_size = strlen(prefix); - return s_size >= prefix_size && strncmp(s, prefix, prefix_size) == 0; -} - /* * Adds valid paths from the config file to the vector passed in. * The vector must not be null. diff --git a/modules/tv_input/Android.bp b/modules/tv_input/Android.bp index 4d2369eb..b9d8afa0 100644 --- a/modules/tv_input/Android.bp +++ b/modules/tv_input/Android.bp @@ -22,4 +22,5 @@ cc_library_shared { "liblog", ], srcs: ["tv_input.cpp"], + cflags: ["-Wall", "-Werror"], } diff --git a/modules/vibrator/Android.bp b/modules/vibrator/Android.bp index fdbfd611..13ffc835 100644 --- a/modules/vibrator/Android.bp +++ b/modules/vibrator/Android.bp @@ -21,5 +21,6 @@ cc_library_shared { proprietary: true, header_libs: ["libhardware_headers"], srcs: ["vibrator.c"], + cflags: ["-Wall", "-Werror"], shared_libs: ["liblog"], } diff --git a/modules/vibrator/vibrator.c b/modules/vibrator/vibrator.c index 950bc599..8042b570 100644 --- a/modules/vibrator/vibrator.c +++ b/modules/vibrator/vibrator.c @@ -108,7 +108,6 @@ static int write_led_file(const char *file, const char *value) static bool vibra_led_exists() { - int fd; char file_str[50]; snprintf(file_str, sizeof(file_str), "%s/%s", LED_DEVICE, "activate"); diff --git a/tests/fingerprint/Android.bp b/tests/fingerprint/Android.bp index 7de3dee2..9524b7ba 100644 --- a/tests/fingerprint/Android.bp +++ b/tests/fingerprint/Android.bp @@ -9,6 +9,7 @@ cc_test { cflags: [ "-Wall", + "-Werror", "-Wextra", ], } diff --git a/tests/nusensors/Android.bp b/tests/nusensors/Android.bp index e9234684..8b267dba 100644 --- a/tests/nusensors/Android.bp +++ b/tests/nusensors/Android.bp @@ -3,6 +3,8 @@ cc_binary { srcs: ["nusensors.cpp"], + cflags: ["-Wall", "-Werror"], + shared_libs: [ "libcutils", "libhardware", |