Browse Source

cleanup: reduce variable scopes in phonemelist.c

master
Juho Hiltunen 2 years ago
parent
commit
84609c27bd
1 changed files with 4 additions and 8 deletions
  1. 4
    8
      src/libespeak-ng/phonemelist.c

+ 4
- 8
src/libespeak-ng/phonemelist.c View File

int word_stress = 0; int word_stress = 0;
int current_phoneme_tab; int current_phoneme_tab;
int max_stress; int max_stress;
int voicing;
int regression; int regression;
int end_sourceix; int end_sourceix;
int alternative; int alternative;
int delete_count; int delete_count;
int word_start; int word_start;
bool inserted;
bool deleted;
PHONEME_DATA phdata; PHONEME_DATA phdata;
bool start_of_clause = true; bool start_of_clause = true;


// Regressive // Regressive
int type; int type;
bool stop_propagation = false; bool stop_propagation = false;
voicing = 0;
int voicing = 0;


for (j = n_ph_list2-1; j >= 0; j--) { for (j = n_ph_list2-1; j >= 0; j--) {
if (plist2[j].phcode == phonSWITCH) { if (plist2[j].phcode == phonSWITCH) {
for (j = 0; insert_ph || ((j < n_ph_list3) && (ix < N_PHONEME_LIST-3)); j++) { for (j = 0; insert_ph || ((j < n_ph_list3) && (ix < N_PHONEME_LIST-3)); j++) {
plist3 = &ph_list3[j]; plist3 = &ph_list3[j];


inserted = false;
deleted = false;
bool inserted = false;
bool deleted = false;
if (insert_ph != 0) { if (insert_ph != 0) {
// we have a (linking) phoneme which we need to insert here // we have a (linking) phoneme which we need to insert here
next = phoneme_tab[plist3->phcode]; // this phoneme, i.e. after the insert next = phoneme_tab[plist3->phcode]; // this phoneme, i.e. after the insert
} }


if ((ph->type == phVOWEL) && (deleted == false)) { if ((ph->type == phVOWEL) && (deleted == false)) {
PHONEME_LIST *p;

// Check for consecutive unstressed syllables, even across word boundaries. // Check for consecutive unstressed syllables, even across word boundaries.
// Do this after changing phonemes according to stress level. // Do this after changing phonemes according to stress level.
if (plist3->stresslevel <= 1) { if (plist3->stresslevel <= 1) {


if (tr->langopts.stress_flags & 0x08) { if (tr->langopts.stress_flags & 0x08) {
// change sequences of consecutive unstressed vowels in unstressed words to diminished stress (TEST) // change sequences of consecutive unstressed vowels in unstressed words to diminished stress (TEST)
PHONEME_LIST *p;
for (p = plist3+1; p->type != phPAUSE; p++) { for (p = plist3+1; p->type != phPAUSE; p++) {
if (p->type == phVOWEL) { if (p->type == phVOWEL) {
if (p->stresslevel <= 1) { if (p->stresslevel <= 1) {

Loading…
Cancel
Save