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

@@ -132,7 +132,6 @@ int utf8_in2(int *c, const char *buf, int backwards)

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

// find the start of the next/previous character
@@ -155,6 +154,7 @@ int utf8_in2(int *c, const char *buf, int backwards)
n_bytes = 3;

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

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

Loading…
Cancel
Save