test: fix shadowing variables

This commit is contained in:
Christian Rauch
2021-03-26 22:52:30 +00:00
committed by Sam Lantinga
parent b972258d56
commit 570768f627
7 changed files with 18 additions and 19 deletions

View File

@@ -33,20 +33,20 @@ callback_data cbd[64];
void SDLCALL
play_through_once(void *arg, Uint8 * stream, int len)
{
callback_data *cbd = (callback_data *) arg;
Uint8 *waveptr = sound + cbd->soundpos;
int waveleft = soundlen - cbd->soundpos;
callback_data *cbdata = (callback_data *) arg;
Uint8 *waveptr = sound + cbdata->soundpos;
int waveleft = soundlen - cbdata->soundpos;
int cpy = len;
if (cpy > waveleft)
cpy = waveleft;
SDL_memcpy(stream, waveptr, cpy);
len -= cpy;
cbd->soundpos += cpy;
cbdata->soundpos += cpy;
if (len > 0) {
stream += cpy;
SDL_memset(stream, spec.silence, len);
SDL_AtomicSet(&cbd->done, 1);
SDL_AtomicSet(&cbdata->done, 1);
}
}