From: Junio C Hamano Date: Fri, 11 Aug 2017 20:26:58 +0000 (-0700) Subject: Merge branch 'jk/c99' X-Git-Tag: v2.15.0-rc0~205 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e72ecd324c54675ddf20ecb7b303ad5ec88f6301?hp=-c 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 --- e72ecd324c54675ddf20ecb7b303ad5ec88f6301 diff --combined builtin/clean.c index c1bafda5b6,e2bb3c69ed..21a7a32994 --- a/builtin/clean.c +++ b/builtin/clean.c @@@ -33,15 -33,6 +33,6 @@@ static const char *msg_skip_git_dir = 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 +42,16 @@@ 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 @@@ -125,7 -126,8 +126,7 @@@ static int git_clean_config(const char return 0; } - /* inspect the color.ui config variable and others */ - return git_color_default_config(var, value, cb); + return git_default_config(var, value, cb); } static const char *clean_get_color(enum color_clean ix)