From 725bdda56413a4e1fde98dad9c4117e5d3c3a5af Mon Sep 17 00:00:00 2001 From: Juho Hiltunen Date: Thu, 23 Jul 2020 14:22:26 +0300 Subject: [PATCH] code cleanup: remove unused variables this_ph_data, N_WAV_BUF, option.device, harm_sqrt_n, max_hval, next_pause --- src/libespeak-ng/speech.c | 2 -- src/libespeak-ng/synthdata.c | 2 -- src/libespeak-ng/synthesize.c | 8 -------- src/libespeak-ng/wavegen.c | 7 ------- 4 files changed, 19 deletions(-) diff --git a/src/libespeak-ng/speech.c b/src/libespeak-ng/speech.c index 169e9a9e..c92c2cbf 100644 --- a/src/libespeak-ng/speech.c +++ b/src/libespeak-ng/speech.c @@ -73,7 +73,6 @@ long count_samples; struct audio_object *my_audio = NULL; #endif -static const char *option_device = NULL; static unsigned int my_unique_identifier = 0; static void *my_user_data = NULL; static espeak_ng_OUTPUT_MODE my_mode = ENOUTPUT_MODE_SYNCHRONOUS; @@ -267,7 +266,6 @@ static int check_data_path(const char *path, int allow_directory) ESPEAK_NG_API espeak_ng_STATUS espeak_ng_InitializeOutput(espeak_ng_OUTPUT_MODE output_mode, int buffer_length, const char *device) { - option_device = device; my_mode = output_mode; out_samplerate = 0; diff --git a/src/libespeak-ng/synthdata.c b/src/libespeak-ng/synthdata.c index 32983f0a..2e9ba5fb 100644 --- a/src/libespeak-ng/synthdata.c +++ b/src/libespeak-ng/synthdata.c @@ -421,8 +421,6 @@ void LoadConfig(void) fclose(f); } -PHONEME_DATA this_ph_data; - static void InvalidInstn(PHONEME_TAB *ph, int instn) { fprintf(stderr, "Invalid instruction %.4x for phoneme '%s'\n", instn, WordToString(ph->mnemonic)); diff --git a/src/libespeak-ng/synthesize.c b/src/libespeak-ng/synthesize.c index 9f02a90e..5fc3a42e 100644 --- a/src/libespeak-ng/synthesize.c +++ b/src/libespeak-ng/synthesize.c @@ -71,12 +71,8 @@ SOUND_ICON soundicon_tab[N_SOUNDICON_TAB]; #define RMS_GLOTTAL1 35 // vowel before glottal stop #define RMS_START 28 // 28 - #define VOWEL_FRONT_LENGTH 50 -// a dummy phoneme_list entry which looks like a pause -static PHONEME_LIST next_pause; - const char *WordToString(unsigned int word) { // Convert a phoneme mnemonic word into a string @@ -95,10 +91,6 @@ void SynthesizeInit() last_amp_cmd = 0; last_frame = NULL; syllable_centre = -1; - - // initialise next_pause, a dummy phoneme_list entry - next_pause.type = phPAUSE; - next_pause.newword = 0; } static void EndAmplitude(void) diff --git a/src/libespeak-ng/wavegen.c b/src/libespeak-ng/wavegen.c index 918d6a89..c54401db 100644 --- a/src/libespeak-ng/wavegen.c +++ b/src/libespeak-ng/wavegen.c @@ -46,8 +46,6 @@ #include "sintab.h" -#define N_WAV_BUF 10 - static void SetSynth(int length, int modn, frame_t *fr1, frame_t *fr2, voice_t *v); voice_t *wvoice = NULL; @@ -77,15 +75,12 @@ static int echo_length = 0; // period (in sample\) to ensure completion of echo static int voicing; static RESONATOR rbreath[N_PEAKS]; -static int harm_sqrt_n = 0; - #define N_LOWHARM 30 #define MAX_HARMONIC 400 // 400 * 50Hz = 20 kHz, more than enough static int harm_inc[N_LOWHARM]; // only for these harmonics do we interpolate amplitude between steps static int *harmspect; static int hswitch = 0; static int hspect[2][MAX_HARMONIC]; // 2 copies, we interpolate between then -static int max_hval = 0; static int nsamples = 0; // number to do static int modulation_type = 0; @@ -339,7 +334,6 @@ void WavegenInit(int rate, int wavemult_fact) samplecount = 0; nsamples = 0; wavephase = 0x7fffffff; - max_hval = 0; wdata.amplitude = 32; wdata.amplitude_fmt = 100; @@ -1172,7 +1166,6 @@ static void SetSynth(int length, int modn, frame_t *fr1, frame_t *fr2, voice_t * static int glottal_reduce_tab1[4] = { 0x30, 0x30, 0x40, 0x50 }; // vowel before [?], amp * 1/256 static int glottal_reduce_tab2[4] = { 0x90, 0xa0, 0xb0, 0xc0 }; // vowel after [?], amp * 1/256 - harm_sqrt_n = 0; end_wave = 1; // any additional information in the param1 ?