Use the phflag bit offset constants to specify the phflag-based conditions.

This commit is contained in:
Reece H. Dunn
2017-01-29 00:04:44 +00:00
parent a66cc8de7f
commit 98703c30de
3 changed files with 8 additions and 14 deletions
+6 -6
View File
@@ -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 },
+1 -1
View File
@@ -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:
+1 -7
View File
@@ -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