Convert (hopefully) all comparisons to NULL
Apply badzero.cocci, badnull.coci and badnull2.cocci This should convert all cases where there's a comparison to NULL to simpler forms. This patch applies the following transformations: code before patch ||code after patch =============================================================== return a == NULL; return !a; return a != NULL; return !!a; func(a == NULL); func(!a); func(a != NULL); func(!!a); b = a == NULL; b = !a; b = a != NULL; b = !!a; b = a == NULL ? c : d; b = !a ? c : d; b = a != NULL ? c : d; b = a ? c : d; other cases: a == NULL !a a != NULL a SVN revision: 51487
This commit is contained in:
parent
a0170084d5
commit
d98f684bad
|
@ -81,9 +81,9 @@ _net_config_devices_get(void)
|
||||||
d = opendir("/dev/net");
|
d = opendir("/dev/net");
|
||||||
if (!d) return NULL;
|
if (!d) return NULL;
|
||||||
|
|
||||||
while ((dentry = readdir(d)) != NULL)
|
while ((dentry = readdir(d)))
|
||||||
{
|
{
|
||||||
if (strstr(dentry->d_name,".") == NULL)
|
if (!strstr(dentry->d_name, "."))
|
||||||
devs = eina_list_append(devs, strdup(dentry->d_name));
|
devs = eina_list_append(devs, strdup(dentry->d_name));
|
||||||
}
|
}
|
||||||
closedir(d);
|
closedir(d);
|
||||||
|
|
|
@ -157,7 +157,7 @@ _apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
|
|
||||||
ci = cfd->data;
|
ci = cfd->data;
|
||||||
tmp = eina_list_nth(cfdata->devs, cfdata->num);
|
tmp = eina_list_nth(cfdata->devs, cfdata->num);
|
||||||
if (tmp != NULL)
|
if (tmp)
|
||||||
{
|
{
|
||||||
eina_stringshare_del(ci->device);
|
eina_stringshare_del(ci->device);
|
||||||
ci->device = eina_stringshare_add(tmp);
|
ci->device = eina_stringshare_add(tmp);
|
||||||
|
@ -167,7 +167,7 @@ _apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
||||||
ci->show_popup = cfdata->show_popup;
|
ci->show_popup = cfdata->show_popup;
|
||||||
|
|
||||||
if (ci->app) eina_stringshare_del(ci->app);
|
if (ci->app) eina_stringshare_del(ci->app);
|
||||||
if (cfdata->app != NULL)
|
if (cfdata->app)
|
||||||
ci->app = eina_stringshare_add(cfdata->app);
|
ci->app = eina_stringshare_add(cfdata->app);
|
||||||
|
|
||||||
e_config_save_queue();
|
e_config_save_queue();
|
||||||
|
|
|
@ -143,7 +143,7 @@ _net_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event)
|
||||||
ev = event;
|
ev = event;
|
||||||
if ((ev->button == 1) && (ev->flags & EVAS_BUTTON_DOUBLE_CLICK))
|
if ((ev->button == 1) && (ev->flags & EVAS_BUTTON_DOUBLE_CLICK))
|
||||||
{
|
{
|
||||||
if (inst->ci->app != NULL)
|
if (inst->ci->app)
|
||||||
{
|
{
|
||||||
x = ecore_exe_run(inst->ci->app, NULL);
|
x = ecore_exe_run(inst->ci->app, NULL);
|
||||||
if (x) ecore_exe_free(x);
|
if (x) ecore_exe_free(x);
|
||||||
|
@ -187,7 +187,7 @@ _net_cb_mouse_in(void *data, Evas_Object *obj, const char *emission, const char
|
||||||
char buf[PATH_MAX], tmp[100];
|
char buf[PATH_MAX], tmp[100];
|
||||||
|
|
||||||
inst = data;
|
inst = data;
|
||||||
if (inst->popup != NULL) return;
|
if (inst->popup) return;
|
||||||
if (!inst->ci->show_popup) return;
|
if (!inst->ci->show_popup) return;
|
||||||
|
|
||||||
inst->popup = e_gadcon_popup_new(inst->gcc);
|
inst->popup = e_gadcon_popup_new(inst->gcc);
|
||||||
|
|
Loading…
Reference in New Issue