From f4133364d1da2f5e9c836e77a75a8c911c85610d Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 11 Jun 2022 16:20:19 +0200 Subject: [PATCH] Add more const qualifiers --- src/libespeak-ng/compiledict.c | 2 +- src/libespeak-ng/dictionary.c | 4 ++-- src/libespeak-ng/ssml.c | 4 ++-- src/libespeak-ng/translate.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libespeak-ng/compiledict.c b/src/libespeak-ng/compiledict.c index dcb87475..cfe31c69 100644 --- a/src/libespeak-ng/compiledict.c +++ b/src/libespeak-ng/compiledict.c @@ -768,7 +768,7 @@ static int isHexDigit(int c) static void copy_rule_string(char *string, int *state_out) { // state 0: conditional, 1=pre, 2=match, 3=post, 4=phonemes - static char *const outbuf[5] = { rule_cond, rule_pre, rule_match, rule_post, rule_phonemes }; + static char * const outbuf[5] = { rule_cond, rule_pre, rule_match, rule_post, rule_phonemes }; static const int next_state[5] = { 2, 2, 4, 4, 4 }; char *output; char *p; diff --git a/src/libespeak-ng/dictionary.c b/src/libespeak-ng/dictionary.c index 901fb040..c7c6cf89 100644 --- a/src/libespeak-ng/dictionary.c +++ b/src/libespeak-ng/dictionary.c @@ -3056,11 +3056,11 @@ int RemoveEnding(Translator *tr, char *word, int end_type, char *word_copy) char ending[50] = {0}; // these lists are language specific, but are only relevant if the 'e' suffix flag is used - static const char *add_e_exceptions[] = { + static const char * const add_e_exceptions[] = { "ion", NULL }; - static const char *add_e_additions[] = { + static const char * const add_e_additions[] = { "c", "rs", "ir", "ur", "ath", "ns", "u", "spong", // sponge "rang", // strange diff --git a/src/libespeak-ng/ssml.c b/src/libespeak-ng/ssml.c index dd710aaa..c6c2bd15 100644 --- a/src/libespeak-ng/ssml.c +++ b/src/libespeak-ng/ssml.c @@ -531,7 +531,7 @@ static void SetProsodyParameter(int param_type, const wchar_t *attr1, PARAM_STAC { NULL, -1 } }; - static const MNEM_TAB *mnem_tabs[5] = { + static const MNEM_TAB * const mnem_tabs[5] = { NULL, mnem_rate, mnem_volume, mnem_pitch, mnem_range }; @@ -648,7 +648,7 @@ int ProcessSsmlTag(wchar_t *xml_buf, char *outbuf, int *outix, int n_outbuf, con { NULL, -1 } }; - static const char *prosody_attr[5] = { + static const char * const prosody_attr[5] = { NULL, "rate", "volume", "pitch", "range" }; diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c index f83314a7..33bf5425 100644 --- a/src/libespeak-ng/translate.c +++ b/src/libespeak-ng/translate.c @@ -342,7 +342,7 @@ int utf8_out(unsigned int c, char *buf) int n_bytes; int j; int shift; - static char unsigned code[4] = { 0, 0xc0, 0xe0, 0xf0 }; + static const char unsigned code[4] = { 0, 0xc0, 0xe0, 0xf0 }; if (c < 0x80) { buf[0] = c;