From 8aa4521d314dfdc084cd1748da715a2c5364f181 Mon Sep 17 00:00:00 2001 From: Sascha Brawer Date: Tue, 20 Mar 2018 02:20:33 +0100 Subject: [PATCH] Make phoneme properties unsigned Fixes two sanitizer warnings: ``` src/libespeak-ng/compiledata.c:2291:27: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' src/libespeak-ng/compiledata.c:2424:34: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' ``` --- src/libespeak-ng/phoneme.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/libespeak-ng/phoneme.h b/src/libespeak-ng/phoneme.h index 82a3311e..97c0635a 100644 --- a/src/libespeak-ng/phoneme.h +++ b/src/libespeak-ng/phoneme.h @@ -177,23 +177,23 @@ phoneme_feature_t phoneme_feature_from_string(const char *feature); #define phFLAGBIT_LOCAL 31 // used during compilation // phoneme properties -#define phUNSTRESSED (1 << phFLAGBIT_UNSTRESSED) -#define phVOICELESS (1 << phFLAGBIT_VOICELESS) -#define phVOICED (1 << phFLAGBIT_VOICED) -#define phSIBILANT (1 << phFLAGBIT_SIBILANT) -#define phNOLINK (1 << phFLAGBIT_NOLINK) -#define phTRILL (1 << phFLAGBIT_TRILL) -#define phPALATAL (1 << phFLAGBIT_PALATAL) -#define phBRKAFTER (1 << phFLAGBIT_BRKAFTER) -#define phNONSYLLABIC (1 << phFLAGBIT_NONSYLLABIC) -#define phLONG (1 << phFLAGBIT_LONG) -#define phLENGTHENSTOP (1 << phFLAGBIT_LENGTHENSTOP) -#define phRHOTIC (1 << phFLAGBIT_RHOTIC) -#define phNOPAUSE (1 << phFLAGBIT_NOPAUSE) -#define phPREVOICE (1 << phFLAGBIT_PREVOICE) -#define phFLAG1 (1 << phFLAGBIT_FLAG1) -#define phFLAG2 (1 << phFLAGBIT_FLAG2) -#define phLOCAL (1 << phFLAGBIT_LOCAL) +#define phUNSTRESSED (1U << phFLAGBIT_UNSTRESSED) +#define phVOICELESS (1U << phFLAGBIT_VOICELESS) +#define phVOICED (1U << phFLAGBIT_VOICED) +#define phSIBILANT (1U << phFLAGBIT_SIBILANT) +#define phNOLINK (1U << phFLAGBIT_NOLINK) +#define phTRILL (1U << phFLAGBIT_TRILL) +#define phPALATAL (1U << phFLAGBIT_PALATAL) +#define phBRKAFTER (1U << phFLAGBIT_BRKAFTER) +#define phNONSYLLABIC (1U << phFLAGBIT_NONSYLLABIC) +#define phLONG (1U << phFLAGBIT_LONG) +#define phLENGTHENSTOP (1U << phFLAGBIT_LENGTHENSTOP) +#define phRHOTIC (1U << phFLAGBIT_RHOTIC) +#define phNOPAUSE (1U << phFLAGBIT_NOPAUSE) +#define phPREVOICE (1U << phFLAGBIT_PREVOICE) +#define phFLAG1 (1U << phFLAGBIT_FLAG1) +#define phFLAG2 (1U << phFLAGBIT_FLAG2) +#define phLOCAL (1U << phFLAGBIT_LOCAL) // fixed phoneme code numbers, these can be used from the program code #define phonCONTROL 1