btrfs-progs: Remove extra 'const' modifiers; they don't do anything.
authorAdam Buchbinder <abuchbinder@google.com>
Fri, 13 Jun 2014 21:34:35 +0000 (14:34 -0700)
committerDavid Sterba <dsterba@suse.cz>
Fri, 10 Oct 2014 16:28:28 +0000 (18:28 +0200)
'const int const *x' means the same thing as 'const int *x' or
'int const *x'; the intent was probably 'const int * const x'.
However, this won't work for the 'suffix' variable, as it has
to be assigned, and making the static tables into const pointers
to const chars leads to a mismatch there.

This was found with clang's duplicate-decl-specifier warning.

Signed-off-by: Adam Buchbinder <abuchbinder@google.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
utils.c

diff --git a/utils.c b/utils.c
index a8634ef..bdb7399 100644 (file)
--- a/utils.c
+++ b/utils.c
@@ -1294,9 +1294,9 @@ out:
        return ret;
 }
 
-static const char const *unit_suffix_binary[] =
+static const charunit_suffix_binary[] =
        { "B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB"};
-static const char const *unit_suffix_decimal[] =
+static const charunit_suffix_decimal[] =
        { "B", "KB", "MB", "GB", "TB", "PB", "EB"};
 
 int pretty_size_snprintf(u64 size, char *str, size_t str_size, int unit_mode)
@@ -1304,7 +1304,7 @@ int pretty_size_snprintf(u64 size, char *str, size_t str_size, int unit_mode)
        int num_divs;
        float fraction;
        int base = 0;
-       const char const **suffix = NULL;
+       const char** suffix = NULL;
        u64 last_size;
 
        if (str_size == 0)