Browse Source

Remove the Error wrapper -- use error directly.

master
Reece H. Dunn 9 years ago
parent
commit
dfdb4e2391
1 changed files with 5 additions and 10 deletions
  1. 5
    10
      src/libespeak-ng/compiledata.c

+ 5
- 10
src/libespeak-ng/compiledata.c View File

va_end(args); va_end(args);
} }


static void Error(const char *string)
{
error("%s", string);
}

static FILE *fopen_log(FILE *f_log, const char *fname, const char *access) static FILE *fopen_log(FILE *f_log, const char *fname, const char *access)
{ {
// performs fopen, but produces error message to f_log if it fails // performs fopen, but produces error message to f_log if it fails
// create SpectSeq and import data // create SpectSeq and import data
spectseq = SpectSeqCreate(); spectseq = SpectSeqCreate();
if (spectseq == NULL) { if (spectseq == NULL) {
Error("Failed to create SpectSeq");
error("Failed to create SpectSeq");
return 0; return 0;
} }


PHONEME_TAB *p; PHONEME_TAB *p;


if (n_phoneme_tabs >= N_PHONEME_TABS-1) { if (n_phoneme_tabs >= N_PHONEME_TABS-1) {
Error("Too many phonemetables");
error("Too many phonemetables");
return; return;
} }
p = (PHONEME_TAB *)calloc(sizeof(PHONEME_TAB), N_PHONEME_TAB); p = (PHONEME_TAB *)calloc(sizeof(PHONEME_TAB), N_PHONEME_TAB);


if (p == NULL) { if (p == NULL) {
Error("Out of memory");
error("Out of memory");
return; return;
} }


break; break;
case kPHONEMESTART: case kPHONEMESTART:
if (n_phoneme_tabs == 0) { if (n_phoneme_tabs == 0) {
Error("phonemetable is missing");
error("phonemetable is missing");
return; return;
} }
CompilePhoneme(1); CompilePhoneme(1);
break; break;
default: default:
if (!feof(f_in)) if (!feof(f_in))
Error("Keyword 'phoneme' expected");
error("Keyword 'phoneme' expected");
break; break;
} }
} }

Loading…
Cancel
Save