color: Rename enum

COLOR_NONE is more descriptive than COLOR_CLEAR.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
This commit is contained in:
Petr Vorel 2017-10-13 15:57:19 +02:00 committed by Stephen Hemminger
parent 99b89c518e
commit 4b73d52f8a
3 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@ enum color_attr {
COLOR_INET6, COLOR_INET6,
COLOR_OPERSTATE_UP, COLOR_OPERSTATE_UP,
COLOR_OPERSTATE_DOWN, COLOR_OPERSTATE_DOWN,
COLOR_CLEAR COLOR_NONE
}; };
void enable_color(void); void enable_color(void);

View File

@ -53,7 +53,7 @@ void close_json_array(enum output_type type, const char *delim);
const char *fmt, \ const char *fmt, \
type value) \ 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(int, int);
_PRINT_FUNC(bool, bool); _PRINT_FUNC(bool, bool);

View File

@ -106,7 +106,7 @@ int color_fprintf(FILE *fp, enum color_attr attr, const char *fmt, ...)
va_start(args, fmt); va_start(args, fmt);
if (!color_is_enabled || attr == COLOR_CLEAR) { if (!color_is_enabled || attr == COLOR_NONE) {
ret = vfprintf(fp, fmt, args); ret = vfprintf(fp, fmt, args);
goto end; goto end;
} }
@ -130,7 +130,7 @@ enum color_attr ifa_family_color(__u8 ifa_family)
case AF_INET6: case AF_INET6:
return COLOR_INET6; return COLOR_INET6;
default: default:
return COLOR_CLEAR; return COLOR_NONE;
} }
} }
@ -142,6 +142,6 @@ enum color_attr oper_state_color(__u8 state)
case IF_OPER_DOWN: case IF_OPER_DOWN:
return COLOR_OPERSTATE_DOWN; return COLOR_OPERSTATE_DOWN;
default: default:
return COLOR_CLEAR; return COLOR_NONE;
} }
} }