mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-11-16 02:09:11 +00:00
Fix GCC -Wunused-but-set-variable warnings.
This commit is contained in:
@@ -2978,7 +2978,6 @@ espeak_ng_STATUS espeak_ng_CompileIntonation(FILE *log)
|
||||
char *p;
|
||||
char c;
|
||||
int keyword;
|
||||
int compiling_tune = 0;
|
||||
int n_tune_names = 0;
|
||||
int done_split;
|
||||
int done_onset = 0;
|
||||
@@ -3068,7 +3067,6 @@ espeak_ng_STATUS espeak_ng_CompileIntonation(FILE *log)
|
||||
switch (keyword)
|
||||
{
|
||||
case kTUNE:
|
||||
compiling_tune = 1;
|
||||
done_split = 0;
|
||||
|
||||
memcpy(&new_tune, &default_tune, sizeof(TUNE));
|
||||
@@ -3093,8 +3091,6 @@ espeak_ng_STATUS espeak_ng_CompileIntonation(FILE *log)
|
||||
error("Bad tune name: '%s;", new_tune.name);
|
||||
break;
|
||||
case kENDTUNE:
|
||||
compiling_tune = 0;
|
||||
|
||||
if (done_onset == 0) {
|
||||
new_tune.unstr_start[0] = new_tune.unstr_start[1];
|
||||
new_tune.unstr_end[0] = new_tune.unstr_end[1];
|
||||
|
||||
+33
-32
@@ -274,7 +274,7 @@ static unsigned int get_used_mem()
|
||||
return used;
|
||||
}
|
||||
|
||||
static void start_stream()
|
||||
static PaError start_stream()
|
||||
{
|
||||
PaError err;
|
||||
|
||||
@@ -290,6 +290,8 @@ static void start_stream()
|
||||
err = Pa_StartStream(pa_stream);
|
||||
}
|
||||
#endif
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/* This routine will be called by the PortAudio engine when audio is needed.
|
||||
@@ -404,41 +406,40 @@ static int wave_open_sound()
|
||||
#if USE_PORTAUDIO == 18
|
||||
PaDeviceID playbackDevice = Pa_GetDefaultOutputDeviceID();
|
||||
|
||||
PaError err = Pa_OpenStream(&pa_stream,
|
||||
// capture parameters
|
||||
paNoDevice,
|
||||
0,
|
||||
paInt16,
|
||||
NULL,
|
||||
// playback parameters
|
||||
playbackDevice,
|
||||
out_channels,
|
||||
paInt16,
|
||||
NULL,
|
||||
// general parameters
|
||||
wave_samplerate, FRAMES_PER_BUFFER, 0,
|
||||
paNoFlag,
|
||||
pa_callback, (void *)userdata);
|
||||
err = Pa_OpenStream(&pa_stream,
|
||||
// capture parameters
|
||||
paNoDevice,
|
||||
0,
|
||||
paInt16,
|
||||
NULL,
|
||||
// playback parameters
|
||||
playbackDevice,
|
||||
out_channels,
|
||||
paInt16,
|
||||
NULL,
|
||||
// general parameters
|
||||
wave_samplerate, FRAMES_PER_BUFFER, 0,
|
||||
paNoFlag,
|
||||
pa_callback, (void *)userdata);
|
||||
|
||||
if (err == paInvalidChannelCount) {
|
||||
// failed to open with mono, try stereo
|
||||
out_channels = 2;
|
||||
PaError err = Pa_OpenStream(&pa_stream,
|
||||
// capture parameters
|
||||
paNoDevice,
|
||||
0,
|
||||
paInt16,
|
||||
NULL,
|
||||
// playback parameters
|
||||
playbackDevice,
|
||||
out_channels,
|
||||
paInt16,
|
||||
NULL,
|
||||
// general parameters
|
||||
wave_samplerate, FRAMES_PER_BUFFER, 0,
|
||||
paNoFlag,
|
||||
pa_callback, (void *)userdata);
|
||||
err = 0; // avoid warning
|
||||
err = Pa_OpenStream(&pa_stream,
|
||||
// capture parameters
|
||||
paNoDevice,
|
||||
0,
|
||||
paInt16,
|
||||
NULL,
|
||||
// playback parameters
|
||||
playbackDevice,
|
||||
out_channels,
|
||||
paInt16,
|
||||
NULL,
|
||||
// general parameters
|
||||
wave_samplerate, FRAMES_PER_BUFFER, 0,
|
||||
paNoFlag,
|
||||
pa_callback, (void *)userdata);
|
||||
}
|
||||
mInCallbackFinishedState = false; // v18 only
|
||||
#else
|
||||
|
||||
@@ -602,14 +602,13 @@ int wave_is_busy(void *theHandler)
|
||||
|
||||
void wave_terminate()
|
||||
{
|
||||
int a_status;
|
||||
pthread_mutex_t *a_mutex = NULL;
|
||||
a_mutex = &pulse_mutex;
|
||||
a_status = pthread_mutex_lock(a_mutex);
|
||||
pthread_mutex_lock(a_mutex);
|
||||
|
||||
pulse_close();
|
||||
|
||||
a_status = pthread_mutex_unlock(a_mutex);
|
||||
pthread_mutex_unlock(a_mutex);
|
||||
pthread_mutex_destroy(a_mutex);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user