diff src/audio/ums/SDL_umsaudio.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/ums/SDL_umsaudio.c	Mon Feb 06 17:28:04 2006 +0000
+++ b/src/audio/ums/SDL_umsaudio.c	Tue Feb 07 06:59:48 2006 +0000
@@ -84,11 +84,11 @@
 
 static void Audio_DeleteDevice(_THIS)
 {
-    if(this->hidden->playbuf._buffer) free(this->hidden->playbuf._buffer);
-    if(this->hidden->fillbuf._buffer) free(this->hidden->fillbuf._buffer);
+    if(this->hidden->playbuf._buffer) SDL_free(this->hidden->playbuf._buffer);
+    if(this->hidden->fillbuf._buffer) SDL_free(this->hidden->fillbuf._buffer);
     _somFree( this->hidden->umsdev );
-    free(this->hidden);
-    free(this);
+    SDL_free(this->hidden);
+    SDL_free(this);
 }
 
 static SDL_AudioDevice *Audio_CreateDevice(int devindex)
@@ -99,19 +99,19 @@
      * Allocate and initialize management storage and private management
      * storage for this SDL-using library.
      */
-    this = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice));
+    this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
     if ( this ) {
-        memset(this, 0, (sizeof *this));
-        this->hidden = (struct SDL_PrivateAudioData *)malloc((sizeof *this->hidden));
+        SDL_memset(this, 0, (sizeof *this));
+        this->hidden = (struct SDL_PrivateAudioData *)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));
 #ifdef DEBUG_AUDIO
     fprintf(stderr, "Creating UMS Audio device\n");
 #endif
@@ -204,9 +204,9 @@
     while(samplesToWrite>0);
 
     SDL_LockAudio();
-    memcpy( &swpbuf,                &this->hidden->playbuf, sizeof(UMSAudioTypes_Buffer) );
-    memcpy( &this->hidden->playbuf, &this->hidden->fillbuf, sizeof(UMSAudioTypes_Buffer) );
-    memcpy( &this->hidden->fillbuf, &swpbuf,                sizeof(UMSAudioTypes_Buffer) );
+    SDL_memcpy( &swpbuf,                &this->hidden->playbuf, sizeof(UMSAudioTypes_Buffer) );
+    SDL_memcpy( &this->hidden->playbuf, &this->hidden->fillbuf, sizeof(UMSAudioTypes_Buffer) );
+    SDL_memcpy( &this->hidden->fillbuf, &swpbuf,                sizeof(UMSAudioTypes_Buffer) );
     SDL_UnlockAudio();
 
 #ifdef DEBUG_AUDIO
@@ -330,10 +330,10 @@
 
     this->hidden->playbuf._length  = 0;
     this->hidden->playbuf._maximum = spec->size;
-    this->hidden->playbuf._buffer  = (unsigned char*)malloc(spec->size);
+    this->hidden->playbuf._buffer  = (unsigned char*)SDL_malloc(spec->size);
     this->hidden->fillbuf._length  = 0;
     this->hidden->fillbuf._maximum = spec->size;
-    this->hidden->fillbuf._buffer  = (unsigned char*)malloc(spec->size);
+    this->hidden->fillbuf._buffer  = (unsigned char*)SDL_malloc(spec->size);
 
     rc = UADSetBitsPerSample(this,  bitsPerSample );
     rc = UADSetDMABufferSize(this,  frag_spec, &outBufSize );