okra pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=ef8d86d7f368859c0a7e3c2e0177777b31ba27f8

commit ef8d86d7f368859c0a7e3c2e0177777b31ba27f8
Author: Stephen okra Houston <[email protected]>
Date:   Wed Nov 2 09:34:10 2016 -0500

    Luncher/Pager Gadget: Fix coverity issues.
---
 src/modules/luncher/bar.c        | 19 ++++++++++---------
 src/modules/luncher/config.c     |  4 ++--
 src/modules/pager/gadget/pager.c | 12 ++++++------
 3 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/src/modules/luncher/bar.c b/src/modules/luncher/bar.c
index fc8d498..45cc717 100644
--- a/src/modules/luncher/bar.c
+++ b/src/modules/luncher/bar.c
@@ -271,6 +271,7 @@ static Evas_Object *
 _bar_icon_menu_item_new(Icon *ic, Evas_Object *popup, Evas_Object *parent, 
const char *name, const char *icon)
 {
    const char *path = NULL, *k = NULL;
+   char buf[4096];
    int len = 0;
    Evas_Object *layout, *label, *img;
 
@@ -312,7 +313,6 @@ _bar_icon_menu_item_new(Icon *ic, Evas_Object *popup, 
Evas_Object *parent, const
      }
    if (!path)
      {
-        char buf[4096];
         snprintf(buf, sizeof(buf), "e/icons/%s", icon);
         if (eina_list_count(e_theme_collection_items_find("base/theme/icons", 
buf)))
           {
@@ -743,7 +743,9 @@ _bar_icon_preview_show(void *data)
    ic->mouse_in_timer = NULL;
    if (ic->drag.dnd)
      return EINA_FALSE;
-   if (!ic->inst && !ic->inst->o_icon_con)
+   if (!ic->inst)
+     return EINA_FALSE;
+   if (!ic->inst->o_icon_con)
      return EINA_FALSE;
 
    orient = e_gadget_site_orient_get(e_gadget_site_get(ic->inst->o_main));
@@ -893,6 +895,7 @@ static Icon *
 _bar_icon_add(Instance *inst, Efreet_Desktop *desktop, E_Client 
*non_desktop_client)
 {
    const char *path = NULL, *k = NULL;
+   char buf[4096];
    int len = 0;
    Icon *ic;
    const Eina_List *l;
@@ -943,7 +946,6 @@ _bar_icon_add(Instance *inst, Efreet_Desktop *desktop, 
E_Client *non_desktop_cli
           }
         if (!path)
           {
-             char buf[4096];
              snprintf(buf, sizeof(buf), "e/icons/%s", desktop->icon);
              if 
(eina_list_count(e_theme_collection_items_find("base/theme/icons", buf)))
                {
@@ -1079,10 +1081,10 @@ _bar_cb_client_remove(void *data EINA_UNUSED, int type 
EINA_UNUSED, E_Event_Clie
           {
              if (ic->starting) elm_layout_signal_emit(ic->o_layout, 
"e,state,started", "e");
              ic->starting = EINA_FALSE;
-             if (ev->ec->exe_inst)
-               ic->execs = eina_list_remove(ic->execs, ev->ec->exe_inst);
              if (ev->ec)
                ic->clients = eina_list_remove(ic->clients, ev->ec);
+             if (ev->ec->exe_inst)
+               ic->execs = eina_list_remove(ic->execs, ev->ec->exe_inst);
              if (!eina_list_count(ic->execs) && !eina_list_count(ic->clients))
                {
                   elm_layout_signal_emit(ic->o_layout, "e,state,off", "e");
@@ -1176,8 +1178,7 @@ _bar_cb_exec_client_prop(void *data EINA_UNUSED, int type 
EINA_UNUSED, E_Event_C
         Icon *ic = NULL;
         char buf[4096];
 
-        if (ev->ec)
-          ic = _bar_icon_match(inst, ev->ec);
+        ic = _bar_icon_match(inst, ev->ec);
 
         if (skip && !ic) continue;
         if (!skip)
@@ -1362,7 +1363,6 @@ _bar_fill(Instance *inst)
                   if (!ec->netwm.state.skip_taskbar)
                     {
                        skip = EINA_FALSE;
-                       break;
                     }
                   if (skip) continue;
                   ic = _bar_icon_match(inst, ec);
@@ -1406,11 +1406,12 @@ _bar_resize_job(void *data)
    Instance *inst = data;
    Eina_List *l;
    Icon *ic;
-   E_Gadget_Site_Orient orient = 
e_gadget_site_orient_get(e_gadget_site_get(inst->o_main));
+   E_Gadget_Site_Orient orient;
    Evas_Coord x, y, w, h, size;
 
    if (inst)
      {
+         orient = e_gadget_site_orient_get(e_gadget_site_get(inst->o_main));
         elm_layout_sizing_eval(inst->o_main);
         evas_object_geometry_get(inst->o_main, &x, &y, &w, &h);
         switch (orient)
diff --git a/src/modules/luncher/config.c b/src/modules/luncher/config.c
index 07c0cc5..00c9916 100644
--- a/src/modules/luncher/config.c
+++ b/src/modules/luncher/config.c
@@ -19,7 +19,7 @@ _config_source_changed(void *data, Evas_Object *obj 
EINA_UNUSED, void *event_inf
      return;
    if (inst->cfg->dir) eina_stringshare_del(inst->cfg->dir);
    inst->cfg->dir = NULL;
-   if (dir) inst->cfg->dir = eina_stringshare_ref(dir); 
+   inst->cfg->dir = eina_stringshare_ref(dir); 
    bar_reorder(inst);
 }
 
@@ -176,6 +176,7 @@ static void
 _icon_theme_file_set(Evas_Object *img, const char *icon)
 {
    const char *path = NULL, *k = NULL;
+   char buf[4096];
    int len = 0;
 
    if (!icon)
@@ -195,7 +196,6 @@ _icon_theme_file_set(Evas_Object *img, const char *icon)
      }
    if (!path)
      {
-        char buf[4096];
         snprintf(buf, sizeof(buf), "e/icons/%s", icon);
         if (eina_list_count(e_theme_collection_items_find("base/theme/icons", 
buf)))
           {
diff --git a/src/modules/pager/gadget/pager.c b/src/modules/pager/gadget/pager.c
index 7c8abc4..85aa659 100644
--- a/src/modules/pager/gadget/pager.c
+++ b/src/modules/pager/gadget/pager.c
@@ -178,9 +178,9 @@ _pager_gadget_anchor_change_cb(void *data, Evas_Object 
*obj, void *event_info EI
 {
    Instance *inst = data;
 
-   _pager_orient(inst, e_gadget_site_orient_get(obj));
    if (inst->pager && inst->o_pager)
      {
+        _pager_orient(inst, e_gadget_site_orient_get(obj));
         _pager_empty(inst->pager);
         _pager_fill(inst->pager);
      }
@@ -194,10 +194,10 @@ _pager_gadget_created_cb(void *data, Evas_Object *obj, 
void *event_info EINA_UNU
    Eina_List *l;
    Pager_Desk *pd;
 
-   e_gadget_configure_cb_set(inst->o_pager, _pager_gadget_configure);
-   _pager_orient(inst, e_gadget_site_orient_get(obj));
    if (inst->pager && inst->o_pager)
      {
+        e_gadget_configure_cb_set(inst->o_pager, _pager_gadget_configure);
+        _pager_orient(inst, e_gadget_site_orient_get(obj));
         _pager_empty(inst->pager);
         _pager_fill(inst->pager);
         
@@ -1280,7 +1280,7 @@ _pager_drop_cb_drop(void *data, const char *type, void 
*event_info)
 {
    E_Event_Dnd_Drop *ev;
    Eina_List *l;
-   Pager_Desk *pd;
+   Pager_Desk *pd, *pdd;
    Pager_Desk *pd2 = NULL;
    E_Client *ec = NULL;
    int dx = 0, dy = 0;
@@ -1356,9 +1356,9 @@ _pager_drop_cb_drop(void *data, const char *type, void 
*event_info)
              if (fullscreen) e_client_fullscreen(ec, fs);
           }
      }
-   EINA_LIST_FOREACH(pd->pager->desks, l, pd)
+   EINA_LIST_FOREACH(pd->pager->desks, l, pdd)
      {
-        edje_object_signal_emit(pd->o_desk, "e,action,drag,out", "e");
+        edje_object_signal_emit(pdd->o_desk, "e,action,drag,out", "e");
      }
 }
 

-- 


Reply via email to