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
5e1a73b0b3
commit
9572d6f406
|
@ -1236,14 +1236,14 @@ _help(void)
|
||||||
" -f use netwm fullscreen request (requires x11 + wm)\n"
|
" -f use netwm fullscreen request (requires x11 + wm)\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Where ENGINE can be one of:\n");
|
"Where ENGINE can be one of:\n");
|
||||||
for (i = 0; engines[i].name != NULL; ++i)
|
for (i = 0; engines[i].name; ++i)
|
||||||
fprintf(stderr, " %s", engines[i].name);
|
fprintf(stderr, " %s", engines[i].name);
|
||||||
|
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"\n"
|
"\n"
|
||||||
"Where PROFILE can be one of:\n");
|
"Where PROFILE can be one of:\n");
|
||||||
|
|
||||||
for (i = 0; resolutions[i].name != NULL; ++i)
|
for (i = 0; resolutions[i].name; ++i)
|
||||||
fprintf(stderr, " %s", resolutions[i].name);
|
fprintf(stderr, " %s", resolutions[i].name);
|
||||||
|
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
|
@ -1260,7 +1260,7 @@ _profile_parse(int argc, char **argv)
|
||||||
if ((!strcmp(argv[i], "-p")) && (i < (argc - 1)))
|
if ((!strcmp(argv[i], "-p")) && (i < (argc - 1)))
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
for (j = 0; resolutions[j].name != NULL; ++j)
|
for (j = 0; resolutions[j].name; ++j)
|
||||||
if (!strcmp(argv[i], resolutions[j].name))
|
if (!strcmp(argv[i], resolutions[j].name))
|
||||||
{
|
{
|
||||||
profile = resolutions[j].name;
|
profile = resolutions[j].name;
|
||||||
|
@ -1269,7 +1269,7 @@ _profile_parse(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resolutions[j].name == NULL)
|
if (!resolutions[j].name)
|
||||||
_help();
|
_help();
|
||||||
}
|
}
|
||||||
else if ((!strcmp(argv[i], "-c")) && (i < (argc - 1)))
|
else if ((!strcmp(argv[i], "-c")) && (i < (argc - 1)))
|
||||||
|
@ -1318,7 +1318,7 @@ _engine_args(int argc, char **argv)
|
||||||
{
|
{
|
||||||
++i;
|
++i;
|
||||||
|
|
||||||
for (j = 0; engines[j].name != NULL; ++j)
|
for (j = 0; engines[j].name; ++j)
|
||||||
if (!strcmp(argv[i], engines[j].name))
|
if (!strcmp(argv[i], engines[j].name))
|
||||||
{
|
{
|
||||||
engine = engines[j].name;
|
engine = engines[j].name;
|
||||||
|
|
Loading…
Reference in New Issue