Fixed some things to use SDL C runtime functions. SDL-ryan-multiple-audio-device
authorRyan C. Gordon <icculus@icculus.org>
Sat, 07 Oct 2006 19:56:47 +0000
branchSDL-ryan-multiple-audio-device
changeset 383029e83f221c62
parent 3829 d3171647e661
child 3831 7df0d3efe682
Fixed some things to use SDL C runtime functions.
src/audio/baudio/SDL_beaudio.cc
src/audio/macosx/SDL_coreaudio.c
src/audio/macrom/SDL_romaudio.c
src/audio/mme/SDL_mmeaudio.c
     1.1 --- a/src/audio/baudio/SDL_beaudio.cc	Sat Oct 07 19:53:48 2006 +0000
     1.2 +++ b/src/audio/baudio/SDL_beaudio.cc	Sat Oct 07 19:56:47 2006 +0000
     1.3 @@ -117,7 +117,7 @@
     1.4      }
     1.5  
     1.6      /* Parse the audio format and fill the Be raw audio format */
     1.7 -    memset(&format, '\0', sizeof(media_raw_audio_format));
     1.8 +    SDL_memset(&format, '\0', sizeof(media_raw_audio_format));
     1.9      format.byte_order = B_MEDIA_LITTLE_ENDIAN;
    1.10      format.frame_rate = (float) this->spec.freq;
    1.11      format.channel_count = this->spec.channels;  /* !!! FIXME: support > 2? */
     2.1 --- a/src/audio/macosx/SDL_coreaudio.c	Sat Oct 07 19:53:48 2006 +0000
     2.2 +++ b/src/audio/macosx/SDL_coreaudio.c	Sat Oct 07 19:56:47 2006 +0000
     2.3 @@ -333,7 +333,7 @@
     2.4          result = AudioOutputUnitStop(this->hidden->audioUnit);
     2.5  
     2.6          /* Remove the input callback */
     2.7 -        memset(&callback, '\0', sizeof (AURenderCallbackStruct));
     2.8 +        SDL_memset(&callback, '\0', sizeof (AURenderCallbackStruct));
     2.9          result = AudioUnitSetProperty(this->hidden->audioUnit,
    2.10                                        kAudioUnitProperty_SetRenderCallback,
    2.11                                        scope, bus, &callback, sizeof (callback));
    2.12 @@ -425,7 +425,7 @@
    2.13          return 0;
    2.14      }
    2.15  
    2.16 -    memset(&desc, '\0', sizeof(ComponentDescription));
    2.17 +    SDL_memset(&desc, '\0', sizeof(ComponentDescription));
    2.18      desc.componentType = kAudioUnitType_Output;
    2.19      desc.componentSubType = kAudioUnitSubType_HALOutput;
    2.20      desc.componentManufacturer = kAudioUnitManufacturer_Apple;
    2.21 @@ -470,7 +470,7 @@
    2.22      CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)");
    2.23  
    2.24      /* Set the audio callback */
    2.25 -    memset(&callback, '\0', sizeof (AURenderCallbackStruct));
    2.26 +    SDL_memset(&callback, '\0', sizeof (AURenderCallbackStruct));
    2.27      callback.inputProc = ((iscapture) ? inputCallback : outputCallback);
    2.28      callback.inputProcRefCon = this;
    2.29      result = AudioUnitSetProperty(this->hidden->audioUnit,
    2.30 @@ -514,7 +514,7 @@
    2.31      SDL_memset(this->hidden, 0, (sizeof *this->hidden));
    2.32  
    2.33      /* Setup a AudioStreamBasicDescription with the requested format */
    2.34 -    memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription));
    2.35 +    SDL_memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription));
    2.36      strdesc.mFormatID = kAudioFormatLinearPCM;
    2.37      strdesc.mFormatFlags = kLinearPCMFormatFlagIsPacked;
    2.38      strdesc.mChannelsPerFrame = this->spec.channels;
     3.1 --- a/src/audio/macrom/SDL_romaudio.c	Sat Oct 07 19:53:48 2006 +0000
     3.2 +++ b/src/audio/macrom/SDL_romaudio.c	Sat Oct 07 19:56:47 2006 +0000
     3.3 @@ -145,7 +145,7 @@
     3.4      cmd.param2 = (long) &header;
     3.5      SndDoCommand(chan, &cmd, 0);
     3.6  
     3.7 -    memset(buffer[fill_me], 0, audio->spec.size);
     3.8 +    SDL_memset(buffer[fill_me], 0, audio->spec.size);
     3.9  
    3.10      /*
    3.11       * if audio device isn't locked, mix the next buffer to be queued in
    3.12 @@ -203,7 +203,7 @@
    3.13      SDL_CalculateAudioSpec(&this->spec);
    3.14  
    3.15      /* initialize bufferCmd header */
    3.16 -    memset(&header, 0, sizeof(header));
    3.17 +    SDL_memset(&header, 0, sizeof(header));
    3.18      callback = (SndCallBackUPP) NewSndCallBackUPP(callBackProc);
    3.19      sample_bits = spec->size / spec->samples / spec->channels * 8;
    3.20  
    3.21 @@ -236,13 +236,13 @@
    3.22  
    3.23      /* allocate 2 buffers */
    3.24      for (i = 0; i < 2; i++) {
    3.25 -        buffer[i] = (UInt8 *) malloc(sizeof(UInt8) * spec->size);
    3.26 +        buffer[i] = (UInt8 *) SDL_malloc(sizeof(UInt8) * spec->size);
    3.27          if (buffer[i] == NULL) {
    3.28              SNDMGR_CloseDevice(this);
    3.29              SDL_OutOfMemory();
    3.30              return 0;
    3.31          }
    3.32 -        memset(buffer[i], 0, spec->size);
    3.33 +        SDL_memset(buffer[i], 0, spec->size);
    3.34      }
    3.35  
    3.36      /* Create the sound manager channel */
     4.1 --- a/src/audio/mme/SDL_mmeaudio.c	Sat Oct 07 19:53:48 2006 +0000
     4.2 +++ b/src/audio/mme/SDL_mmeaudio.c	Sat Oct 07 19:56:47 2006 +0000
     4.3 @@ -84,7 +84,7 @@
     4.4          return 0;
     4.5      }
     4.6  
     4.7 -    memset(this->hidden->shm, '\0', sizeof (*this->hidden->shm));
     4.8 +    SDL_memset(this->hidden->shm, '\0', sizeof (*this->hidden->shm));
     4.9      this->hidden->shm->sound = 0;
    4.10      this->hidden->shm->wFmt.wf.wFormatTag = WAVE_FORMAT_PCM;
    4.11