aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vorel <petr.vorel@gmail.com>2017-10-13 15:57:19 +0200
committerStephen Hemminger <stephen@networkplumber.org>2017-10-16 09:24:11 -0700
commit4b73d52f8a81919f511cd47d39251f74f6a37c7d (patch)
treedbf39684e8d0fb942dc7350b172568778f1ed097
parent99b89c518e929e32d9b1e9e5623550018f22b552 (diff)
downloadplatform_external_iproute2-4b73d52f8a81919f511cd47d39251f74f6a37c7d.tar.gz
platform_external_iproute2-4b73d52f8a81919f511cd47d39251f74f6a37c7d.tar.bz2
platform_external_iproute2-4b73d52f8a81919f511cd47d39251f74f6a37c7d.zip
color: Rename enum
COLOR_NONE is more descriptive than COLOR_CLEAR. Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
-rw-r--r--include/color.h2
-rw-r--r--include/json_print.h2
-rw-r--r--lib/color.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/include/color.h b/include/color.h
index c183ef79..7fd685d0 100644
--- a/include/color.h
+++ b/include/color.h
@@ -8,7 +8,7 @@ enum color_attr {
COLOR_INET6,
COLOR_OPERSTATE_UP,
COLOR_OPERSTATE_DOWN,
- COLOR_CLEAR
+ COLOR_NONE
};
void enable_color(void);
diff --git a/include/json_print.h b/include/json_print.h
index 596af35a..dc4d2bb3 100644
--- a/include/json_print.h
+++ b/include/json_print.h
@@ -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);
diff --git a/lib/color.c b/lib/color.c
index 497f5e1b..8d049a01 100644
--- a/lib/color.c
+++ b/lib/color.c
@@ -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;
}
}