Browse Source

code cleanup: move lookupwchar2 to readclause.c

It's used only in readclause.c

TODO: Rename so the meaning of the function is easier to understand.
master
Juho Hiltunen 2 years ago
parent
commit
a161118976
3 changed files with 15 additions and 15 deletions
  1. 15
    0
      src/libespeak-ng/readclause.c
  2. 0
    14
      src/libespeak-ng/translate.c
  3. 0
    1
      src/libespeak-ng/translate.h

+ 15
- 0
src/libespeak-ng/readclause.c View File

memset(p, ' ', utf8_in(&c, p)); memset(p, ' ', utf8_in(&c, p));
} }


static int lookupwchar2(const unsigned short *list, int c)
{
// Replace character c by another character.
// Returns 0 = not found, 1 = delete character

int ix;

for (ix = 0; list[ix] != 0; ix += 2) {
if (list[ix] == c)
return list[ix+1];
}
return 0;
}


int ReadClause(Translator *tr, char *buf, short *charix, int *charix_top, int n_buf, int *tone_type, char *voice_change) int ReadClause(Translator *tr, char *buf, short *charix, int *charix_top, int n_buf, int *tone_type, char *voice_change)
{ {
/* Find the end of the current clause. /* Find the end of the current clause.

+ 0
- 14
src/libespeak-ng/translate.c View File

return 0; return 0;
} }


int lookupwchar2(const unsigned short *list, int c)
{
// Replace character c by another character.
// Returns 0 = not found, 1 = delete character

int ix;

for (ix = 0; list[ix] != 0; ix += 2) {
if (list[ix] == c)
return list[ix+1];
}
return 0;
}

int IsBracket(int c) int IsBracket(int c)
{ {
if ((c >= 0x2014) && (c <= 0x201f)) if ((c >= 0x2014) && (c <= 0x201f))

+ 0
- 1
src/libespeak-ng/translate.h View File

int utf8_nbytes(const char *buf); int utf8_nbytes(const char *buf);


int lookupwchar(const unsigned short *list, int c); int lookupwchar(const unsigned short *list, int c);
int lookupwchar2(const unsigned short *list, int c);
char *strchr_w(const char *s, int c); char *strchr_w(const char *s, int c);
int IsBracket(int c); int IsBracket(int c);
void InitNamedata(void); void InitNamedata(void);

Loading…
Cancel
Save