Mercurial > sdl-ios-xcode
diff src/audio/macrom/SDL_romaudio.c @ 1336:3692456e7b0f
Use SDL_ prefixed versions of C library functions.
FIXME:
Change #include <stdlib.h> to #include "SDL_stdlib.h"
Change #include <string.h> to #include "SDL_string.h"
Make sure nothing else broke because of this...
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 07 Feb 2006 06:59:48 +0000 |
parents | c9b51268668f |
children | 604d73db6802 |
line wrap: on
line diff
--- a/src/audio/macrom/SDL_romaudio.c Mon Feb 06 17:28:04 2006 +0000 +++ b/src/audio/macrom/SDL_romaudio.c Tue Feb 07 06:59:48 2006 +0000 @@ -66,8 +66,8 @@ static void Audio_DeleteDevice(SDL_AudioDevice *device) { - free(device->hidden); - free(device); + SDL_free(device->hidden); + SDL_free(device); } static SDL_AudioDevice *Audio_CreateDevice(int devindex) @@ -75,20 +75,20 @@ SDL_AudioDevice *this; /* Initialize all variables that we clean on shutdown */ - this = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice)); + this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); if ( this ) { - memset(this, 0, (sizeof *this)); + SDL_memset(this, 0, (sizeof *this)); this->hidden = (struct SDL_PrivateAudioData *) - malloc((sizeof *this->hidden)); + SDL_malloc((sizeof *this->hidden)); } if ( (this == NULL) || (this->hidden == NULL) ) { SDL_OutOfMemory(); if ( this ) { - free(this); + SDL_free(this); } return(0); } - memset(this->hidden, 0, (sizeof *this->hidden)); + SDL_memset(this->hidden, 0, (sizeof *this->hidden)); /* Set the function pointers */ this->OpenAudio = Mac_OpenAudio; @@ -135,7 +135,7 @@ if ( audio->convert.len_cvt != audio->spec.size ) { /* Uh oh... probably crashes here */; } - memcpy(buffer, audio->convert.buf, audio->convert.len_cvt); + SDL_memcpy(buffer, audio->convert.buf, audio->convert.len_cvt); } else { audio->spec.callback(audio->spec.userdata, buffer, audio->spec.size); } @@ -267,7 +267,7 @@ } /* Create the sound manager channel */ - channel = (SndChannelPtr)malloc(sizeof(*channel)); + channel = (SndChannelPtr)SDL_malloc(sizeof(*channel)); if ( channel == NULL ) { SDL_OutOfMemory(); return(-1); @@ -281,7 +281,7 @@ channel->qLength = 128; if ( SndNewChannel(&channel, sampledSynth, initOptions, callback) != noErr ) { SDL_SetError("Unable to create audio channel"); - free(channel); + SDL_free(channel); channel = NULL; return(-1); } @@ -311,7 +311,7 @@ for ( i=0; i<2; ++i ) { if ( buffer[i] ) { - free(buffer[i]); + SDL_free(buffer[i]); buffer[i] = NULL; } } @@ -355,7 +355,7 @@ /* Uh oh... probably crashes here */; } #endif - memcpy(newbuf->dbSoundData, audio->convert.buf, + SDL_memcpy(newbuf->dbSoundData, audio->convert.buf, audio->convert.len_cvt); } else { audio->spec.callback(audio->spec.userdata, @@ -400,7 +400,7 @@ } for ( i=0; i<2; ++i ) { if ( audio_buf[i] ) { - free(audio_buf[i]); + SDL_free(audio_buf[i]); audio_buf[i] = NULL; } } @@ -435,7 +435,7 @@ SDL_CalculateAudioSpec(spec); /* initialize the double-back header */ - memset(&audio_dbh, 0, sizeof(audio_dbh)); + SDL_memset(&audio_dbh, 0, sizeof(audio_dbh)); doubleBackProc = NewSndDoubleBackProc (sndDoubleBackProc); sample_bits = spec->size / spec->samples / spec->channels * 8; @@ -467,7 +467,7 @@ } /* Create the sound manager channel */ - channel = (SndChannelPtr)malloc(sizeof(*channel)); + channel = (SndChannelPtr)SDL_malloc(sizeof(*channel)); if ( channel == NULL ) { SDL_OutOfMemory(); return(-1); @@ -481,7 +481,7 @@ channel->qLength = 128; if ( SndNewChannel(&channel, sampledSynth, initOptions, 0L) != noErr ) { SDL_SetError("Unable to create audio channel"); - free(channel); + SDL_free(channel); channel = NULL; return(-1); }