]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
color: Rename enum
authorPetr Vorel <petr.vorel@gmail.com>
Fri, 13 Oct 2017 13:57:19 +0000 (15:57 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 16 Oct 2017 16:24:11 +0000 (09:24 -0700)
COLOR_NONE is more descriptive than COLOR_CLEAR.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
include/color.h
include/json_print.h
lib/color.c

index c183ef7904ad9844302732b4b2ddfe89f4820b98..7fd685d0dcf825b28374059b25b2df1fcce82e2b 100644 (file)
@@ -8,7 +8,7 @@ enum color_attr {
        COLOR_INET6,
        COLOR_OPERSTATE_UP,
        COLOR_OPERSTATE_DOWN,
-       COLOR_CLEAR
+       COLOR_NONE
 };
 
 void enable_color(void);
index 596af35a3b0ee5abad4f02ea0e845fddc5c6ab30..dc4d2bb3ba59a70e8eeeb2e8be9228dbcab245c2 100644 (file)
@@ -53,7 +53,7 @@ void close_json_array(enum output_type type, const char *delim);
                                             const char *fmt,           \
                                             type value)                \
        {                                                               \
-               print_color_##type_name(t, COLOR_CLEAR, key, fmt, value);       \
+               print_color_##type_name(t, COLOR_NONE, key, fmt, value);        \
        }
 _PRINT_FUNC(int, int);
 _PRINT_FUNC(bool, bool);
index 497f5e1b8f42f83dfbd47ee5dfea3316a3a2f88f..8d049a01ec0e462acbef11d60f86812070625ffc 100644 (file)
@@ -106,7 +106,7 @@ int color_fprintf(FILE *fp, enum color_attr attr, const char *fmt, ...)
 
        va_start(args, fmt);
 
-       if (!color_is_enabled || attr == COLOR_CLEAR) {
+       if (!color_is_enabled || attr == COLOR_NONE) {
                ret = vfprintf(fp, fmt, args);
                goto end;
        }
@@ -130,7 +130,7 @@ enum color_attr ifa_family_color(__u8 ifa_family)
        case AF_INET6:
                return COLOR_INET6;
        default:
-               return COLOR_CLEAR;
+               return COLOR_NONE;
        }
 }
 
@@ -142,6 +142,6 @@ enum color_attr oper_state_color(__u8 state)
        case IF_OPER_DOWN:
                return COLOR_OPERSTATE_DOWN;
        default:
-               return COLOR_CLEAR;
+               return COLOR_NONE;
        }
 }