From d75f9027706d445e1c7b5c208afed8dbe48d4d67 Mon Sep 17 00:00:00 2001 From: "kibak.yoon" Date: Tue, 2 Feb 2016 16:14:43 +0900 Subject: [PATCH] sensord: remove compiler warnings * type has to be signed int * change void * to char * when it uses for arithmetic Change-Id: Ib6be183729a0208efbb3ab8249ad94f277446846 Signed-off-by: kibak.yoon --- src/client/client_common.h | 2 +- src/client/sensor_event_listener.cpp | 2 +- src/server/sensor_event_dispatcher.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/client_common.h b/src/client/client_common.h index 7c6ae30..ef3b645 100644 --- a/src/client/client_common.h +++ b/src/client/client_common.h @@ -47,7 +47,7 @@ struct log_attr { struct log_element { log_id id; - unsigned int type; + int type; struct log_attr log_attr; }; diff --git a/src/client/sensor_event_listener.cpp b/src/client/sensor_event_listener.cpp index 52dada1..f5c2cf4 100644 --- a/src/client/sensor_event_listener.cpp +++ b/src/client/sensor_event_listener.cpp @@ -183,7 +183,7 @@ void sensor_event_listener::handle_events(void* event) } else { sensor_event_t *sensor_event = (sensor_event_t *)event; sensor_id = sensor_event->sensor_id; - sensor_event->data = (sensor_data_t *)((void *)sensor_event + sizeof(sensor_event_t)); + sensor_event->data = (sensor_data_t *)((char *)sensor_event + sizeof(sensor_event_t)); sensor_data = sensor_event->data; cur_time = sensor_event->data->timestamp; accuracy = sensor_event->data->accuracy; diff --git a/src/server/sensor_event_dispatcher.cpp b/src/server/sensor_event_dispatcher.cpp index 50e40f3..25b1ad2 100644 --- a/src/server/sensor_event_dispatcher.cpp +++ b/src/server/sensor_event_dispatcher.cpp @@ -214,7 +214,7 @@ void sensor_event_dispatcher::send_sensor_events(vector< pair > &eve } memcpy(event, sensor_events, sizeof(sensor_event_t)); - memcpy(event + sizeof(sensor_event_t), sensor_events->data, sensor_events->data_length); + memcpy((char *)event + sizeof(sensor_event_t), sensor_events->data, sensor_events->data_length); id_vec.clear(); client_info_manager.get_listener_ids(sensor_id, event_type, id_vec); -- 2.7.4