Hi,
same patch as before: removed useless nullchecks and
switched some free()'s to E_FREE().
Index: src/modules/conf_randr/e_smart_monitor.c
===================================================================
--- src/modules/conf_randr/e_smart_monitor.c (révision 81560)
+++ src/modules/conf_randr/e_smart_monitor.c (copie de travail)
@@ -498,7 +498,7 @@
noutputs, mx, my,
sd->current.mode->xid,
sd->current.orientation);
- if (outputs) free(outputs);
+ free(outputs);
}
}
else
Index: src/modules/everything/evry_plug_apps.c
===================================================================
--- src/modules/everything/evry_plug_apps.c (révision 81560)
+++ src/modules/everything/evry_plug_apps.c (copie de travail)
@@ -1262,9 +1262,7 @@
_dir_monitor_free();
- if (current_path)
- free(current_path);
- current_path = NULL;
+ E_FREE(current_path);
}
/***************************************************************************/
Index: src/modules/dropshadow/e_mod_main.c
===================================================================
--- src/modules/dropshadow/e_mod_main.c (révision 81560)
+++ src/modules/dropshadow/e_mod_main.c (copie de travail)
@@ -212,8 +212,8 @@
_ds_shadow_del(sh);
}
if (ds->idler_before) e_main_idler_before_del(ds->idler_before);
- if (ds->table.gauss) free(ds->table.gauss);
- if (ds->table.gauss2) free(ds->table.gauss2);
+ free(ds->table.gauss);
+ free(ds->table.gauss2);
_ds_shared_free(ds);
free(ds);
}
@@ -1083,7 +1083,7 @@
{
int i;
- if (ds->table.gauss) free(ds->table.gauss);
+ free(ds->table.gauss);
ds->table.gauss_size = (ds->conf->blur_size * 2) - 1;
ds->table.gauss = calloc(1, ds->table.gauss_size * sizeof(unsigned char));
@@ -1098,7 +1098,7 @@
_ds_gauss_int(-1.5 + (v * 3.0)) * 255.0;
}
- if (ds->table.gauss2) free(ds->table.gauss2);
+ free(ds->table.gauss2);
ds->table.gauss2_size = (ds->conf->blur_size * 2) - 1;
ds->table.gauss2 = calloc(1, ds->table.gauss2_size * sizeof(unsigned char));
@@ -1484,7 +1484,7 @@
_ds_shpix_free(Shpix *sp)
{
if (!sp) return;
- if (sp->pix) free(sp->pix);
+ free(sp->pix);
free(sp);
}
@@ -1968,8 +1968,7 @@
static void
_tilebuf_setup(Tilebuf *tb)
{
- if (tb->tiles.tiles) free(tb->tiles.tiles);
- tb->tiles.tiles = NULL;
+ E_FREE(tb->tiles.tiles);
tb->tiles.w = (tb->outbuf_w + (tb->tile_size.w - 1)) / tb->tile_size.w;
tb->tiles.h = (tb->outbuf_h + (tb->tile_size.h - 1)) / tb->tile_size.h;
@@ -2004,7 +2003,7 @@
static void
_tilebuf_free(Tilebuf *tb)
{
- if (tb->tiles.tiles) free(tb->tiles.tiles);
+ free(tb->tiles.tiles);
free(tb);
}
Index: src/modules/conf_display/e_int_config_desk.c
===================================================================
--- src/modules/conf_display/e_int_config_desk.c (révision 81560)
+++ src/modules/conf_display/e_int_config_desk.c (copie de travail)
@@ -126,11 +126,9 @@
if (cfdata->hdl)
ecore_event_handler_del(cfdata->hdl);
eina_stringshare_del(cfdata->bg);
- if (cfdata->name)
- E_FREE(cfdata->name);
+ E_FREE(cfdata->name);
#if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8)
- if (cfdata->profile)
- E_FREE(cfdata->profile);
+ E_FREE(cfdata->profile);
#endif
E_FREE(cfdata);
}
Index: src/modules/conf_wallpaper2/e_int_config_wallpaper.c
===================================================================
--- src/modules/conf_wallpaper2/e_int_config_wallpaper.c (révision 81560)
+++ src/modules/conf_wallpaper2/e_int_config_wallpaper.c (copie de travail)
@@ -691,7 +691,7 @@
if (it2->selected) it2->selected = 0;
}
it->selected = EINA_TRUE;
- if (sd->info->bg_file) free(sd->info->bg_file);
+ free(sd->info->bg_file);
evas_object_hide(sd->info->mini);
if (it->file)
{
@@ -710,7 +710,7 @@
if (p) *p = 0;
}
edje_object_part_text_set(sd->info->bg, "e.text.filename", name);
- if (name) free(name);
+ free(name);
}
else
{
@@ -947,7 +947,7 @@
if (p) *p = 0;
}
edje_object_part_text_set(sd->info->bg, "e.text.filename", name);
- if (name) free(name);
+ free(name);
}
}
}
@@ -1074,8 +1074,7 @@
}
if (!eina_iterator_next(info->dir, (void**) &st))
{
- free(info->curdir);
- info->curdir = NULL;
+ E_FREE(info->curdir);
eina_iterator_free(info->dir);
info->dir = NULL;
info->idler = NULL;
@@ -1108,7 +1107,7 @@
edje_object_part_text_set(info->bg, "e.text.busy_label",
_("Loading files..."));
}
- if (info->curdir) free(info->curdir);
+ free(info->curdir);
info->curdir = info->dirs->data;
info->dirs = eina_list_remove_list(info->dirs, info->dirs);
if (!info->dir) info->dir = eina_file_stat_ls(info->curdir);
@@ -1162,8 +1161,7 @@
win = e_win_new(con);
if (!win)
{
- free(info);
- info = NULL;
+ E_FREE(info);
return NULL;
}
info->win = win;
@@ -1328,8 +1326,7 @@
free(s);
if (info->idler) ecore_idler_del(info->idler);
// del other stuff
- free(info);
- info = NULL;
+ E_FREE(info);
}
E_Config_Dialog *
Index: src/modules/conf_paths/e_int_config_env.c
===================================================================
--- src/modules/conf_paths/e_int_config_env.c (révision 81560)
+++ src/modules/conf_paths/e_int_config_env.c (copie de travail)
@@ -77,8 +77,8 @@
if (evr->val) eina_stringshare_del(evr->val);
E_FREE(evr);
}
- if (cfdata->var_str) free(cfdata->var_str);
- if (cfdata->val_str) free(cfdata->val_str);
+ free(cfdata->var_str);
+ free(cfdata->val_str);
E_FREE(cfdata);
}
Index: src/modules/conf_edgebindings/e_int_config_edgebindings.c
===================================================================
--- src/modules/conf_edgebindings/e_int_config_edgebindings.c (révision 81560)
+++ src/modules/conf_edgebindings/e_int_config_edgebindings.c (copie de travail)
@@ -178,7 +178,7 @@
eina_stringshare_del(cfdata->locals.binding);
eina_stringshare_del(cfdata->locals.action);
- if (cfdata->locals.params) free(cfdata->locals.params);
+ free(cfdata->locals.params);
E_FREE(cfdata);
}
@@ -644,7 +644,7 @@
else
{
e_widget_ilist_unselect(cfdata->gui.o_action_list);
- if (cfdata->locals.action) free(cfdata->locals.action);
+ free(cfdata->locals.action);
cfdata->locals.action = strdup("");
e_widget_entry_clear(cfdata->gui.o_params);
}
@@ -924,7 +924,7 @@
{
label = _edge_binding_text_get(cfdata->locals.edge, ((float)cfdata->locals.delay), cfdata->locals.modifiers);
edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label);
- if (label) E_FREE(label);
+ E_FREE(label);
}
evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
@@ -971,7 +971,7 @@
((float)cfdata->locals.delay),
cfdata->locals.modifiers);
edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label);
- if (label) E_FREE(label);
+ E_FREE(label);
}
static void
@@ -994,7 +994,7 @@
}
edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label);
- if (label) E_FREE(label);
+ E_FREE(label);
}
static void
@@ -1078,7 +1078,7 @@
cfdata->locals.click ? (-1.0 * cfdata->locals.button) : ((float)cfdata->locals.delay),
cfdata->locals.modifiers);
edje_object_part_text_set(cfdata->gui.o_selector, "e.text.selection", label);
- if (label) E_FREE(label);
+ E_FREE(label);
}
static void
Index: src/modules/cpufreq/e_mod_main.c
===================================================================
--- src/modules/cpufreq/e_mod_main.c (révision 81560)
+++ src/modules/cpufreq/e_mod_main.c (copie de travail)
@@ -550,7 +550,7 @@
free(l->data);
eina_list_free(s->governors);
}
- if (s->cur_governor) free(s->cur_governor);
+ free(s->cur_governor);
if (s->orig_governor) eina_stringshare_del(s->orig_governor);
free(s);
}
@@ -834,7 +834,7 @@
{
ret = 1;
- if (s->cur_governor) free(s->cur_governor);
+ free(s->cur_governor);
s->cur_governor = strdup(buf);
for (i = strlen(s->cur_governor) - 1; i >= 0; i--)
Index: src/modules/battery/e_mod_openbsd.c
===================================================================
--- src/modules/battery/e_mod_openbsd.c (révision 81560)
+++ src/modules/battery/e_mod_openbsd.c (copie de travail)
@@ -78,8 +78,7 @@
void
_battery_openbsd_stop(void)
{
- if (ac)
- free(ac);
+ free(ac);
if (bat)
{
eina_stringshare_del(bat->udi);
Index: src/modules/illume-keyboard/e_kbd_dict.c
===================================================================
--- src/modules/illume-keyboard/e_kbd_dict.c (révision 81560)
+++ src/modules/illume-keyboard/e_kbd_dict.c (copie de travail)
@@ -415,7 +415,7 @@
else
fprintf(f, "%s %i\n", wd, usage);
}
- if (wd) free(wd);
+ free(wd);
p = pn;
if (p >= (kd->file.dict + kd->file.size)) break;
}
@@ -585,7 +585,7 @@
// FIXME: we need to find an EXACT line match - case and all
wd = _e_kbd_dict_line_parse(kd, line, &usage);
- if (wd) free(wd);
+ free(wd);
}
usage += adjust;
_e_kbd_dict_changed_write_add(kd, word, usage);
Index: src/modules/illume-keyboard/e_kbd_int.c
===================================================================
--- src/modules/illume-keyboard/e_kbd_int.c (révision 81560)
+++ src/modules/illume-keyboard/e_kbd_int.c (copie de travail)
@@ -124,9 +124,9 @@
s3 = strdup(_e_kbd_int_str_unquote(out_capslock));
e_kbd_buf_layout_key_add(ki->kbuf, s1, s2, s3,
ky->x, ky->y, ky->w, ky->h);
- if (s1) free(s1);
- if (s2) free(s2);
- if (s3) free(s3);
+ free(s1);
+ free(s2);
+ free(s3);
}
}
}
@@ -913,7 +913,7 @@
{
E_Kbd_Int_Key *ky;
- if (ki->layout.directory) free(ki->layout.directory);
+ free(ki->layout.directory);
if (ki->layout.file) eina_stringshare_del(ki->layout.file);
ki->layout.directory = NULL;
ki->layout.file = NULL;
@@ -999,8 +999,7 @@
if (!ky) continue;
if (sscanf(buf, "%*s %i %i %i %i\n", &(ky->x), &(ky->orig_y), &(ky->w), &(ky->orig_h)) != 4)
{
- free(ky);
- ky = NULL;
+ E_FREE(ky);
continue;
}
ki->layout.keys = eina_list_append(ki->layout.keys, ky);
Index: src/modules/conf_menus/e_int_config_menus.c
===================================================================
--- src/modules/conf_menus/e_int_config_menus.c (révision 81560)
+++ src/modules/conf_menus/e_int_config_menus.c (copie de travail)
@@ -233,8 +233,8 @@
}
}
e_widget_ilist_append(ob, NULL, label, NULL, NULL, file);
- if (tlabel) free(tlabel);
- if (tdesc) free(tdesc);
+ free(tlabel);
+ free(tdesc);
free(file);
i++;
}
Index: src/modules/comp/e_mod_comp_wl_shell.c
===================================================================
--- src/modules/comp/e_mod_comp_wl_shell.c (révision 81560)
+++ src/modules/comp/e_mod_comp_wl_shell.c (copie de travail)
@@ -414,7 +414,7 @@
LOGFN(__FILE__, __LINE__, __FUNCTION__);
wss = resource->data;
- if (wss->title) free(wss->title);
+ free(wss->title);
wss->title = strdup(title);
}
@@ -426,7 +426,7 @@
LOGFN(__FILE__, __LINE__, __FUNCTION__);
wss = resource->data;
- if (wss->clas) free(wss->clas);
+ free(wss->clas);
wss->clas = strdup(clas);
}
Index: src/modules/comp/e_mod_comp.c
===================================================================
--- src/modules/comp/e_mod_comp.c (révision 81560)
+++ src/modules/comp/e_mod_comp.c (copie de travail)
@@ -569,8 +569,7 @@
}
if (!_e_mod_comp_win_shaped_check(cw, cw->rects, cw->rects_num))
{
- free(cw->rects);
- cw->rects = NULL;
+ E_FREE(cw->rects);
cw->rects_num = 0;
}
if ((cw->rects) && (!cw->shaped))
@@ -1947,7 +1946,7 @@
cw->title = ecore_x_icccm_title_get(cw->win);
if (ecore_x_netwm_name_get(cw->win, &netwm_title))
{
- if (cw->title) free(cw->title);
+ free(cw->title);
cw->title = netwm_title;
}
ecore_x_icccm_name_class_get(cw->win, &cw->name, &cw->clas);
@@ -2098,11 +2097,7 @@
e_mod_comp_update_free(cw->up);
DBG(" [0x%x] del\n", cw->win);
- if (cw->rects)
- {
- free(cw->rects);
- cw->rects = NULL;
- }
+ E_FREE(cw->rects);
if (cw->update_timeout)
{
ecore_timer_del(cw->update_timeout);
@@ -2166,10 +2161,10 @@
if (cw->inhash)
eina_hash_del(windows, e_util_winid_str_get(cw->win), cw);
- if (cw->title) free(cw->title);
- if (cw->name) free(cw->name);
- if (cw->clas) free(cw->clas);
- if (cw->role) free(cw->role);
+ free(cw->title);
+ free(cw->name);
+ free(cw->clas);
+ free(cw->role);
cw->c->wins_invalid = 1;
cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cw));
pending_count = cw->pending_count;
@@ -3847,8 +3842,8 @@
ecore_x_sync();
continue;
}
- if (wname) free(wname);
- if (wclass) free(wclass);
+ free(wname);
+ free(wclass);
wname = wclass = NULL;
cw = _e_mod_comp_win_add(c, wins[i]);
if (!cw) continue;
Index: src/modules/comp/e_mod_comp_update.c
===================================================================
--- src/modules/comp/e_mod_comp_update.c (révision 81560)
+++ src/modules/comp/e_mod_comp_update.c (copie de travail)
@@ -28,7 +28,7 @@
void
e_mod_comp_update_free(E_Update *up)
{
- if (up->tiles) free(up->tiles);
+ free(up->tiles);
free(up);
}
Index: src/modules/comp/e_mod_config.c
===================================================================
--- src/modules/comp/e_mod_config.c (révision 81560)
+++ src/modules/comp/e_mod_config.c (copie de travail)
@@ -206,10 +206,10 @@
if (m->match.clas) eina_stringshare_del(m->match.clas);
if (m->match.role) eina_stringshare_del(m->match.role);
if (m->match.shadow_style) eina_stringshare_del(m->match.shadow_style);
- if (m->title) free(m->title);
- if (m->name) free(m->name);
- if (m->clas) free(m->clas);
- if (m->role) free(m->role);
+ free(m->title);
+ free(m->name);
+ free(m->clas);
+ free(m->role);
free(m);
}
@@ -615,32 +615,28 @@
if (m->title)
{
if (m->title[0]) m->match.title = eina_stringshare_add(m->title);
- free(m->title);
- m->title = NULL;
+ E_FREE(m->title);
}
if (m->match.name) eina_stringshare_del(m->match.name);
m->match.name = NULL;
if (m->name)
{
if (m->name[0]) m->match.name = eina_stringshare_add(m->name);
- free(m->name);
- m->name = NULL;
+ E_FREE(m->name);
}
if (m->match.clas) eina_stringshare_del(m->match.clas);
m->match.clas = NULL;
if (m->clas)
{
if (m->clas[0]) m->match.clas = eina_stringshare_add(m->clas);
- free(m->clas);
- m->clas = NULL;
+ E_FREE(m->clas);
}
if (m->match.role) eina_stringshare_del(m->match.role);
m->match.role = NULL;
if (m->role)
{
if (m->role[0]) m->match.role = eina_stringshare_add(m->role);
- free(m->role);
- m->role = NULL;
+ E_FREE(m->role);
}
m->match.borderless = m->borderless;
m->match.dialog = m->dialog;
Index: src/modules/illume2/e_mod_config_policy.c
===================================================================
--- src/modules/illume2/e_mod_config_policy.c (révision 81560)
+++ src/modules/illume2/e_mod_config_policy.c (copie de travail)
@@ -153,7 +153,7 @@
e_object_del(E_OBJECT(p));
continue;
}
- if (file) free(file);
+ free(file);
l = eina_list_append(l, p);
}
Index: src/modules/illume2/e_mod_policy.c
===================================================================
--- src/modules/illume2/e_mod_policy.c (révision 81560)
+++ src/modules/illume2/e_mod_policy.c (copie de travail)
@@ -46,7 +46,7 @@
{
/* loading policy failed, bail out */
printf("Cannot load policy: %s\n", file);
- if (file) free(file);
+ free(file);
return 0;
}
@@ -147,7 +147,7 @@
}
free(file);
}
- if (file) free(file);
+ free(file);
else
{
/* if we did not find the requested policy, use a fallback */
@@ -493,7 +493,7 @@
/* try to load the policy */
_e_mod_policy_load(file);
- if (file) free(file);
+ free(file);
return ECORE_CALLBACK_PASS_ON;
}
Index: src/modules/illume2/e_mod_select_window.c
===================================================================
--- src/modules/illume2/e_mod_select_window.c (révision 81560)
+++ src/modules/illume2/e_mod_select_window.c (copie de travail)
@@ -134,9 +134,9 @@
break;
}
- if (title) free(title);
- if (name) free(name);
- if (class) free(class);
+ free(title);
+ free(name);
+ free(class);
if (_sw_change_timer) ecore_timer_del(_sw_change_timer);
_sw_change_timer =
@@ -235,9 +235,9 @@
break;
}
- if (title) free(title);
- if (name) free(name);
- if (class) free(class);
+ free(title);
+ free(name);
+ free(class);
return match;
}
Index: src/modules/conf_keybindings/e_int_config_keybindings.c
===================================================================
--- src/modules/conf_keybindings/e_int_config_keybindings.c (révision 81560)
+++ src/modules/conf_keybindings/e_int_config_keybindings.c (copie de travail)
@@ -175,8 +175,8 @@
eina_stringshare_del(cfdata->locals.binding);
eina_stringshare_del(cfdata->locals.action);
- if (cfdata->locals.params) free(cfdata->locals.params);
- if (cfdata->params) free(cfdata->params);
+ free(cfdata->locals.params);
+ free(cfdata->params);
E_FREE(cfdata);
}
@@ -785,7 +785,7 @@
else
{
e_widget_ilist_unselect(cfdata->gui.o_action_list);
- if (cfdata->locals.action) free(cfdata->locals.action);
+ free(cfdata->locals.action);
cfdata->locals.action = strdup("");
e_widget_entry_clear(cfdata->gui.o_params);
}
Index: src/modules/conf_keybindings/e_int_config_mousebindings.c
===================================================================
--- src/modules/conf_keybindings/e_int_config_mousebindings.c (révision 81560)
+++ src/modules/conf_keybindings/e_int_config_mousebindings.c (copie de travail)
@@ -191,7 +191,7 @@
eina_stringshare_del(cfdata->locals.action);
eina_stringshare_del(cfdata->locals.cur);
- if (cfdata->locals.params) free(cfdata->locals.params);
+ free(cfdata->locals.params);
E_FREE(cfdata);
}
@@ -756,8 +756,8 @@
snprintf(label, sizeof(label), "%s + %s", button ? button : "", mods);
else
snprintf(label, sizeof(label), "%s", button ? button : "");
- if (button) free(button);
- if (mods) free(mods);
+ free(button);
+ free(mods);
switch (eb->button)
{
@@ -817,8 +817,8 @@
snprintf(label, sizeof(label), "%s + %s", button ? button : "", mods);
else
snprintf(label, sizeof(label), "%s", button ? button : "");
- if (button) free(button);
- if (mods) free(mods);
+ free(button);
+ free(mods);
snprintf(val, sizeof(val), "w%d", i);
Index: src/modules/illume-home/e_mod_main.c
===================================================================
--- src/modules/illume-home/e_mod_main.c (révision 81560)
+++ src/modules/illume-home/e_mod_main.c (copie de travail)
@@ -356,7 +356,7 @@
if (e_exec_startup_id_pid_find(bd->client.netwm.pid,
bd->client.netwm.startup_id) == desktop)
{
- if (exe) free(exe);
+ free(exe);
return bd;
}
if (exe)
@@ -381,7 +381,7 @@
}
}
}
- if (exe) free(exe);
+ free(exe);
return NULL;
}
Index: src/modules/shot/e_mod_main.c
===================================================================
--- src/modules/shot/e_mod_main.c (révision 81560)
+++ src/modules/shot/e_mod_main.c (copie de travail)
@@ -484,7 +484,7 @@
return;
}
rewind(f);
- if (fdata) free(fdata);
+ free(fdata);
fdata = malloc(fsize);
if (!fdata)
{
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel