]> git.refcnt.org Git - colorize.git/commitdiff
Declare color sets variables as constant
authorSteven Schubiger <stsc@refcnt.org>
Fri, 3 Apr 2015 21:05:30 +0000 (23:05 +0200)
committerSteven Schubiger <stsc@refcnt.org>
Fri, 3 Apr 2015 21:05:30 +0000 (23:05 +0200)
colorize.c

index 9bd5c78d6bb14f7826bcaf141b30eb1f134b42e8..902e189f27a261fb0e32882b26da1bd0d9d5c7e2 100644 (file)
@@ -632,11 +632,11 @@ process_args (unsigned int arg_cnt, char **arg_strings, bool *bold, const struct
     if (color_names[BACKGROUND])
       {
         unsigned int i;
-        unsigned int color_sets[2][2] = { { FOREGROUND, BACKGROUND }, { BACKGROUND, FOREGROUND } };
+        const unsigned int color_sets[2][2] = { { FOREGROUND, BACKGROUND }, { BACKGROUND, FOREGROUND } };
         for (i = 0; i < 2; i++)
           {
-            unsigned int color1 = color_sets[i][0];
-            unsigned int color2 = color_sets[i][1];
+            const unsigned int color1 = color_sets[i][0];
+            const unsigned int color2 = color_sets[i][1];
             if (CHECK_COLORS_RANDOM (color1, color2))
               vfprintf_fail (formats[FMT_RANDOM], tables[color1].desc, color_names[color1]->orig, "cannot be combined with", color_names[color2]->orig);
           }