From 0352616de98d2ba58b33e179742f628203418e41 Mon Sep 17 00:00:00 2001 From: Juho Hiltunen Date: Fri, 24 Jul 2020 15:43:08 +0300 Subject: [PATCH] code cleanup: remove ununsed ctrl_embedded It's a duplicate of CTRL_EMBEDDED. --- src/libespeak-ng/readclause.c | 6 +++--- src/libespeak-ng/translate.c | 3 +-- src/libespeak-ng/translate.h | 1 - 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index f2ed2b1b..de5c183e 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -821,8 +821,8 @@ int ReadClause(Translator *tr, char *buf, short *charix, int *charix_top, int n_ return terminator; } - if ((c1 == CTRL_EMBEDDED) || (c1 == ctrl_embedded)) { - // an embedded command. If it's a voice change, end the clause + if (c1 == CTRL_EMBEDDED) { + // an embedded command. If it's a voice change, end the clause if (c2 == 'V') { buf[ix++] = 0; // end the clause at this point while (!iswspace(c1 = GetC()) && !Eof() && (ix < (n_buf-1))) @@ -1020,7 +1020,7 @@ int ReadClause(Translator *tr, char *buf, short *charix, int *charix_top, int n_ continue; } - if ((iswspace(c2) || (punct_data & CLAUSE_OPTIONAL_SPACE_AFTER) || IsBracket(c2) || (c2 == '?') || Eof() || (c2 == ctrl_embedded))) { // don't check for '-' because it prevents recognizing ':-)' + if (iswspace(c2) || (punct_data & CLAUSE_OPTIONAL_SPACE_AFTER) || IsBracket(c2) || (c2 == '?') || Eof() || c2 == CTRL_EMBEDDED) { // don't check for '-' because it prevents recognizing ':-)' // note: (c2='?') is for when a smart-quote has been replaced by '?' is_end_clause = true; } diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c index bf83db11..afad2828 100644 --- a/src/libespeak-ng/translate.c +++ b/src/libespeak-ng/translate.c @@ -88,7 +88,6 @@ int n_ph_list2; PHONEME_LIST2 ph_list2[N_PHONEME_LIST]; // first stage of text->phonemes wchar_t option_punctlist[N_PUNCTLIST] = { 0 }; -char ctrl_embedded = '\001'; // to allow an alternative CTRL for embedded commands // these are overridden by defaults set in the "speak" file int option_linelength = 0; @@ -2162,7 +2161,7 @@ void TranslateClause(Translator *tr, int *tone_out, char **voice_change) c = ' '; } - if ((c == CTRL_EMBEDDED) || (c == ctrl_embedded)) { + if (c == CTRL_EMBEDDED) { // start of embedded command in the text int srcix = source_index-1; diff --git a/src/libespeak-ng/translate.h b/src/libespeak-ng/translate.h index a88fa782..c1666ee3 100644 --- a/src/libespeak-ng/translate.h +++ b/src/libespeak-ng/translate.h @@ -649,7 +649,6 @@ extern wchar_t option_punctlist[N_PUNCTLIST]; // which punctuation characters t extern Translator *translator; extern Translator *translator2; extern char dictionary_name[40]; -extern char ctrl_embedded; // to allow an alternative CTRL for embedded commands extern espeak_ng_TEXT_DECODER *p_decoder; extern int dictionary_skipwords;