Browse Source

cleanup: reduce variable scopes in common.c

Contributes to #9.
master
Juho Hiltunen 2 years ago
parent
commit
80a632ed26
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/libespeak-ng/common.c

+ 2
- 2
src/libespeak-ng/common.c View File



int c1; int c1;
int n_bytes; int n_bytes;
int ix;
static const unsigned char mask[4] = { 0xff, 0x1f, 0x0f, 0x07 }; static const unsigned char mask[4] = { 0xff, 0x1f, 0x0f, 0x07 };


// find the start of the next/previous character // find the start of the next/previous character
n_bytes = 3; n_bytes = 3;


c1 &= mask[n_bytes]; c1 &= mask[n_bytes];
int ix;
for (ix = 0; ix < n_bytes; ix++) for (ix = 0; ix < n_bytes; ix++)
{ {
if (!*buf) if (!*buf)
{ {
// Read 4 bytes (least significant first) into a word // Read 4 bytes (least significant first) into a word
int ix; int ix;
unsigned char c;
int acc = 0; int acc = 0;


for (ix = 0; ix < 4; ix++) { for (ix = 0; ix < 4; ix++) {
unsigned char c;
c = fgetc(f) & 0xff; c = fgetc(f) & 0xff;
acc += (c << (ix*8)); acc += (c << (ix*8));
} }

Loading…
Cancel
Save