From 037bb614dc8e30f9b0bca9866aa90ab13936954c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 7 Oct 2006 19:56:47 +0000 Subject: [PATCH] Fixed some things to use SDL C runtime functions. --- src/audio/baudio/SDL_beaudio.cc | 2 +- src/audio/macosx/SDL_coreaudio.c | 8 ++++---- src/audio/macrom/SDL_romaudio.c | 8 ++++---- src/audio/mme/SDL_mmeaudio.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/audio/baudio/SDL_beaudio.cc b/src/audio/baudio/SDL_beaudio.cc index ff4fb1ff0..38270ce9c 100644 --- a/src/audio/baudio/SDL_beaudio.cc +++ b/src/audio/baudio/SDL_beaudio.cc @@ -117,7 +117,7 @@ BEAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) } /* Parse the audio format and fill the Be raw audio format */ - memset(&format, '\0', sizeof(media_raw_audio_format)); + SDL_memset(&format, '\0', sizeof(media_raw_audio_format)); format.byte_order = B_MEDIA_LITTLE_ENDIAN; format.frame_rate = (float) this->spec.freq; format.channel_count = this->spec.channels; /* !!! FIXME: support > 2? */ diff --git a/src/audio/macosx/SDL_coreaudio.c b/src/audio/macosx/SDL_coreaudio.c index 867fbcb6e..cf4c9aa42 100644 --- a/src/audio/macosx/SDL_coreaudio.c +++ b/src/audio/macosx/SDL_coreaudio.c @@ -333,7 +333,7 @@ COREAUDIO_CloseDevice(_THIS) result = AudioOutputUnitStop(this->hidden->audioUnit); /* Remove the input callback */ - memset(&callback, '\0', sizeof (AURenderCallbackStruct)); + SDL_memset(&callback, '\0', sizeof (AURenderCallbackStruct)); result = AudioUnitSetProperty(this->hidden->audioUnit, kAudioUnitProperty_SetRenderCallback, scope, bus, &callback, sizeof (callback)); @@ -425,7 +425,7 @@ prepare_audiounit(_THIS, const char *devname, int iscapture, return 0; } - memset(&desc, '\0', sizeof(ComponentDescription)); + SDL_memset(&desc, '\0', sizeof(ComponentDescription)); desc.componentType = kAudioUnitType_Output; desc.componentSubType = kAudioUnitSubType_HALOutput; desc.componentManufacturer = kAudioUnitManufacturer_Apple; @@ -470,7 +470,7 @@ prepare_audiounit(_THIS, const char *devname, int iscapture, CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)"); /* Set the audio callback */ - memset(&callback, '\0', sizeof (AURenderCallbackStruct)); + SDL_memset(&callback, '\0', sizeof (AURenderCallbackStruct)); callback.inputProc = ((iscapture) ? inputCallback : outputCallback); callback.inputProcRefCon = this; result = AudioUnitSetProperty(this->hidden->audioUnit, @@ -514,7 +514,7 @@ COREAUDIO_OpenDevice(_THIS, const char *devname, int iscapture) SDL_memset(this->hidden, 0, (sizeof *this->hidden)); /* Setup a AudioStreamBasicDescription with the requested format */ - memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription)); + SDL_memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription)); strdesc.mFormatID = kAudioFormatLinearPCM; strdesc.mFormatFlags = kLinearPCMFormatFlagIsPacked; strdesc.mChannelsPerFrame = this->spec.channels; diff --git a/src/audio/macrom/SDL_romaudio.c b/src/audio/macrom/SDL_romaudio.c index 33bb37042..95a2e31a3 100644 --- a/src/audio/macrom/SDL_romaudio.c +++ b/src/audio/macrom/SDL_romaudio.c @@ -145,7 +145,7 @@ callBackProc(SndChannel * chan, SndCommand * cmd_passed) cmd.param2 = (long) &header; SndDoCommand(chan, &cmd, 0); - memset(buffer[fill_me], 0, audio->spec.size); + SDL_memset(buffer[fill_me], 0, audio->spec.size); /* * if audio device isn't locked, mix the next buffer to be queued in @@ -203,7 +203,7 @@ SNDMGR_OpenDevice(_THIS, const char *devname, int iscapture) SDL_CalculateAudioSpec(&this->spec); /* initialize bufferCmd header */ - memset(&header, 0, sizeof(header)); + SDL_memset(&header, 0, sizeof(header)); callback = (SndCallBackUPP) NewSndCallBackUPP(callBackProc); sample_bits = spec->size / spec->samples / spec->channels * 8; @@ -236,13 +236,13 @@ SNDMGR_OpenDevice(_THIS, const char *devname, int iscapture) /* allocate 2 buffers */ for (i = 0; i < 2; i++) { - buffer[i] = (UInt8 *) malloc(sizeof(UInt8) * spec->size); + buffer[i] = (UInt8 *) SDL_malloc(sizeof(UInt8) * spec->size); if (buffer[i] == NULL) { SNDMGR_CloseDevice(this); SDL_OutOfMemory(); return 0; } - memset(buffer[i], 0, spec->size); + SDL_memset(buffer[i], 0, spec->size); } /* Create the sound manager channel */ diff --git a/src/audio/mme/SDL_mmeaudio.c b/src/audio/mme/SDL_mmeaudio.c index 2906ba115..3bdbb2389 100644 --- a/src/audio/mme/SDL_mmeaudio.c +++ b/src/audio/mme/SDL_mmeaudio.c @@ -84,7 +84,7 @@ MME_OpenDevice(_THIS, const char *devname, int iscapture) return 0; } - memset(this->hidden->shm, '\0', sizeof (*this->hidden->shm)); + SDL_memset(this->hidden->shm, '\0', sizeof (*this->hidden->shm)); this->hidden->shm->sound = 0; this->hidden->shm->wFmt.wf.wFormatTag = WAVE_FORMAT_PCM;