summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2010-08-21 13:52:25 +0000
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2010-08-21 13:52:25 +0000
commit9572d6f406315dda6d34dac73f62bbf83f0a225c (patch)
tree047007b8afe2fa648075d808e7408424cb1479fd
parent5e1a73b0b3fef3a57e2af1fe70c127210c5ec727 (diff)
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
-rw-r--r--src/bin/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/main.c b/src/bin/main.c
index e972a06..524a6d5 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -1236,14 +1236,14 @@ _help(void)
1236 " -f use netwm fullscreen request (requires x11 + wm)\n" 1236 " -f use netwm fullscreen request (requires x11 + wm)\n"
1237 "\n" 1237 "\n"
1238 "Where ENGINE can be one of:\n"); 1238 "Where ENGINE can be one of:\n");
1239 for (i = 0; engines[i].name != NULL; ++i) 1239 for (i = 0; engines[i].name; ++i)
1240 fprintf(stderr, " %s", engines[i].name); 1240 fprintf(stderr, " %s", engines[i].name);
1241 1241
1242 fprintf(stderr, 1242 fprintf(stderr,
1243 "\n" 1243 "\n"
1244 "Where PROFILE can be one of:\n"); 1244 "Where PROFILE can be one of:\n");
1245 1245
1246 for (i = 0; resolutions[i].name != NULL; ++i) 1246 for (i = 0; resolutions[i].name; ++i)
1247 fprintf(stderr, " %s", resolutions[i].name); 1247 fprintf(stderr, " %s", resolutions[i].name);
1248 1248
1249 fprintf(stderr, "\n"); 1249 fprintf(stderr, "\n");
@@ -1260,7 +1260,7 @@ _profile_parse(int argc, char **argv)
1260 if ((!strcmp(argv[i], "-p")) && (i < (argc - 1))) 1260 if ((!strcmp(argv[i], "-p")) && (i < (argc - 1)))
1261 { 1261 {
1262 i++; 1262 i++;
1263 for (j = 0; resolutions[j].name != NULL; ++j) 1263 for (j = 0; resolutions[j].name; ++j)
1264 if (!strcmp(argv[i], resolutions[j].name)) 1264 if (!strcmp(argv[i], resolutions[j].name))
1265 { 1265 {
1266 profile = resolutions[j].name; 1266 profile = resolutions[j].name;
@@ -1269,7 +1269,7 @@ _profile_parse(int argc, char **argv)
1269 break; 1269 break;
1270 } 1270 }
1271 1271
1272 if (resolutions[j].name == NULL) 1272 if (!resolutions[j].name)
1273 _help(); 1273 _help();
1274 } 1274 }
1275 else if ((!strcmp(argv[i], "-c")) && (i < (argc - 1))) 1275 else if ((!strcmp(argv[i], "-c")) && (i < (argc - 1)))
@@ -1318,7 +1318,7 @@ _engine_args(int argc, char **argv)
1318 { 1318 {
1319 ++i; 1319 ++i;
1320 1320
1321 for (j = 0; engines[j].name != NULL; ++j) 1321 for (j = 0; engines[j].name; ++j)
1322 if (!strcmp(argv[i], engines[j].name)) 1322 if (!strcmp(argv[i], engines[j].name))
1323 { 1323 {
1324 engine = engines[j].name; 1324 engine = engines[j].name;