summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjy910.yun <jy910.yun@samsung.com>2014-11-07 20:34:13 +0900
committerjy910.yun <jy910.yun@samsung.com>2014-11-07 20:51:31 +0900
commit91a0e7fb142585031152df4117675404e804eb00 (patch)
treed82de59afb2d3e33c0916d15a56a00550ee490ef
parent3c3a64225c9c0d8f218bf1976eff5f22cbb22e17 (diff)
downloadlibdevice-node-91a0e7fb142585031152df4117675404e804eb00.tar.gz
libdevice-node-91a0e7fb142585031152df4117675404e804eb00.tar.bz2
libdevice-node-91a0e7fb142585031152df4117675404e804eb00.zip
device-node: Enable Werror compiler flag
To remove the warnning messages and latent bugs Signed-off-by: jy910.yun <jy910.yun@samsung.com> Change-Id: I48ef0ea78dbd93bef5ebf44ac9d519822e955681
-rw-r--r--CMakeLists.txt1
-rw-r--r--include/device-internal.h4
-rw-r--r--src/device-node.c15
-rw-r--r--src/device-plugin.c2
4 files changed, 11 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6c7b887..677c5e6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,7 @@ INCLUDE(devices/CMakeLists.txt)
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g")
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Werror")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS} ${TARGET_SRCS})
diff --git a/include/device-internal.h b/include/device-internal.h
index e4e84ff..d093283 100644
--- a/include/device-internal.h
+++ b/include/device-internal.h
@@ -58,8 +58,8 @@ struct device {
int (*get_prop) (int property, int *val);
};
-void add_device(enum device_type *devtype);
-void remove_device(enum device_type *devtype);
+void add_device(const enum device_type *devtype);
+void remove_device(const enum device_type *devtype);
extern const OEM_sys_devman_plugin_interface *plugin_intf;
extern const OEM_sys_devman_plugin_interface default_plugin;
diff --git a/src/device-node.c b/src/device-node.c
index 52c74fb..a23ce2b 100644
--- a/src/device-node.c
+++ b/src/device-node.c
@@ -22,7 +22,6 @@
#include <errno.h>
#include "device-internal.h"
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})
@@ -31,28 +30,28 @@ static GList *dev_head;
static void *dlopen_handle;
const OEM_sys_devman_plugin_interface *plugin_intf;
-void add_device(enum device_type *devtype)
+void add_device(const enum device_type *devtype)
{
- dev_head = g_list_append(dev_head, devtype);
+ dev_head = g_list_append(dev_head, (enum device_type *)devtype);
}
-void remove_device(enum device_type *devtype)
+void remove_device(const enum device_type *devtype)
{
- dev_head = g_list_remove(dev_head, devtype);
+ dev_head = g_list_remove(dev_head, (enum device_type *)devtype);
}
static enum device_type *find_device(enum device_type devtype)
{
GList *elem;
- enum device_type *type = NULL;
+ enum device_type *type;
for (elem = dev_head; elem; elem = elem->next) {
type = elem->data;
if (*type == devtype)
- break;
+ return type;
}
- return type;
+ return NULL;
}
API int device_get_property(enum device_type devtype, int property, int *value)
diff --git a/src/device-plugin.c b/src/device-plugin.c
index 64b6f39..85022d0 100644
--- a/src/device-plugin.c
+++ b/src/device-plugin.c
@@ -353,7 +353,7 @@ static int OEM_sys_set_cpufreq_scaling_min_freq(int value)
return 0;
}
-static int OEM_sys_get_backlight_brightness_by_lux(int lux)
+static int OEM_sys_get_backlight_brightness_by_lux(int lux, int *value)
{
return 0;
}