From 98703c30de8e2e56c4b88c731fa8887700167858 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 29 Jan 2017 00:04:44 +0000 Subject: [PATCH] Use the phflag bit offset constants to specify the phflag-based conditions. --- src/libespeak-ng/compiledata.c | 12 ++++++------ src/libespeak-ng/synthdata.c | 2 +- src/libespeak-ng/synthesize.h | 8 +------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index beb120ba..745b7afd 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -111,12 +111,12 @@ static keywtab_t k_properties[] = { { "isVStop", 0, phVSTOP }, { "isVFricative", 0, phVFRICATIVE }, - { "isPalatal", 0, i_isPalatal }, - { "isLong", 0, i_isLong }, - { "isRhotic", 0, i_isRhotic }, - { "isSibilant", 0, i_isSibilant }, - { "isFlag1", 0, i_isFlag1 }, - { "isFlag2", 0, i_isFlag2 }, + { "isPalatal", 0, CONDITION_IS_PHFLAG_SET | phFLAGBIT_PALATAL }, + { "isLong", 0, CONDITION_IS_PHFLAG_SET | phFLAGBIT_LONG }, + { "isRhotic", 0, CONDITION_IS_PHFLAG_SET | phFLAGBIT_RHOTIC }, + { "isSibilant", 0, CONDITION_IS_PHFLAG_SET | phFLAGBIT_SIBILANT }, + { "isFlag1", 0, CONDITION_IS_PHFLAG_SET | phFLAGBIT_FLAG1 }, + { "isFlag2", 0, CONDITION_IS_PHFLAG_SET | phFLAGBIT_FLAG2 }, { "isVel", 0, i_isVel }, diff --git a/src/libespeak-ng/synthdata.c b/src/libespeak-ng/synthdata.c index 70504c15..bf46943c 100644 --- a/src/libespeak-ng/synthdata.c +++ b/src/libespeak-ng/synthdata.c @@ -636,7 +636,7 @@ static bool InterpretCondition(Translator *tr, int control, PHONEME_LIST *plist, case 0x20: // place of articulation return ((ph->phflags >> 16) & 0xf) == data; - case 0x40: + case CONDITION_IS_PHFLAG_SET: // is a bit set in phoneme flags return (ph->phflags & (1 << data)) != 0; case 0x80: diff --git a/src/libespeak-ng/synthesize.h b/src/libespeak-ng/synthesize.h index 7a001636..bb9df3aa 100644 --- a/src/libespeak-ng/synthesize.h +++ b/src/libespeak-ng/synthesize.h @@ -332,13 +332,7 @@ typedef struct { // place of articulation #define i_isVel 0x28 -// phflags -#define i_isSibilant 0x45 // bit 5 in phflags -#define i_isPalatal 0x49 // bit 9 in phflags -#define i_isLong 0x55 // bit 21 in phflags -#define i_isRhotic 0x57 // bit 23 in phflags -#define i_isFlag1 0x5c -#define i_isFlag2 0x5d +#define CONDITION_IS_PHFLAG_SET 0x40 #define i_StressLevel 0x800