From: Petr Vorel <petr.vorel@gmail.com>
To: netdev@vger.kernel.org
Cc: Petr Vorel <petr.vorel@gmail.com>,
Julien Fortin <julien@cumulusnetworks.com>,
Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH iproute2 v2 4/4] color: Rename enum
Date: Fri, 13 Oct 2017 15:57:19 +0200 [thread overview]
Message-ID: <20171013135719.18450-5-petr.vorel@gmail.com> (raw)
In-Reply-To: <20171013135719.18450-1-petr.vorel@gmail.com>
COLOR_NONE is more descriptive than COLOR_CLEAR.
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
include/color.h | 2 +-
include/json_print.h | 2 +-
lib/color.c | 6 +++---
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;
}
}
--
2.14.2
next prev parent reply other threads:[~2017-10-13 13:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-13 13:57 [PATCH iproute2 v2 0/4] Fix ip segfault when using --color switch Petr Vorel
2017-10-13 13:57 ` [PATCH iproute2 v2 1/4] color: " Petr Vorel
2017-10-13 13:57 ` [PATCH iproute2 v2 2/4] color: Fix another " Petr Vorel
2017-10-13 13:57 ` [PATCH iproute2 v2 3/4] color: Cleanup code to remove "magic" offset + 7 Petr Vorel
2017-10-13 13:57 ` Petr Vorel [this message]
2017-10-16 16:24 ` [PATCH iproute2 v2 0/4] Fix ip segfault when using --color switch Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171013135719.18450-5-petr.vorel@gmail.com \
--to=petr.vorel@gmail.com \
--cc=julien@cumulusnetworks.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).