Browse Source

Fix gcc sign conversion warnings in espeak-ng.c.

master
Reece H. Dunn 9 years ago
parent
commit
0cc0300328
3 changed files with 15 additions and 16 deletions
  1. 13
    14
      src/espeak-ng.c
  2. 1
    1
      src/libespeak-ng/speech.c
  3. 1
    1
      src/libespeak-ng/speech.h

+ 13
- 14
src/espeak-ng.c View File



extern ESPEAK_NG_API void strncpy0(char *to, const char *from, int size); extern ESPEAK_NG_API void strncpy0(char *to, const char *from, int size);
extern ESPEAK_NG_API int utf8_in(int *c, const char *buf); extern ESPEAK_NG_API int utf8_in(int *c, const char *buf);
extern ESPEAK_NG_API int GetFileLength(const char *filename);
extern ESPEAK_NG_API size_t GetFileLength(const char *filename);


// This version of the command-line speak program uses the // This version of the command-line speak program uses the
// libespeak.so.1 library // libespeak.so.1 library


int samplerate; int samplerate;
int quiet = 0; int quiet = 0;
unsigned int samples_total = 0;
unsigned int samples_split = 0;
unsigned int samples_split_seconds = 0;
int samples_total = 0;
int samples_split = 0;
int samples_split_seconds = 0;
unsigned int wavefile_count = 0; unsigned int wavefile_count = 0;


FILE *f_wavfile = NULL; FILE *f_wavfile = NULL;


static void CloseWavFile() static void CloseWavFile()
{ {
unsigned int pos;
int pos;


if ((f_wavfile == NULL) || (f_wavfile == stdout)) if ((f_wavfile == NULL) || (f_wavfile == stdout))
return; return;


if (numsamples > 0) { if (numsamples > 0) {
samples_total += numsamples; samples_total += numsamples;
fwrite(wav, numsamples*2, 1, f_wavfile);
fwrite(wav, (size_t)(numsamples*2), 1, f_wavfile);
} }
return 0; return 0;
} }


int option_index = 0; int option_index = 0;
int c; int c;
int ix;
size_t ix;
char *optarg2; char *optarg2;
int value;
unsigned int value;
int flag_stdin = 0; int flag_stdin = 0;
int flag_compile = 0; int flag_compile = 0;
int filesize = 0;
int synth_flags = espeakCHARS_AUTO | espeakPHONEMES | espeakENDPAUSE;
size_t filesize = 0;
unsigned int synth_flags = espeakCHARS_AUTO | espeakPHONEMES | espeakENDPAUSE;


int volume = -1; int volume = -1;
int speed = -1; int speed = -1;
strncpy0(wavefile, optarg2, sizeof(filename)); strncpy0(wavefile, optarg2, sizeof(filename));
break; break;
case 'z': // remove pause from the end of a sentence case 'z': // remove pause from the end of a sentence
synth_flags &= ~espeakENDPAUSE;
synth_flags &= (unsigned int)~espeakENDPAUSE;
break; break;
case 0x100: // --stdin case 0x100: // --stdin
flag_stdin = 1; flag_stdin = 1;
} }


if (p_text != NULL) { if (p_text != NULL) {
int size;
size = strlen(p_text);
size_t size = strlen(p_text);
espeak_Synth(p_text, size+1, 0, POS_CHARACTER, 0, synth_flags, NULL, NULL); espeak_Synth(p_text, size+1, 0, POS_CHARACTER, 0, synth_flags, NULL, NULL);
} else if (flag_stdin) { } else if (flag_stdin) {
int max = 1000;
size_t max = 1000;
p_text = (char *)malloc(max); p_text = (char *)malloc(max);


if (flag_stdin == 2) { if (flag_stdin == 2) {

+ 1
- 1
src/libespeak-ng/speech.c View File

return ENS_OK; return ENS_OK;
} }


int GetFileLength(const char *filename)
size_t GetFileLength(const char *filename)
{ {
struct stat statbuf; struct stat statbuf;



+ 1
- 1
src/libespeak-ng/speech.h View File

extern char path_home[N_PATH_HOME]; // this is the espeak-data directory extern char path_home[N_PATH_HOME]; // this is the espeak-data directory


extern ESPEAK_NG_API void strncpy0(char *to, const char *from, int size); extern ESPEAK_NG_API void strncpy0(char *to, const char *from, int size);
extern ESPEAK_NG_API int GetFileLength(const char *filename);
extern ESPEAK_NG_API size_t GetFileLength(const char *filename);
char *Alloc(int size); char *Alloc(int size);
void Free(void *ptr); void Free(void *ptr);



Loading…
Cancel
Save