Explicitly casting the enumeration value for comparing it with integer. 86/15486/1
authorSung-jae Park <nicesj.park@samsung.com>
Wed, 22 Jan 2014 02:09:40 +0000 (11:09 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 22 Jan 2014 02:09:40 +0000 (11:09 +0900)
Change-Id: I8b7a052c748b7f4dbd370198179ca9a4c31136f4

packaging/liblivebox-viewer.spec
src/client.c
src/livebox.c

index 1ea6f66..caeecbc 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox-viewer
 Summary: Library for developing the application
-Version: 0.20.6
+Version: 0.20.7
 Release: 1
 Group: HomeTF/Livebox
 License: Flora
index 25d0395..f3f3df2 100644 (file)
@@ -133,7 +133,7 @@ static struct packet *master_pinup(pid_t pid, int handle, const struct packet *p
                goto out;
        }
 
-       if (status == LB_STATUS_SUCCESS) {
+       if (status == (int)LB_STATUS_SUCCESS) {
                new_content = strdup(content);
                if (new_content) {
                        free(common->content);
@@ -160,7 +160,7 @@ static struct packet *master_pinup(pid_t pid, int handle, const struct packet *p
                        handler->cbs.pinup.data = NULL;
 
                        cb(handler, status, cbdata);
-               } else if (status == LB_STATUS_SUCCESS) {
+               } else if (status == (int)LB_STATUS_SUCCESS) {
                        lb_invoke_event_handler(handler, LB_EVENT_PINUP_CHANGED);
                }
        }
@@ -249,7 +249,7 @@ static struct packet *master_deleted(pid_t pid, int handle, const struct packet
                        handler->cbs.created.cb = NULL;
                        handler->cbs.created.data = NULL;
 
-                       if (reason == LB_STATUS_SUCCESS) {
+                       if (reason == (int)LB_STATUS_SUCCESS) {
                                reason = LB_STATUS_ERROR_CANCEL;
                        }
 
@@ -324,7 +324,7 @@ static struct packet *master_lb_update_begin(pid_t pid, int handle, const struct
 
                ret = lb_sync_lb_fb(common);
 
-               if (ret != LB_STATUS_SUCCESS) {
+               if (ret != (int)LB_STATUS_SUCCESS) {
                        ErrPrint("Failed to do sync FB (%s - %s) (%d)\n", pkgname, fbfile, ret);
                } else {
                        struct dlist *l;
@@ -370,7 +370,7 @@ static struct packet *master_pd_update_begin(pid_t pid, int handle, const struct
                (void)lb_set_pd_fb(common, fbfile);
 
                ret = lb_sync_pd_fb(common);
-               if (ret != LB_STATUS_SUCCESS) {
+               if (ret != (int)LB_STATUS_SUCCESS) {
                        ErrPrint("Failed to do sync FB (%s - %s) (%d)\n", pkgname, fbfile, ret);
                } else {
                        struct dlist *l;
@@ -675,7 +675,7 @@ static struct packet *master_lb_updated(pid_t pid, int handle, const struct pack
 
                        if (!conf_manual_sync()) {
                                ret = lb_sync_lb_fb(common);
-                               if (ret != LB_STATUS_SUCCESS) {
+                               if (ret != (int)LB_STATUS_SUCCESS) {
                                        ErrPrint("Failed to do sync FB (%s - %s) (%d)\n", pkgname, util_basename(util_uri_to_path(id)), ret);
                                }
                        } else {
@@ -686,7 +686,7 @@ static struct packet *master_lb_updated(pid_t pid, int handle, const struct pack
                ret = LB_STATUS_SUCCESS;
        }
 
-       if (ret == LB_STATUS_SUCCESS) {
+       if (ret == (int)LB_STATUS_SUCCESS) {
                struct dlist *l;
                struct dlist *n;
 
@@ -736,7 +736,7 @@ static struct packet *master_pd_created(pid_t pid, int handle, const struct pack
                goto out;
        }
 
-       common->is_pd_created = (status == LB_STATUS_SUCCESS);
+       common->is_pd_created = (status == (int)LB_STATUS_SUCCESS);
        common->request.pd_created = 0;
 
        if (common->is_pd_created) {
@@ -790,7 +790,7 @@ static struct packet *master_pd_created(pid_t pid, int handle, const struct pack
                         * Because, in the create callback, user can call create_pd function again.
                         */
                        cb(handler, status, cbdata);
-               } else if (status == LB_STATUS_SUCCESS) {
+               } else if (status == (int)LB_STATUS_SUCCESS) {
                        lb_invoke_event_handler(handler, LB_EVENT_PD_CREATED);
                } 
        }
@@ -852,7 +852,7 @@ static struct packet *master_pd_destroyed(pid_t pid, int handle, const struct pa
                         * Because, in the create callback, user can call destroy_pd function again.
                         */
                        cb(handler, status, cbdata);
-               } else if (status == LB_STATUS_SUCCESS) {
+               } else if (status == (int)LB_STATUS_SUCCESS) {
                        lb_invoke_event_handler(handler, LB_EVENT_PD_DESTROYED);
                }
        }
@@ -990,7 +990,7 @@ static struct packet *master_update_mode(pid_t pid, int handle, const struct pac
                goto out;
        }
 
-       if (status == LB_STATUS_SUCCESS) {
+       if (status == (int)LB_STATUS_SUCCESS) {
                lb_set_update_mode(common, active_mode);
        }
 
@@ -1007,7 +1007,7 @@ static struct packet *master_update_mode(pid_t pid, int handle, const struct pac
                        handler->cbs.update_mode.data = NULL;
 
                        cb(handler, status, cbdata);
-               } else if (status == LB_STATUS_SUCCESS) {
+               } else if (status == (int)LB_STATUS_SUCCESS) {
                        lb_invoke_event_handler(handler, LB_EVENT_UPDATE_MODE_CHANGED);
                }
        }
@@ -1060,7 +1060,7 @@ static struct packet *master_size_changed(pid_t pid, int handle, const struct pa
                 * So the PD has no private resized event handler.
                 * Notify it via global event handler only.
                 */
-               if (status == LB_STATUS_SUCCESS) {
+               if (status == (int)LB_STATUS_SUCCESS) {
                        struct dlist *l;
 
                        lb_set_pdsize(common, w, h);
@@ -1074,7 +1074,7 @@ static struct packet *master_size_changed(pid_t pid, int handle, const struct pa
                struct dlist *l;
                struct dlist *n;
 
-               if (status == LB_STATUS_SUCCESS) {
+               if (status == (int)LB_STATUS_SUCCESS) {
                        lb_set_size(common, w, h);
 
                        /*!
@@ -1111,7 +1111,7 @@ static struct packet *master_size_changed(pid_t pid, int handle, const struct pa
                                handler->cbs.size_changed.data = NULL;
 
                                cb(handler, status, cbdata);
-                       } else if (status == LB_STATUS_SUCCESS) {
+                       } else if (status == (int)LB_STATUS_SUCCESS) {
                                lb_invoke_event_handler(handler, LB_EVENT_LB_SIZE_CHANGED);
                        }
                }
@@ -1150,7 +1150,7 @@ static struct packet *master_period_changed(pid_t pid, int handle, const struct
                goto out;
        }
 
-       if (status == LB_STATUS_SUCCESS) {
+       if (status == (int)LB_STATUS_SUCCESS) {
                lb_set_period(common, period);
        }
 
@@ -1168,7 +1168,7 @@ static struct packet *master_period_changed(pid_t pid, int handle, const struct
                        handler->cbs.period_changed.data = NULL;
 
                        cb(handler, status, cbdata);
-               } else if (status == LB_STATUS_SUCCESS) {
+               } else if (status == (int)LB_STATUS_SUCCESS) {
                        lb_invoke_event_handler(handler, LB_EVENT_PERIOD_CHANGED);
                }
        }
@@ -1212,7 +1212,7 @@ static struct packet *master_group_changed(pid_t pid, int handle, const struct p
                goto out;
        }
 
-       if (status == LB_STATUS_SUCCESS) {
+       if (status == (int)LB_STATUS_SUCCESS) {
                (void)lb_set_group(common, cluster, category);
        }
 
@@ -1230,7 +1230,7 @@ static struct packet *master_group_changed(pid_t pid, int handle, const struct p
                        handler->cbs.group_changed.data = NULL;
 
                        cb(handler, status, cbdata);
-               } else if (status == LB_STATUS_SUCCESS) {
+               } else if (status == (int)LB_STATUS_SUCCESS) {
                        lb_invoke_event_handler(handler, LB_EVENT_GROUP_CHANGED);
                }
        }
@@ -1656,7 +1656,7 @@ static void master_started_cb(keynode_t *node, void *data)
        }
 
        DbgPrint("Master state: %d\n", state);
-       if (state == 1 && make_connection() == LB_STATUS_SUCCESS) {
+       if (state == 1 && make_connection() == (int)LB_STATUS_SUCCESS) {
                int ret;
                ret = vconf_ignore_key_changed(VCONFKEY_MASTER_STARTED, master_started_cb);
                DbgPrint("master_started vconf key de-registered [%d]\n", ret);
index 344ae1e..06d00e6 100644 (file)
@@ -320,7 +320,7 @@ errout:
        handler->cbs.update_mode.data = NULL;
        handler->common->request.update_mode = 0;
 
-       if (ret == LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
+       if (ret == (int)LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
                lb_invoke_event_handler(handler, LB_EVENT_DELETED);
                lb_unref(handler, 1);
        }
@@ -361,7 +361,7 @@ errout:
        handler->cbs.size_changed.data = NULL;
        handler->common->request.size_changed = 0;
 
-       if (ret == LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
+       if (ret == (int)LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
                lb_invoke_event_handler(handler, LB_EVENT_DELETED);
                lb_unref(handler, 1);
        }
@@ -416,7 +416,7 @@ errout:
        handler->cbs.group_changed.data = NULL;
        handler->common->request.group_changed = 0;
 
-       if (ret == LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
+       if (ret == (int)LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
                lb_invoke_event_handler(handler, LB_EVENT_DELETED);
                lb_unref(handler, 1);
        }
@@ -447,7 +447,7 @@ errout:
        handler->cbs.period_changed.data = NULL;
        handler->common->request.period_changed = 0;
 
-       if (ret == LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
+       if (ret == (int)LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
                lb_invoke_event_handler(handler, LB_EVENT_DELETED);
                lb_unref(handler, 1);
        }
@@ -554,7 +554,7 @@ errout:
        handler->cbs.pd_created.data = NULL;
        handler->common->request.pd_created = 0;
 
-       if (ret == LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
+       if (ret == (int)LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
                lb_invoke_event_handler(handler, LB_EVENT_DELETED);
                lb_unref(handler, 1);
        }
@@ -602,7 +602,7 @@ static void pd_destroy_cb(struct livebox *handler, const struct packet *result,
                ret = LB_STATUS_ERROR_INVALID;
        }
 
-       if (ret == LB_STATUS_SUCCESS) {
+       if (ret == (int)LB_STATUS_SUCCESS) {
                handler->cbs.pd_destroyed.cb = cb;
                handler->cbs.pd_destroyed.data = cbdata;
        } else {
@@ -709,11 +709,11 @@ static void lb_pixmap_acquired_cb(struct livebox *handler, const struct packet *
                pixmap = 0;
        }
 
-       if (ret == LB_STATUS_ERROR_BUSY) {
+       if (ret == (int)LB_STATUS_ERROR_BUSY) {
                ret = lb_acquire_lb_pixmap(handler, cb, cbdata);
                DbgPrint("Busy, Try again: %d\n", ret);
                /* Try again */
-       } else if (ret == LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
+       } else if (ret == (int)LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
                if (cb) {
                        cb(handler, pixmap, cbdata);
                }
@@ -783,11 +783,11 @@ static void pd_pixmap_acquired_cb(struct livebox *handler, const struct packet *
                ret = LB_STATUS_ERROR_INVALID;
        }
 
-       if (ret == LB_STATUS_ERROR_BUSY) {
+       if (ret == (int)LB_STATUS_ERROR_BUSY) {
                ret = lb_acquire_pd_pixmap(handler, cb, cbdata);
                DbgPrint("Busy, Try again: %d\n", ret);
                /* Try again */
-       } else if (ret == LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
+       } else if (ret == (int)LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
                if (cb) {
                        cb(handler, pixmap, cbdata);
                }
@@ -824,7 +824,7 @@ errout:
        handler->cbs.pinup.data = NULL;
        handler->common->request.pinup = 0;
 
-       if (ret == LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
+       if (ret == (int)LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
                lb_invoke_event_handler(handler, LB_EVENT_DELETED);
                lb_unref(handler, 1);
        }
@@ -855,7 +855,7 @@ errout:
        handler->cbs.key_event.data = NULL;
        handler->common->request.key_event = 0;
 
-       if (ret == LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
+       if (ret == (int)LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
                lb_invoke_event_handler(handler, LB_EVENT_DELETED);
                lb_unref(handler, 1);
        }
@@ -887,7 +887,7 @@ errout:
        handler->cbs.access_event.data = NULL;
        handler->common->request.access_event = 0;
 
-       if (ret == LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
+       if (ret == (int)LB_STATUS_ERROR_NOT_EXIST && handler->refcnt == 2) {
                lb_invoke_event_handler(handler, LB_EVENT_DELETED);
                lb_unref(handler, 1);
        }
@@ -1374,19 +1374,19 @@ static int lb_set_visibility(struct livebox *handler, enum livebox_visible_state
        int need_to_add_job = 0;
        int ret;
 
-       if (handler->common->visible != LB_SHOW && state == LB_SHOW) {
+       if (handler->common->visible != LB_SHOW && state == (int)LB_SHOW) {
                need_to_add_job = !!handler->paused_updating;
-       } else if (handler->common->visible == LB_SHOW && state != LB_SHOW) {
+       } else if (handler->common->visible == (int)LB_SHOW && state != LB_SHOW) {
                struct dlist *l;
                struct livebox *item;
 
                dlist_foreach(handler->common->livebox_list, l, item) {
-                       if (item->visible == LB_SHOW) {
+                       if (item->visible == (int)LB_SHOW) {
                                DbgPrint("%s visibility is not changed\n", handler->common->pkgname);
                                return LB_STATUS_SUCCESS;
                        }
                }
-       } else if (handler->common->visible == LB_SHOW && state == LB_SHOW && handler->paused_updating) {
+       } else if (handler->common->visible == (int)LB_SHOW && state == (int)LB_SHOW && handler->paused_updating) {
                if (job_add(handler, refresh_for_paused_updating_cb, LB_STATUS_SUCCESS, NULL) < 0) {
                        ErrPrint("Unable to add a new job for refreshing box\n");
                }
@@ -1407,7 +1407,7 @@ static int lb_set_visibility(struct livebox *handler, enum livebox_visible_state
        }
 
        ret = master_rpc_request_only(handler, packet);
-       if (ret == LB_STATUS_SUCCESS) {
+       if (ret == (int)LB_STATUS_SUCCESS) {
                DbgPrint("[%s] visibility is changed 0x[%x]\n", handler->common->pkgname, state);
                handler->common->visible = state;
 
@@ -1604,7 +1604,7 @@ EAPI int livebox_set_period(struct livebox *handler, double period, ret_cb_t cb,
        }
 
        ret = master_rpc_async_request(handler, packet, 0, period_ret_cb, NULL);
-       if (ret == LB_STATUS_SUCCESS) {
+       if (ret == (int)LB_STATUS_SUCCESS) {
                handler->cbs.period_changed.cb = cb;
                handler->cbs.period_changed.data = data;
                handler->common->request.period_changed = 1;
@@ -1620,7 +1620,7 @@ static void lb_update_visibility(struct livebox_common *old_common)
 
        item = NULL;
        dlist_foreach(old_common->livebox_list, l, item) {
-               if (item->visible == LB_SHOW) {
+               if (item->visible == (int)LB_SHOW) {
                        break;
                }
 
@@ -1651,7 +1651,7 @@ static void job_del_cb(struct livebox *handle, int type, void *data)
        struct cb_info *cbinfo = data;
        ret_cb_t cb;
 
-       if (handle->visible == LB_SHOW) {
+       if (handle->visible == (int)LB_SHOW) {
                lb_update_visibility(handle->common);
        }
 
@@ -1873,7 +1873,7 @@ EAPI int livebox_set_update_mode(struct livebox *handler, int active_update, ret
        }
 
        ret = master_rpc_async_request(handler, packet, 0, update_mode_cb, NULL);
-       if (ret == LB_STATUS_SUCCESS) {
+       if (ret == (int)LB_STATUS_SUCCESS) {
                handler->cbs.update_mode.cb = cb;
                handler->cbs.update_mode.data = data;
                handler->common->request.update_mode = 1;
@@ -1987,7 +1987,7 @@ EAPI int livebox_resize(struct livebox *handler, int type, ret_cb_t cb, void *da
                }
 
                ret = master_rpc_async_request(handler, packet, 0, resize_cb, NULL);
-               if (ret == LB_STATUS_SUCCESS) {
+               if (ret == (int)LB_STATUS_SUCCESS) {
                        handler->cbs.size_changed.cb = cb;
                        handler->cbs.size_changed.data = data;
                        handler->common->request.size_changed = 1;
@@ -2054,7 +2054,7 @@ EAPI int livebox_resize(struct livebox *handler, int type, ret_cb_t cb, void *da
                                /*!
                                 * In this case, we should update visibility of old_common's liveboxes
                                 */
-                               if (handler->visible == LB_SHOW) {
+                               if (handler->visible == (int)LB_SHOW) {
                                        lb_update_visibility(old_common);
                                }
                        }
@@ -2067,7 +2067,7 @@ EAPI int livebox_resize(struct livebox *handler, int type, ret_cb_t cb, void *da
                                ret = LB_STATUS_ERROR_MEMORY;
                        } else {
                                ret = job_add(handler, resize_job_cb, LB_STATUS_SUCCESS, cbinfo);
-                               if (ret == LB_STATUS_SUCCESS) {
+                               if (ret == (int)LB_STATUS_SUCCESS) {
                                        struct livebox_common *old_common;
 
                                        old_common = handler->common;
@@ -2079,7 +2079,7 @@ EAPI int livebox_resize(struct livebox *handler, int type, ret_cb_t cb, void *da
                                        lb_common_ref(common, handler);
                                        handler->common = common;
 
-                                       if (handler->visible == LB_SHOW) {
+                                       if (handler->visible == (int)LB_SHOW) {
                                                lb_update_visibility(old_common); /* To update visibility: Show --> Paused */
                                                lb_update_visibility(common);   /* To update visibility: Paused --> Show */
                                        }
@@ -2287,7 +2287,7 @@ EAPI int livebox_create_pd_with_position(struct livebox *handler, double x, doub
 
        DbgPrint("PERF_DBOX\n");
        ret = master_rpc_async_request(handler, packet, 0, pd_create_cb, NULL);
-       if (ret == LB_STATUS_SUCCESS) {
+       if (ret == (int)LB_STATUS_SUCCESS) {
                handler->cbs.pd_created.cb = cb;
                handler->cbs.pd_created.data = data;
                handler->common->request.pd_created = 1;
@@ -2541,7 +2541,7 @@ EAPI int livebox_access_event(struct livebox *handler, enum access_event_type ty
        }
 
        ret = send_access_event(handler, cmd, x * w, y * h);
-       if (ret == LB_STATUS_SUCCESS) {
+       if (ret == (int)LB_STATUS_SUCCESS) {
                handler->cbs.access_event.cb = cb;
                handler->cbs.access_event.data = data;
                handler->common->request.access_event = 1;
@@ -2793,7 +2793,7 @@ EAPI int livebox_key_event(struct livebox *handler, enum content_event_type type
        }
 
        ret = send_key_event(handler, cmd, keycode);
-       if (ret == LB_STATUS_SUCCESS) {
+       if (ret == (int)LB_STATUS_SUCCESS) {
                handler->cbs.key_event.cb = cb;
                handler->cbs.key_event.data = data;
                handler->common->request.key_event = 1;
@@ -2954,7 +2954,7 @@ EAPI int livebox_set_group(struct livebox *handler, const char *cluster, const c
        }
 
        ret = master_rpc_async_request(handler, packet, 0, set_group_ret_cb, NULL);
-       if (ret == LB_STATUS_SUCCESS) {
+       if (ret == (int)LB_STATUS_SUCCESS) {
                handler->cbs.group_changed.cb = cb;
                handler->cbs.group_changed.data = data; 
                handler->common->request.group_changed = 1;
@@ -3600,7 +3600,7 @@ EAPI int livebox_set_pinup(struct livebox *handler, int flag, ret_cb_t cb, void
        }
 
        ret = master_rpc_async_request(handler, packet, 0, pinup_done_cb, NULL);
-       if (ret == LB_STATUS_SUCCESS) {
+       if (ret == (int)LB_STATUS_SUCCESS) {
                handler->cbs.pinup.cb = cb;
                handler->cbs.pinup.data = data;
                handler->common->request.pinup = 1;
@@ -3880,7 +3880,7 @@ EAPI int livebox_set_visibility(struct livebox *handler, enum livebox_visible_st
 
        if (!handler->common->is_user) {
                /* System cluster livebox cannot be changed its visible states */
-               if (state == LB_HIDE_WITH_PAUSE) {
+               if (state == (int)LB_HIDE_WITH_PAUSE) {
                        ErrPrint("CA Livebox is not able to change the visibility\n");
                        return LB_STATUS_ERROR_PERMISSION;
                }
@@ -4011,7 +4011,7 @@ void lb_invoke_event_handler(struct livebox *handler, enum livebox_event_type ev
        struct dlist *n;
        struct event_info *info;
 
-       if (event == LB_EVENT_LB_UPDATED && handler->common->refcnt > 1) {
+       if (event == (int)LB_EVENT_LB_UPDATED && handler->common->refcnt > 1) {
                if (handler->visible != LB_SHOW) {
                        DbgPrint("Update requested(pending) - %s\n", handler->common->pkgname);
                        handler->paused_updating++;