diff options
author | Jim Meyering <meyering@redhat.com> | 2011-12-28 16:54:43 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2011-12-28 16:54:43 +0100 |
commit | 975dd02ee88db24748b1460e3959443b221d6648 (patch) | |
tree | e1d4b667d3346e924fa2d70b7e74a8f3cc8a6be3 | |
parent | e0bd7aab05b7dbbd3fb456f43ef0421e30d96630 (diff) | |
download | grep-975dd02ee88db24748b1460e3959443b221d6648.tar.gz |
main.c: add some 'const' directives
* src/main.c (color_dict, fg_color, bg_color, cap): Declare const.
No semantic change.
-rw-r--r-- | src/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -252,7 +252,7 @@ color_cap_ne_fct (void) } /* For GREP_COLORS. */ -static struct color_cap color_dict[] = +static const struct color_cap color_dict[] = { { "mt", &selected_match_color, color_cap_mt_fct }, /* both ms/mc */ { "ms", &selected_match_color, NULL }, /* selected matched text */ @@ -303,7 +303,7 @@ w32_sgr2attr (const char *sgr_seq) const char *s, *p; int code, fg = norm_attr & 15, bg = norm_attr & (15 << 4); int bright = 0, inverse = 0; - static int fg_color[] = { + static const int fg_color[] = { 0, /* black */ FOREGROUND_RED, /* red */ FOREGROUND_GREEN, /* green */ @@ -313,7 +313,7 @@ w32_sgr2attr (const char *sgr_seq) FOREGROUND_BLUE | FOREGROUND_GREEN, /* cyan */ FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE /* gray */ }; - static int bg_color[] = { + static const int bg_color[] = { 0, /* black */ BACKGROUND_RED, /* red */ BACKGROUND_GREEN, /* green */ @@ -1886,7 +1886,7 @@ parse_grep_colors (void) if (*q == ':' || *q == '\0') { char c = *q; - struct color_cap *cap; + struct color_cap const *cap; *q++ = '\0'; /* Terminate name or val. */ /* Empty name without val (empty cap) |