Add more const qualifiers on static arrays

So we know they are just tables, get protected from overflows, and get shared between processes
This commit is contained in:
Samuel Thibault
2022-06-09 08:43:50 +02:00
parent 2d3a49b161
commit a660fc04cc
14 changed files with 51 additions and 51 deletions
+4 -4
View File
@@ -223,14 +223,14 @@ char *DecodeRule(const char *group_chars, int group_length, char *rule, int cont
char suffix[20];
static char output[80];
static char symbols[] = {
static const char symbols[] = {
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
'&', '%', '+', '#', 'S', 'D', 'Z', 'A', 'L', '!',
' ', '@', '?', 'J', 'N', 'K', 'V', '?', 'T', 'X',
'?', 'W'
};
static char symbols_lg[] = { 'A', 'B', 'C', 'H', 'F', 'G', 'Y' };
static const char symbols_lg[] = { 'A', 'B', 'C', 'H', 'F', 'G', 'Y' };
match_type = 0;
buf_pre[0] = 0;
@@ -766,8 +766,8 @@ 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 *outbuf[5] = { rule_cond, rule_pre, rule_match, rule_post, rule_phonemes };
static int next_state[5] = { 2, 2, 4, 4, 4 };
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;
int ix;