Fixed compiler warnings

This commit is contained in:
Niclas Finne 2011-09-23 15:49:00 +02:00
parent f4f84ffca4
commit a56793f401
2 changed files with 8 additions and 8 deletions

View file

@ -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;

View file

@ -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);