From 92f703d98b0d2a8fd2e0736ddc4340dc12047a90 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Tue, 18 Apr 2017 07:02:17 +0100 Subject: [PATCH] Use defines instead of hard-coded numbers for more clause logic. --- src/libespeak-ng/readclause.c | 4 ++-- src/libespeak-ng/translate.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index 5a34c418..1094fb75 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -611,7 +611,7 @@ static int AnnouncePunctuation(Translator *tr, int c1, int *c2_ptr, char *output short_pause = CLAUSE_SHORTCOMMA; if ((bufix1 > 0) && !(tr->langopts.param[LOPT_ANNOUNCE_PUNCT] & 2)) { - if ((attributes & ~0x8000) == CLAUSE_SEMICOLON) + if ((attributes & ~CLAUSE_OPTIONAL_SPACE_AFTER) == CLAUSE_SEMICOLON) return CLAUSE_SHORTFALL; return short_pause; } @@ -2000,7 +2000,7 @@ int ReadClause(Translator *tr, char *buf, short *charix, int *charix_top, int n_ continue; } - if ((iswspace(c2) || (punct_data & 0x8000) || 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 = 1; } diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c index 2eb26b2a..17fffa45 100644 --- a/src/libespeak-ng/translate.c +++ b/src/libespeak-ng/translate.c @@ -1982,11 +1982,11 @@ void TranslateClause(Translator *tr, int *tone_out, char **voice_change) charix[charix_top+2] = 0x7fff; charix[charix_top+3] = 0; - clause_pause = (terminator & 0xfff) * 10; // mS + clause_pause = (terminator & CLAUSE_PAUSE) * 10; // mS if (terminator & CLAUSE_PAUSE_LONG) clause_pause = clause_pause * 32; // pause value is *320mS not *10mS - tone = (terminator >> 12) & 0x7; + tone = (terminator & CLAUSE_INTONATION_TYPE) >> 12; if (tone2 != 0) { // override the tone type tone = tone2;