healthd: Turn on -Werror
Change-Id: I72caf38008ee7d842dfacd3f58add9bc8e4787e8
diff --git a/healthd/Android.mk b/healthd/Android.mk
index 715c2ed..1d238b1 100644
--- a/healthd/Android.mk
+++ b/healthd/Android.mk
@@ -7,6 +7,7 @@
include $(CLEAR_VARS)
LOCAL_SRC_FILES := healthd_board_default.cpp
LOCAL_MODULE := libhealthd.default
+LOCAL_CFLAGS := -Werror
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
@@ -24,7 +25,7 @@
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN)
LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)
-LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS
+LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror
ifeq ($(strip $(BOARD_CHARGER_DISABLE_INIT_BLANK)),true)
LOCAL_CFLAGS += -DCHARGER_DISABLE_INIT_BLANK
diff --git a/healthd/BatteryMonitor.cpp b/healthd/BatteryMonitor.cpp
index 9368225..7310994 100644
--- a/healthd/BatteryMonitor.cpp
+++ b/healthd/BatteryMonitor.cpp
@@ -37,7 +37,7 @@
namespace android {
struct sysfsStringEnumMap {
- char* s;
+ const char* s;
int val;
};
diff --git a/healthd/BatteryPropertiesRegistrar.cpp b/healthd/BatteryPropertiesRegistrar.cpp
index 272b6d7..74bcbfd 100644
--- a/healthd/BatteryPropertiesRegistrar.cpp
+++ b/healthd/BatteryPropertiesRegistrar.cpp
@@ -76,7 +76,7 @@
return healthd_get_property(id, val);
}
-status_t BatteryPropertiesRegistrar::dump(int fd, const Vector<String16>& args) {
+status_t BatteryPropertiesRegistrar::dump(int fd, const Vector<String16>& /*args*/) {
IPCThreadState* self = IPCThreadState::self();
const int pid = self->getCallingPid();
const int uid = self->getCallingUid();
diff --git a/healthd/healthd.cpp b/healthd/healthd.cpp
index 8363c41..5fe2965 100644
--- a/healthd/healthd.cpp
+++ b/healthd/healthd.cpp
@@ -118,7 +118,7 @@
.battery_update = healthd_mode_nop_battery_update,
};
-static void healthd_mode_nop_init(struct healthd_config *config) {
+static void healthd_mode_nop_init(struct healthd_config* /*config*/) {
}
static int healthd_mode_nop_preparetowait(void) {
@@ -129,7 +129,7 @@
}
static void healthd_mode_nop_battery_update(
- struct android::BatteryProperties *props) {
+ struct android::BatteryProperties* /*props*/) {
}
int healthd_register_event(int fd, void (*handler)(uint32_t)) {
@@ -205,7 +205,7 @@
}
#define UEVENT_MSG_LEN 1024
-static void uevent_event(uint32_t epevents) {
+static void uevent_event(uint32_t /*epevents*/) {
char msg[UEVENT_MSG_LEN+2];
char *cp;
int n;
@@ -246,7 +246,7 @@
"register for uevent events failed\n");
}
-static void wakealarm_event(uint32_t epevents) {
+static void wakealarm_event(uint32_t /*epevents*/) {
unsigned long long wakeups;
if (read(wakealarm_fd, &wakeups, sizeof(wakeups)) == -1) {
diff --git a/healthd/healthd_mode_android.cpp b/healthd/healthd_mode_android.cpp
index 4887c8c..fd153a2 100644
--- a/healthd/healthd_mode_android.cpp
+++ b/healthd/healthd_mode_android.cpp
@@ -42,11 +42,11 @@
return -1;
}
-static void binder_event(uint32_t epevents) {
+static void binder_event(uint32_t /*epevents*/) {
IPCThreadState::self()->handlePolledCommands();
}
-void healthd_mode_android_init(struct healthd_config *config) {
+void healthd_mode_android_init(struct healthd_config* /*config*/) {
ProcessState::self()->setThreadPoolMaxThreadCount(0);
IPCThreadState::self()->disableBackgroundScheduling(true);
IPCThreadState::self()->setupPolling(&gBinderFd);
diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp
index 710f5b6..5807079 100644
--- a/healthd/healthd_mode_charger.cpp
+++ b/healthd/healthd_mode_charger.cpp
@@ -249,7 +249,7 @@
return autosuspend_disable();
}
#else
-static int request_suspend(bool enable)
+static int request_suspend(bool /*enable*/)
{
return 0;
}
@@ -274,7 +274,7 @@
}
/* returns the last y-offset of where the surface ends */
-static int draw_surface_centered(struct charger *charger, gr_surface surface)
+static int draw_surface_centered(struct charger* /*charger*/, gr_surface surface)
{
int w;
int h;
@@ -617,7 +617,7 @@
return 0;
}
-static void charger_event_handler(uint32_t epevents)
+static void charger_event_handler(uint32_t /*epevents*/)
{
int ret;
@@ -626,7 +626,7 @@
ev_dispatch();
}
-void healthd_mode_charger_init(struct healthd_config *config)
+void healthd_mode_charger_init(struct healthd_config* /*config*/)
{
int ret;
struct charger *charger = &charger_state;