From 1a5db2f49880971c67e570c432562c6773ab7f15 Mon Sep 17 00:00:00 2001 From: Juho Hiltunen Date: Sun, 11 Jul 2021 19:43:04 +0300 Subject: [PATCH] code cleanup: move dict_min_size handline in LoadVoice(). --- src/libespeak-ng/voices.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libespeak-ng/voices.c b/src/libespeak-ng/voices.c index 2d0c306f..b457f1fe 100644 --- a/src/libespeak-ng/voices.c +++ b/src/libespeak-ng/voices.c @@ -519,7 +519,6 @@ voice_t *LoadVoice(const char *vname, int control) char buf[sizeof(path_home)+30]; char path_voices[sizeof(path_home)+12]; - int dict_min = 0; int stress_add[8]; char names[8][40]; char name1[40]; @@ -877,8 +876,15 @@ voice_t *LoadVoice(const char *vname, int control) sscanf(p, "%d", &speed.fast_settings); SetSpeed(3); break; - case V_DICTMIN: - sscanf(p, "%d", &dict_min); + case V_DICTMIN: { + if (CheckTranslator(translator, keyword_tab, key) != 0) + break; + + if (sscanf(p, "%d", &value) == 1) + translator->dict_min_size = value; + break; + } + break; case V_MAINTAINER: case V_STATUS: @@ -919,7 +925,6 @@ voice_t *LoadVoice(const char *vname, int control) voice->phoneme_tab_ix = ix; translator->phoneme_tab_ix = ix; - translator->dict_min_size = dict_min; if (!(control & 8/*compiling phonemes*/)) { LoadDictionary(translator, new_dictionary, control & 4);