Commit f3879322 authored by Olly Betts's avatar Olly Betts
Browse files

Make generated tables of encodings and modules const

parent 7a4e654c
......@@ -22,7 +22,7 @@ sb_stemmer_list(void)
static stemmer_encoding_t
sb_getenc(const char * charenc)
{
struct stemmer_encoding * encoding;
const struct stemmer_encoding * encoding;
if (charenc == NULL) return ENC_UTF_8;
for (encoding = encodings; encoding->name != 0; encoding++) {
if (strcmp(encoding->name, charenc) == 0) break;
......@@ -35,7 +35,7 @@ extern struct sb_stemmer *
sb_stemmer_new(const char * algorithm, const char * charenc)
{
stemmer_encoding_t enc;
struct stemmer_modules * module;
const struct stemmer_modules * module;
struct sb_stemmer * stemmer;
enc = sb_getenc(charenc);
......
......@@ -135,7 +135,7 @@ struct stemmer_encoding {
const char * name;
stemmer_encoding_t enc;
};
static struct stemmer_encoding encodings[] = {
static const struct stemmer_encoding encodings[] = {
EOS
for $enc (sort keys %encs) {
print OUT " {\"${enc}\", ENC_${enc}},\n";
......@@ -151,7 +151,7 @@ struct stemmer_modules {
void (*close)(struct SN_env *);
int (*stem)(struct SN_env *);
};
static struct stemmer_modules modules[] = {
static const struct stemmer_modules modules[] = {
EOS
for $lang (sort keys %aliases) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment