From: John Darrington Date: Wed, 25 Oct 2006 22:28:13 +0000 (+0000) Subject: Yet more constness X-Git-Tag: v0.6.0~722 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d9d2b2ae7d49240f3438e4f3c40ac1f276e31fb;p=pspp-builds.git Yet more constness --- diff --git a/src/data/identifier.c b/src/data/identifier.c index 4f38e84f..c6718a5e 100644 --- a/src/data/identifier.c +++ b/src/data/identifier.c @@ -31,7 +31,7 @@ /* Table of keywords. */ -const char *keywords[T_N_KEYWORDS + 1] = +const char *const keywords[T_N_KEYWORDS + 1] = { "AND", "OR", "NOT", "EQ", "GE", "GT", "LE", "LT", "NE", @@ -117,7 +117,7 @@ lex_id_match (const char *kw, const char *tok) int lex_id_to_token (const char *id, size_t len) { - const char **kwp; + const char *const *kwp; if (len < 2 || len > 4) return T_ID; diff --git a/src/data/identifier.h b/src/data/identifier.h index 53be9a76..ff4149c0 100644 --- a/src/data/identifier.h +++ b/src/data/identifier.h @@ -68,6 +68,6 @@ bool lex_id_match_len (const char *keyword_string, size_t keyword_len, bool lex_id_match (const char *keyword_string, const char *token_string); int lex_id_to_token (const char *id, size_t len); -extern const char *keywords[T_N_KEYWORDS + 1] ; +extern const char *const keywords[T_N_KEYWORDS + 1] ; #endif /* !lex_def_h */ diff --git a/src/language/utilities/set.q b/src/language/utilities/set.q index 685b3152..113373d7 100644 --- a/src/language/utilities/set.q +++ b/src/language/utilities/set.q @@ -622,7 +622,7 @@ struct show_sbc void (*function) (void); }; -struct show_sbc show_table[] = +const struct show_sbc show_table[] = { {"BLANKS", show_blanks}, {"CCA", show_cca}, diff --git a/src/math/percentiles.c b/src/math/percentiles.c index d00cf3e0..7fec4ce9 100644 --- a/src/math/percentiles.c +++ b/src/math/percentiles.c @@ -39,7 +39,7 @@ struct ptile_params }; -const char *ptile_alg_desc[] = { +const char *const ptile_alg_desc[] = { "", N_("HAverage"), N_("Weighted Average"), diff --git a/src/math/percentiles.h b/src/math/percentiles.h index efe26918..d1271fa2 100644 --- a/src/math/percentiles.h +++ b/src/math/percentiles.h @@ -38,7 +38,7 @@ enum pc_alg { -extern const char *ptile_alg_desc[]; +extern const char *const ptile_alg_desc[]; diff --git a/src/output/charts/plot-chart.c b/src/output/charts/plot-chart.c index 8a1dc0bd..4fd67aaf 100644 --- a/src/output/charts/plot-chart.c +++ b/src/output/charts/plot-chart.c @@ -41,7 +41,7 @@ #include -const char *data_colour[] = { +const char *const data_colour[] = { "brown", "red", "orange", diff --git a/src/output/charts/plot-chart.h b/src/output/charts/plot-chart.h index c7a1b2df..f5bd6f38 100644 --- a/src/output/charts/plot-chart.h +++ b/src/output/charts/plot-chart.h @@ -40,7 +40,7 @@ #define PLOT_CHART_H -extern const char *data_colour[]; +extern const char *const data_colour[]; enum tick_orientation { TICK_ABSCISSA=0,