]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: do not use plain 0 as NULL [smatch scan]
authorSami Kerola <kerolasa@iki.fi>
Fri, 10 Mar 2017 19:50:14 +0000 (19:50 +0000)
committerSami Kerola <kerolasa@iki.fi>
Fri, 17 Mar 2017 21:22:26 +0000 (21:22 +0000)
Likewise commit 87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
lib/colors.c
lib/cpuset.c
libfdisk/samples/mkpart.c
libsmartcols/samples/fromfile.c
libsmartcols/samples/title.c
libsmartcols/samples/tree.c
misc-utils/test_uuidd.c

index dda6170574d931c291f71ef4c20755c24259b8a0..b2742e4e9f858d77196e88ac73fc1fb232ec0b26 100644 (file)
@@ -830,11 +830,11 @@ int colormode_or_err(const char *str, const char *errmsg)
 int main(int argc, char *argv[])
 {
        static const struct option longopts[] = {
-               { "mode",       required_argument, 0, 'm' },
-               { "color",      required_argument, 0, 'c' },
-               { "color-scheme", required_argument, 0, 'C' },
-               { "name",       required_argument, 0, 'n' },
-               { NULL, 0, 0, 0 }
+               { "mode",       required_argument, NULL, 'm' },
+               { "color",      required_argument, NULL, 'c' },
+               { "color-scheme", required_argument, NULL, 'C' },
+               { "name",       required_argument, NULL, 'n' },
+               { NULL, 0, NULL, 0 }
        };
        int c, mode = UL_COLORMODE_UNDEF;       /* default */
        const char *color = "red", *name = NULL, *color_scheme = NULL;
index 89cd0f14cd6816b91f4c20a075083d2871b05869..fbe99e2a55b90873988fb9ae97dd836f874a3349 100644 (file)
@@ -333,10 +333,10 @@ int main(int argc, char *argv[])
        int ncpus = 2048, rc, c;
 
        static const struct option longopts[] = {
-           { "ncpus", 1, 0, 'n' },
-           { "mask",  1, 0, 'm' },
-           { "range", 1, 0, 'r' },
-           { NULL,    0, 0, 0 }
+           { "ncpus", 1, NULL, 'n' },
+           { "mask",  1, NULL, 'm' },
+           { "range", 1, NULL, 'r' },
+           { NULL,    0, NULL, 0 }
        };
 
        while ((c = getopt_long(argc, argv, "n:m:r:", longopts, NULL)) != -1) {
index dc476dbe9baaced4808ed55fb660a73edeed0145..4ca3ed35db2ce96cf143602977e2461044b5f83c 100644 (file)
@@ -55,10 +55,10 @@ int main(int argc, char *argv[])
        unsigned int sectorsize;
 
        static const struct option longopts[] = {
-               { "label",  required_argument, 0, 'x' },
-               { "device", required_argument, 0, 'd' },
-               { "help",   no_argument, 0, 'h' },
-               { NULL, 0, 0, 0 },
+               { "label",  required_argument, NULL, 'x' },
+               { "device", required_argument, NULL, 'd' },
+               { "help",   no_argument, NULL, 'h' },
+               { NULL, 0, NULL, 0 },
        };
 
        setlocale(LC_ALL, "");  /* just to have enable UTF8 chars */
index 1a90e2d4bb9a1322a96733dd31f02f1d9635ae82..674f012063a196dc113088918e0ea3ba60dbf57a 100644 (file)
@@ -222,18 +222,18 @@ int main(int argc, char *argv[])
        int parent_col = -1, id_col = -1;
 
        static const struct option longopts[] = {
-               { "maxout", 0, 0, 'm' },
-               { "column", 1, 0, 'c' },
-               { "nlines", 1, 0, 'n' },
-               { "width",  1, 0, 'w' },
-               { "tree-parent-column", 1, 0, 'p' },
-               { "tree-id-column",     1, 0, 'i' },
-               { "json",   0, 0, 'J' },
-               { "raw",    0, 0, 'r' },
-               { "export", 0, 0, 'E' },
-               { "colsep",  1, 0, 'C' },
-               { "help",   0, 0, 'h' },
-               { NULL, 0, 0, 0 },
+               { "maxout", 0, NULL, 'm' },
+               { "column", 1, NULL, 'c' },
+               { "nlines", 1, NULL, 'n' },
+               { "width",  1, NULL, 'w' },
+               { "tree-parent-column", 1, NULL, 'p' },
+               { "tree-id-column",     1, NULL, 'i' },
+               { "json",   0, NULL, 'J' },
+               { "raw",    0, NULL, 'r' },
+               { "export", 0, NULL, 'E' },
+               { "colsep",  1, NULL, 'C' },
+               { "help",   0, NULL, 'h' },
+               { NULL, 0, NULL, 0 },
        };
 
        static const ul_excl_t excl[] = {       /* rows and cols in ASCII order */
index 85231609565b44f4fe77ad3a24b57de4f028f191..2d33b563a6dc6bda611dd6a32b80b51d9daff2fe 100644 (file)
@@ -60,9 +60,9 @@ int main(int argc, char *argv[])
        int c;
 
        static const struct option longopts[] = {
-               { "maxout", 0, 0, 'm' },
-               { "width",  1, 0, 'w' },
-               { NULL, 0, 0, 0 },
+               { "maxout", 0, NULL, 'm' },
+               { "width",  1, NULL, 'w' },
+               { NULL, 0, NULL, 0 },
        };
 
        setlocale(LC_ALL, "");  /* just to have enable UTF8 chars */
index c809b2d85a34ae7fa10dcb0248d37ae040fe1757..fcb175135c254287a55dd53818fe5ea4a720d2d9 100644 (file)
@@ -162,16 +162,16 @@ int main(int argc, char *argv[])
 
 
        static const struct option longopts[] = {
-               { "ascii",      0, 0, 'i' },
-               { "csv",        0, 0, 'c' },
-               { "list",       0, 0, 'l' },
-               { "noheadings", 0, 0, 'n' },
-               { "pairs",      0, 0, 'p' },
-               { "json",       0, 0, 'J' },
-               { "raw",        0, 0, 'r' },
-               { "range-start",1, 0, 'S' },
-               { "range-end",  1, 0, 'E' },
-               { NULL, 0, 0, 0 },
+               { "ascii",      0, NULL, 'i' },
+               { "csv",        0, NULL, 'c' },
+               { "list",       0, NULL, 'l' },
+               { "noheadings", 0, NULL, 'n' },
+               { "pairs",      0, NULL, 'p' },
+               { "json",       0, NULL, 'J' },
+               { "raw",        0, NULL, 'r' },
+               { "range-start",1, NULL, 'S' },
+               { "range-end",  1, NULL, 'E' },
+               { NULL, 0, NULL, 0 },
        };
 
        setlocale(LC_ALL, "");  /* just to have enable UTF8 chars */
index 13a9880b10df7b54cda97577ac33ee090c0d1f0e..d590f9632508126e6ed71b09769b8f6abd71798e 100644 (file)
@@ -146,7 +146,7 @@ static void *create_uuids(thread_t *th)
                obj->pid = th->proc->pid;
                obj->idx = th->index + i;;
        }
-       return 0;
+       return NULL;
 }
 
 static void *thread_body(void *arg)