diff --git a/src/libespeak-ng/common.c b/src/libespeak-ng/common.c index e9d2decc..679b9b89 100644 --- a/src/libespeak-ng/common.c +++ b/src/libespeak-ng/common.c @@ -176,6 +176,20 @@ int is_str_totally_null(const char* str, int size) { return (*str == 0 && memcmp(str, str+1, size-1) == 0); } +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++) { + c = fgetc(f) & 0xff; + acc += (c << (ix*8)); + } + return acc; +} + int towlower2(unsigned int c, Translator *translator) { // check for non-standard upper to lower case conversions diff --git a/src/libespeak-ng/common.h b/src/libespeak-ng/common.h index 2ad7007b..05e69a8f 100644 --- a/src/libespeak-ng/common.h +++ b/src/libespeak-ng/common.h @@ -27,6 +27,7 @@ extern ESPEAK_NG_API int GetFileLength(const char *filename); extern ESPEAK_NG_API void strncpy0(char *to, const char *from, int size); int is_str_totally_null(const char* str, int size); // Tests if all bytes of str up to size are null +int Read4Bytes(FILE *f); int towlower2(unsigned int c, Translator *translator); // Supports Turkish I ESPEAK_NG_API int utf8_in(int *c, const char *buf); diff --git a/src/libespeak-ng/compiledata.c b/src/libespeak-ng/compiledata.c index 1fef7602..9d829157 100644 --- a/src/libespeak-ng/compiledata.c +++ b/src/libespeak-ng/compiledata.c @@ -35,11 +35,10 @@ #include #include -#include "common.h" // for GetFileLength, strncpy0 +#include "common.h" // for GetFileLength, strncpy0, ... #include "error.h" // for create_file_error_context #include "mnemonics.h" // for LookupMnemName, MNEM_TAB #include "phoneme.h" // for PHONEME_TAB, PHONEME_TAB_LIST -#include "readclause.h" // for Read4Bytes #include "spect.h" // for SpectFrame, peak_t, SpectSeq #include "speech.h" // for path_home, GetFileLength #include "synthdata.h" // for LoadPhData diff --git a/src/libespeak-ng/readclause.c b/src/libespeak-ng/readclause.c index a8529c24..0793f2e7 100644 --- a/src/libespeak-ng/readclause.c +++ b/src/libespeak-ng/readclause.c @@ -271,20 +271,6 @@ static const char *LookupCharName(Translator *tr, int c, int only) return buf; } -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++) { - c = fgetc(f) & 0xff; - acc += (c << (ix*8)); - } - return acc; -} - static int AnnouncePunctuation(Translator *tr, int c1, int *c2_ptr, char *output, int *bufix, int end_clause) { // announce punctuation names diff --git a/src/libespeak-ng/readclause.h b/src/libespeak-ng/readclause.h index 2692ddfd..e55235ea 100644 --- a/src/libespeak-ng/readclause.h +++ b/src/libespeak-ng/readclause.h @@ -37,7 +37,6 @@ extern PARAM_STACK param_stack[]; int clause_type_from_codepoint(uint32_t c); int Eof(void); const char *WordToString2(unsigned int word); -int Read4Bytes(FILE *f); int AddNameData(const char *name, int wide); int ReadClause(Translator *tr, diff --git a/src/libespeak-ng/soundicon.c b/src/libespeak-ng/soundicon.c index abab72f7..25a3130b 100644 --- a/src/libespeak-ng/soundicon.c +++ b/src/libespeak-ng/soundicon.c @@ -38,7 +38,6 @@ #include "soundicon.h" #include "common.h" // for GetFileLength #include "error.h" // for create_file_error_context -#include "readclause.h" // for Read4Bytes #include "speech.h" // for path_home, PATHSEP #include "synthesize.h" // for samplerate diff --git a/src/libespeak-ng/synth_mbrola.c b/src/libespeak-ng/synth_mbrola.c index fab55884..bffefb47 100644 --- a/src/libespeak-ng/synth_mbrola.c +++ b/src/libespeak-ng/synth_mbrola.c @@ -34,7 +34,6 @@ #include "dictionary.h" #include "mbrola.h" -#include "readclause.h" #include "setlengths.h" #include "synthdata.h" #include "wavegen.h"