From a56793f401054b333a57ebf8bed3d5bb5d238e4b Mon Sep 17 00:00:00 2001 From: Niclas Finne Date: Fri, 23 Sep 2011 15:49:00 +0200 Subject: [PATCH] Fixed compiler warnings --- core/lib/sensors.c | 10 +++++----- core/lib/sensors.h | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/lib/sensors.c b/core/lib/sensors.c index 54bb204cf..85018552c 100644 --- a/core/lib/sensors.c +++ b/core/lib/sensors.c @@ -39,7 +39,7 @@ #include "lib/sensors.h" -extern struct sensors_sensor *sensors[]; +const extern struct sensors_sensor *sensors[]; extern unsigned char sensors_flags[]; #define FLAG_CHANGED 0x80 @@ -63,13 +63,13 @@ get_sensor_index(const struct sensors_sensor *s) return i; } /*---------------------------------------------------------------------------*/ -struct sensors_sensor * +const struct sensors_sensor * sensors_first(void) { return sensors[0]; } /*---------------------------------------------------------------------------*/ -struct sensors_sensor * +const struct sensors_sensor * sensors_next(const struct sensors_sensor *s) { return sensors[get_sensor_index(s) + 1]; @@ -82,7 +82,7 @@ sensors_changed(const struct sensors_sensor *s) process_poll(&sensors_process); } /*---------------------------------------------------------------------------*/ -struct sensors_sensor * +const struct sensors_sensor * sensors_find(const char *prefix) { int i; @@ -123,7 +123,7 @@ PROCESS_THREAD(sensors_process, ev, data) events = 0; for(i = 0; i < num_sensors; ++i) { if(sensors_flags[i] & FLAG_CHANGED) { - if(process_post(PROCESS_BROADCAST, sensors_event, sensors[i]) == PROCESS_ERR_OK) { + if(process_post(PROCESS_BROADCAST, sensors_event, (void *)sensors[i]) == PROCESS_ERR_OK) { PROCESS_WAIT_EVENT_UNTIL(ev == sensors_event); } sensors_flags[i] &= ~FLAG_CHANGED; diff --git a/core/lib/sensors.h b/core/lib/sensors.h index 07955a924..6872ae9f1 100644 --- a/core/lib/sensors.h +++ b/core/lib/sensors.h @@ -60,9 +60,9 @@ struct sensors_sensor { int (* status) (int type); }; -struct sensors_sensor *sensors_find(const char *type); -struct sensors_sensor *sensors_next(const struct sensors_sensor *s); -struct sensors_sensor *sensors_first(void); +const struct sensors_sensor *sensors_find(const char *type); +const struct sensors_sensor *sensors_next(const struct sensors_sensor *s); +const struct sensors_sensor *sensors_first(void); void sensors_changed(const struct sensors_sensor *s);