use SDL's functions version inplace of libc version

This commit is contained in:
Sylvain
2021-11-21 22:30:48 +01:00
committed by Sam Lantinga
parent 35b7ce1893
commit d31251b014
46 changed files with 114 additions and 124 deletions

View File

@@ -1753,7 +1753,7 @@ SDL_SilenceValueForFormat(const SDL_AudioFormat format)
{
switch (format) {
/* !!! FIXME: 0x80 isn't perfect for U16, but we can't fit 0x8000 in a
!!! FIXME: byte for memset() use. This is actually 0.1953 percent
!!! FIXME: byte for SDL_memset() use. This is actually 0.1953 percent
!!! FIXME: off from silence. Maybe just don't use U16. */
case AUDIO_U16LSB:
case AUDIO_U16MSB:

View File

@@ -779,7 +779,7 @@ add_device(const int iscapture, const char *name, void *hint, ALSA_Device **pSee
/* some strings have newlines, like "HDA NVidia, HDMI 0\nHDMI Audio Output".
just chop the extra lines off, this seems to get a reasonable device
name without extra details. */
if ((ptr = strchr(desc, '\n')) != NULL) {
if ((ptr = SDL_strchr(desc, '\n')) != NULL) {
*ptr = '\0';
}

View File

@@ -90,7 +90,7 @@ PSPAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
return SDL_SetError("Couldn't reserve hardware channel");
}
memset(this->hidden->rawbuf, 0, mixlen);
SDL_memset(this->hidden->rawbuf, 0, mixlen);
for (i = 0; i < NUM_BUFFERS; i++) {
this->hidden->mixbufs[i] = &this->hidden->rawbuf[i * this->spec.size];
}

View File

@@ -100,7 +100,7 @@ VITAAUD_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
sceAudioOutSetVolume(this->hidden->channel, SCE_AUDIO_VOLUME_FLAG_L_CH|SCE_AUDIO_VOLUME_FLAG_R_CH, vols);
memset(this->hidden->rawbuf, 0, mixlen);
SDL_memset(this->hidden->rawbuf, 0, mixlen);
for (i = 0; i < NUM_BUFFERS; i++) {
this->hidden->mixbufs[i] = &this->hidden->rawbuf[i * this->spec.size];
}