diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2010-08-21 13:52:25 +0000 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2010-08-21 13:52:25 +0000 |
commit | 63f07459a05c8e793bcc9bf61bb623b9958984a2 (patch) | |
tree | 30dcf238f312691f44be8cef1663120c59572b81 /src/bin/e_exec.c | |
parent | b2332d59464c22e3ed536aabbf0d288bcd4eebfb (diff) | |
download | enlightenment-63f07459a05c8e793bcc9bf61bb623b9958984a2.tar.gz enlightenment-63f07459a05c8e793bcc9bf61bb623b9958984a2.tar.xz enlightenment-63f07459a05c8e793bcc9bf61bb623b9958984a2.zip |
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
Diffstat (limited to 'src/bin/e_exec.c')
-rw-r--r-- | src/bin/e_exec.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bin/e_exec.c b/src/bin/e_exec.c index d8d7566e7..4395a95cb 100644 --- a/src/bin/e_exec.c +++ b/src/bin/e_exec.c @@ -574,7 +574,7 @@ _dialog_scrolltext_create(Evas *evas, char *title, Ecore_Exe_Event_Data_Line *li obj = e_widget_textblock_add(evas); tlen = 0; - for (i = 0; lines[i].line != NULL; i++) + for (i = 0; lines[i].line; i++) { tlen += lines[i].size + 1; /* When the program output is extraordinarily long, it can cause @@ -600,7 +600,7 @@ _dialog_scrolltext_create(Evas *evas, char *title, Ecore_Exe_Event_Data_Line *li } /* Append the warning about truncated output. */ - if (lines[max_lines].line != NULL) strcat(text, trunc_note); + if (lines[max_lines].line) strcat(text, trunc_note); e_widget_textblock_plain_set(obj, text); } @@ -765,13 +765,13 @@ _dialog_save_cb(void *data __UNUSED__, void *data2) if (read_length) { tlen = 0; - for (i = 0; cfdata->read->lines[i].line != NULL; i++) + for (i = 0; cfdata->read->lines[i].line; i++) tlen += cfdata->read->lines[i].size + 2; text = alloca(tlen + 1); if (text) { text[0] = 0; - for (i = 0; cfdata->read->lines[i].line != NULL; i++) + for (i = 0; cfdata->read->lines[i].line; i++) { strcat(text, "\t"); strcat(text, cfdata->read->lines[i].line); @@ -794,13 +794,13 @@ _dialog_save_cb(void *data __UNUSED__, void *data2) if (read_length) { tlen = 0; - for (i = 0; cfdata->error->lines[i].line != NULL; i++) + for (i = 0; cfdata->error->lines[i].line; i++) tlen += cfdata->error->lines[i].size + 1; text = alloca(tlen + 1); if (text) { text[0] = 0; - for (i = 0; cfdata->error->lines[i].line != NULL; i++) + for (i = 0; cfdata->error->lines[i].line; i++) { strcat(text, "\t"); strcat(text, cfdata->error->lines[i].line); |