Browse Source

Revert the gcc sign conversion warning fixes.

This reverts commits 0cc0300328 to
38d15f8f90.

The 0cc03003 commit breaks MBROLA voice support. As such, there
may be other breakages in those commits.
master
Reece H. Dunn 9 years ago
parent
commit
0ca520a4ec

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

@@ -36,7 +36,7 @@

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 size_t GetFileLength(const char *filename);
extern ESPEAK_NG_API int GetFileLength(const char *filename);

// This version of the command-line speak program uses the
// libespeak.so.1 library
@@ -112,9 +112,9 @@ static const char *help_text =

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

FILE *f_wavfile = NULL;
@@ -227,7 +227,7 @@ int OpenWavFile(char *path, int rate)

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

if ((f_wavfile == NULL) || (f_wavfile == stdout))
return;
@@ -282,7 +282,7 @@ static int SynthCallback(short *wav, int numsamples, espeak_EVENT *events)

if (numsamples > 0) {
samples_total += numsamples;
fwrite(wav, (size_t)(numsamples*2), 1, f_wavfile);
fwrite(wav, numsamples*2, 1, f_wavfile);
}
return 0;
}
@@ -343,13 +343,13 @@ int main(int argc, char **argv)

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

int volume = -1;
int speed = -1;
@@ -488,7 +488,7 @@ int main(int argc, char **argv)
strncpy0(wavefile, optarg2, sizeof(filename));
break;
case 'z': // remove pause from the end of a sentence
synth_flags &= (unsigned int)~espeakENDPAUSE;
synth_flags &= ~espeakENDPAUSE;
break;
case 0x100: // --stdin
flag_stdin = 1;
@@ -716,10 +716,11 @@ int main(int argc, char **argv)
}

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

if (flag_stdin == 2) {

+ 3
- 1
src/libespeak-ng/compilembrola.c View File

@@ -45,6 +45,7 @@ static unsigned int StringToWord(const char *string)
{
// Pack 4 characters into a word
int ix;
unsigned char c;
unsigned int word;

if (string == NULL)
@@ -53,7 +54,8 @@ static unsigned int StringToWord(const char *string)
word = 0;
for (ix = 0; ix < 4; ix++) {
if (string[ix] == 0) break;
word |= ((unsigned int)string[ix] << (ix*8));
c = string[ix];
word |= (c << (ix*8));
}
return word;
}

+ 2
- 2
src/libespeak-ng/event.c View File

@@ -493,12 +493,12 @@ void clock_gettime2(struct timespec *ts)
ts->tv_nsec = tv.tv_usec*1000;
}

void add_time_in_ms(struct timespec *ts, uint64_t time_in_ms)
void add_time_in_ms(struct timespec *ts, int time_in_ms)
{
if (!ts)
return;

uint64_t t_ns = (uint64_t)ts->tv_nsec + 1000000 * time_in_ms;
uint64_t t_ns = (uint64_t)ts->tv_nsec + 1000000 * (uint64_t)time_in_ms;
while (t_ns >= ONE_BILLION) {
ts->tv_sec += 1;
t_ns -= ONE_BILLION;

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

@@ -380,7 +380,7 @@ static int parwave(klatt_frame_ptr frame)
temp = (int)(out * wdata.amplitude * kt_globals.amp_gain0); // Convert back to integer

// mix with a recorded WAV if required for this phoneme
unsigned char c;
signed char c;
int sample;

if (wdata.mix_wavefile_ix < wdata.n_mix_wavefile) {

+ 3
- 4
src/libespeak-ng/spect.c View File

@@ -139,7 +139,7 @@ static void SpectFrameDestroy(SpectFrame *frame)
int LoadFrame(SpectFrame *frame, FILE *stream, int file_format_type)
{
short ix;
unsigned short x;
short x;
unsigned short *spect_data;

frame->time = read_double(stream);
@@ -275,8 +275,7 @@ static float GetFrameLength(SpectSeq *spect, int frame)

espeak_ng_STATUS LoadSpectSeq(SpectSeq *spect, const char *filename)
{
unsigned short n;
short temp;
short n, temp;
int ix;
uint32_t id1, id2, name_len;
int set_max_y = 0;
@@ -310,7 +309,7 @@ espeak_ng_STATUS LoadSpectSeq(SpectSeq *spect, const char *filename)
} else
spect->name = NULL;

fread(&n, sizeof(unsigned short), 1, stream);
fread(&n, sizeof(short), 1, stream);
fread(&spect->amplitude, sizeof(short), 1, stream);
fread(&spect->max_y, sizeof(short), 1, stream);
fread(&temp, sizeof(short), 1, stream); // unused

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

@@ -237,7 +237,7 @@ ESPEAK_NG_API espeak_ng_STATUS espeak_ng_InitializeOutput(espeak_ng_OUTPUT_MODE
return ENS_OK;
}

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


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

@@ -75,7 +75,7 @@ int LookupMnem(MNEM_TAB *table, const char *string);
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 size_t GetFileLength(const char *filename);
extern ESPEAK_NG_API int GetFileLength(const char *filename);
char *Alloc(int size);
void Free(void *ptr);


+ 3
- 3
src/libespeak-ng/synthesize.h View File

@@ -355,10 +355,10 @@ typedef struct {
} SOUND_ICON;

typedef struct {
unsigned int name;
int name;
unsigned int next_phoneme;
unsigned int mbr_name;
unsigned int mbr_name2;
int mbr_name;
int mbr_name2;
int percent; // percentage length of first component
int control;
} MBROLA_TAB;

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

@@ -55,7 +55,7 @@ extern void wave_set_callback_is_output_enabled(t_wave_callback *cb);

// general functions
extern void clock_gettime2(struct timespec *ts);
extern void add_time_in_ms(struct timespec *ts, uint64_t time_in_ms);
extern void add_time_in_ms(struct timespec *ts, int time_in_ms);

// for tests
extern void *wave_test_get_write_buffer();

Loading…
Cancel
Save