fix some syntax errors 58/76058/1 accepted/tizen/common/20160627.191317 submit/tizen/20160623.021949
authorJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 22 Jun 2016 12:44:19 +0000 (21:44 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Wed, 22 Jun 2016 12:44:23 +0000 (21:44 +0900)
initialize variables before using
erase unreacherble codes

Change-Id: I5ea6f89be8aeea2025950f0713fcc60dd43b1f7f
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
include/tdm_list.h
src/tdm.c
src/tdm_display.c
src/tdm_helper.c
src/tdm_pp.c
src/tdm_thread.c

index 6255cd0..2fd1db0 100644 (file)
@@ -150,7 +150,7 @@ static inline int list_length(struct list_head *item)
 
 #define LIST_FIND_ITEM(item, head, type, member, found) \
        do {    \
-               type *pos;      \
+               type *pos = NULL;       \
                found = NULL;   \
                LIST_FOR_EACH_ENTRY(pos, head, member)  \
                        if (pos == item) { found = item; break; }       \
index 996fb9a..be9d26b 100644 (file)
--- a/src/tdm.c
+++ b/src/tdm.c
@@ -610,7 +610,7 @@ _tdm_display_update_internal(tdm_private_display *private_display,
 {
        tdm_output **outputs = NULL;
        int output_count = 0, i;
-       tdm_error ret;
+       tdm_error ret = TDM_ERROR_NONE;
 
        LIST_INITHEAD(&private_display->output_list);
        LIST_INITHEAD(&private_display->pp_list);
index 11e09bc..e691501 100644 (file)
@@ -1150,9 +1150,7 @@ tdm_output_set_dpms(tdm_output *output, tdm_output_dpms dpms_value)
        tdm_func_output *func_output;
        OUTPUT_FUNC_ENTRY();
 
-       if (dpms_value < TDM_OUTPUT_DPMS_ON)
-               dpms_value = TDM_OUTPUT_DPMS_ON;
-       else if (dpms_value > TDM_OUTPUT_DPMS_OFF)
+       if (dpms_value > TDM_OUTPUT_DPMS_OFF)
                dpms_value = TDM_OUTPUT_DPMS_OFF;
 
        _pthread_mutex_lock(&private_display->lock);
@@ -1238,7 +1236,7 @@ tdm_output_call_change_handler_internal(tdm_private_output *private_output,
                                                                                tdm_value value)
 {
        tdm_private_display *private_display;
-       tdm_private_change_handler *change_handler;
+       tdm_private_change_handler *change_handler = NULL;
 
        TDM_RETURN_IF_FAIL(TDM_MUTEX_IS_LOCKED());
        TDM_RETURN_IF_FAIL(private_output);
index 1363979..4172fe8 100644 (file)
@@ -408,8 +408,6 @@ _tdm_helper_buffer_convert(tbm_surface_h srcbuf, tbm_surface_h dstbuf,
 cant_convert:
        if (src_img)
                pixman_image_unref(src_img);
-       if (dst_img)
-               pixman_image_unref(dst_img);
 
        tbm_surface_unmap(srcbuf);
        tbm_surface_unmap(dstbuf);
index a440c41..9075c8b 100644 (file)
@@ -112,7 +112,7 @@ tdm_pp_cb_done(tdm_pp *pp_backend, tbm_surface_h src, tbm_surface_h dst,
 {
        tdm_private_pp *private_pp = user_data;
        tdm_private_display *private_display = private_pp->private_display;
-       tdm_pp_private_buffer *pp_buffer, *first_entry;
+       tdm_pp_private_buffer *pp_buffer = NULL, *first_entry = NULL;
 
        TDM_RETURN_IF_FAIL(TDM_MUTEX_IS_LOCKED());
 
index aff3f39..0d24561 100644 (file)
@@ -240,7 +240,7 @@ tdm_thread_handle_cb(tdm_private_loop *private_loop)
        tdm_private_thread *private_thread;
        tdm_thread_cb_base *base;
        char buffer[1024];
-       int len, i;
+       unsigned int len, i;
 
        /* DON'T check TDM_MUTEX_IS_LOCKED here */