code cleanup: combine Wavegen() and Wavegen2().

Wavegen2() only had one if-statement and then called
    Wavegen(). Wavegen() was never called directly.
This commit is contained in:
Juho Hiltunen
2020-07-21 12:39:28 +03:00
parent 9232f1911e
commit 3b4cca4832
+7 -10
View File
@@ -51,6 +51,8 @@
#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;
FILE *f_log = NULL;
@@ -679,8 +681,11 @@ static int ApplyBreath(void)
return value;
}
static int Wavegen()
static int Wavegen(int length, int modulation, bool resume, frame_t *fr1, frame_t *fr2)
{
if (resume == false)
SetSynth(length, modulation, fr1, fr2, wvoice);
if (wvoice == NULL)
return 0;
@@ -1244,14 +1249,6 @@ static void SetSynth(int length, int modn, frame_t *fr1, frame_t *fr2, voice_t *
}
}
static int Wavegen2(int length, int modulation, bool resume, frame_t *fr1, frame_t *fr2)
{
if (resume == false)
SetSynth(length, modulation, fr1, fr2, wvoice);
return Wavegen();
}
void Write4Bytes(FILE *f, int value)
{
// Write 4 bytes to a file, least significant first
@@ -1338,7 +1335,7 @@ static int WavegenFill2()
wdata.n_mix_wavefile = 0; // ... and drop through to WCMD_SPECT case
case WCMD_SPECT:
echo_complete = echo_length;
result = Wavegen2(length & 0xffff, q[1] >> 16, resume, (frame_t *)q[2], (frame_t *)q[3]);
result = Wavegen(length & 0xffff, q[1] >> 16, resume, (frame_t *)q[2], (frame_t *)q[3]);
break;
#ifdef INCLUDE_KLATT
case WCMD_KLATT2: // as WCMD_SPECT but stop any concurrent wave file