diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-08-11 23:26:58 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-11 23:26:58 +0300 |
commit | e72ecd324c54675ddf20ecb7b303ad5ec88f6301 (patch) | |
tree | 33fc3d9042e85c0dd3507c3c1fd4a323ba04d8a9 /builtin | |
parent | 15595ce438d0ce8b195187f00663baa407a2d024 (diff) | |
parent | 512f41cfac55c9dd2f6c47531ee6cbe803ed7ec2 (diff) |
Merge branch 'jk/c99'
Start using selected c99 constructs in small, stable and
essentialpart of the system to catch people who care about
older compilers that do not grok them.
* jk/c99:
clean.c: use designated initializer
strbuf: use designated initializers in STRBUF_INIT
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/clean.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/builtin/clean.c b/builtin/clean.c index c1bafda5b6..21a7a32994 100644 --- a/builtin/clean.c +++ b/builtin/clean.c @@ -33,15 +33,6 @@ static const char *msg_skip_git_dir = N_("Skipping repository %s\n"); static const char *msg_would_skip_git_dir = N_("Would skip repository %s\n"); static const char *msg_warn_remove_failed = N_("failed to remove %s"); -static int clean_use_color = -1; -static char clean_colors[][COLOR_MAXLEN] = { - GIT_COLOR_RESET, - GIT_COLOR_NORMAL, /* PLAIN */ - GIT_COLOR_BOLD_BLUE, /* PROMPT */ - GIT_COLOR_BOLD, /* HEADER */ - GIT_COLOR_BOLD_RED, /* HELP */ - GIT_COLOR_BOLD_RED, /* ERROR */ -}; enum color_clean { CLEAN_COLOR_RESET = 0, CLEAN_COLOR_PLAIN = 1, @@ -51,6 +42,16 @@ enum color_clean { CLEAN_COLOR_ERROR = 5 }; +static int clean_use_color = -1; +static char clean_colors[][COLOR_MAXLEN] = { + [CLEAN_COLOR_ERROR] = GIT_COLOR_BOLD_RED, + [CLEAN_COLOR_HEADER] = GIT_COLOR_BOLD, + [CLEAN_COLOR_HELP] = GIT_COLOR_BOLD_RED, + [CLEAN_COLOR_PLAIN] = GIT_COLOR_NORMAL, + [CLEAN_COLOR_PROMPT] = GIT_COLOR_BOLD_BLUE, + [CLEAN_COLOR_RESET] = GIT_COLOR_RESET, +}; + #define MENU_OPTS_SINGLETON 01 #define MENU_OPTS_IMMEDIATE 02 #define MENU_OPTS_LIST_ONLY 04 |