From f2bb4827820a1f40e88d90490d36916be327e3ec Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 29 Jan 2017 10:29:48 +0000 Subject: [PATCH] Use OPCODE for the RETURN and CONTINUE opcodes. --- src/libespeak-ng/compiledata.c | 6 +++--- src/libespeak-ng/synthdata.c | 8 ++++---- src/libespeak-ng/synthesize.h | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 8fbd5960..5a58ce6a 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -2234,11 +2234,11 @@ int CompilePhoneme(int compile_phoneme) CompileToneSpec(); break; case kCONTINUE: - *prog_out++ = i_CONTINUE; + *prog_out++ = OPCODE_CONTINUE; DecThenCount(); break; case kRETURN: - *prog_out++ = i_RETURN; + *prog_out++ = OPCODE_RETURN; DecThenCount(); break; case kINCLUDE: @@ -2251,7 +2251,7 @@ int CompilePhoneme(int compile_phoneme) if (if_level > 0) error("Missing ENDIF"); if ((prog_out > prog_buf) && (if_stack[0].returned == 0)) - *prog_out++ = i_RETURN; + *prog_out++ = OPCODE_RETURN; break; } break; diff --git a/src/libespeak-ng/synthdata.c b/src/libespeak-ng/synthdata.c index ad76d0e9..f0bd022b 100644 --- a/src/libespeak-ng/synthdata.c +++ b/src/libespeak-ng/synthdata.c @@ -758,7 +758,7 @@ int NumInstnWords(USHORT *prog) // This instruction is followed by addWav(), 2 more words return 4; } - if (instn2 == i_CONTINUE) + if (instn2 == OPCODE_CONTINUE) return 3; return 2; } @@ -815,10 +815,10 @@ void InterpretPhoneme(Translator *tr, int control, PHONEME_LIST *plist, PHONEME_ // instructions with no operand switch (data) { - case i_RETURN: + case OPCODE_RETURN: end_flag = 1; break; - case i_CONTINUE: + case OPCODE_CONTINUE: break; default: InvalidInstn(ph, instn); @@ -956,7 +956,7 @@ void InterpretPhoneme(Translator *tr, int control, PHONEME_LIST *plist, PHONEME_ param_sc = phdata->sound_param[instn2] = (instn >> 4) & 0xff; prog++; - if (prog[1] != i_CONTINUE) { + if (prog[1] != OPCODE_CONTINUE) { if (instn2 < 2) { // FMT() and WAV() imply Return end_flag = 1; diff --git a/src/libespeak-ng/synthesize.h b/src/libespeak-ng/synthesize.h index e28e3d6d..5cbffeb0 100644 --- a/src/libespeak-ng/synthesize.h +++ b/src/libespeak-ng/synthesize.h @@ -268,9 +268,8 @@ typedef struct { // instructions -#define i_RETURN 0x0001 -#define i_CONTINUE 0x0002 -#define i_NOT 0x0003 +#define OPCODE_RETURN 0x0001 +#define OPCODE_CONTINUE 0x0002 // Group 0 instrcutions with 8 bit operand. These values go into bits 8-15 of the instruction #define i_CHANGE_PHONEME 0x01 @@ -292,6 +291,7 @@ typedef struct { // conditions and jumps #define i_CONDITION 0x2000 #define i_OR 0x1000 // added to i_CONDITION +#define i_NOT 0x0003 #define i_JUMP 0x6000 #define i_JUMP_FALSE 0x6800