]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmartcols: fix test variable shadowing
authorSami Kerola <kerolasa@iki.fi>
Sun, 5 Mar 2017 21:02:53 +0000 (21:02 +0000)
committerSami Kerola <kerolasa@iki.fi>
Fri, 17 Mar 2017 21:22:26 +0000 (21:22 +0000)
libsmartcols/samples/fromfile.c:57:16: warning: declaration of 'flags'
shadows a global declaration [-Wshadow]
libsmartcols/samples/fromfile.c:29:33: note: shadowed declaration is here
libsmartcols/samples/fromfile.c:101:8: warning: declaration of 'flags'
shadows a global declaration [-Wshadow]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
libsmartcols/samples/fromfile.c

index 4c9fca46830869c1a17450d4f17e734c24676460..1a90e2d4bb9a1322a96733dd31f02f1d9635ae82 100644 (file)
@@ -54,12 +54,12 @@ static long name_to_flag(const char *name, size_t namesz)
 
 static int parse_column_flags(char *str)
 {
-       unsigned long flags = 0;
+       unsigned long num_flags = 0;
 
-       if (string_to_bitmask(str, &flags, name_to_flag))
+       if (string_to_bitmask(str, &num_flags, name_to_flag))
                err(EXIT_FAILURE, "failed to parse column flags");
 
-       return flags;
+       return num_flags;
 }
 
 static struct libscols_column *parse_column(FILE *f)
@@ -98,8 +98,8 @@ static struct libscols_column *parse_column(FILE *f)
                }
                case 2: /* FLAGS */
                {
-                       int flags = parse_column_flags(line);
-                       if (scols_column_set_flags(cl, flags))
+                       int num_flags = parse_column_flags(line);
+                       if (scols_column_set_flags(cl, num_flags))
                                goto fail;
                        if (strcmp(line, "wrapnl") == 0) {
                                scols_column_set_wrapfunc(cl,