comparison src/audio/dc/SDL_dcaudio.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
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
58 return 1; 58 return 1;
59 } 59 }
60 60
61 static void DCAUD_DeleteDevice(SDL_AudioDevice *device) 61 static void DCAUD_DeleteDevice(SDL_AudioDevice *device)
62 { 62 {
63 free(device->hidden); 63 SDL_free(device->hidden);
64 free(device); 64 SDL_free(device);
65 } 65 }
66 66
67 static SDL_AudioDevice *DCAUD_CreateDevice(int devindex) 67 static SDL_AudioDevice *DCAUD_CreateDevice(int devindex)
68 { 68 {
69 SDL_AudioDevice *this; 69 SDL_AudioDevice *this;
70 70
71 /* Initialize all variables that we clean on shutdown */ 71 /* Initialize all variables that we clean on shutdown */
72 this = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice)); 72 this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
73 if ( this ) { 73 if ( this ) {
74 memset(this, 0, (sizeof *this)); 74 SDL_memset(this, 0, (sizeof *this));
75 this->hidden = (struct SDL_PrivateAudioData *) 75 this->hidden = (struct SDL_PrivateAudioData *)
76 malloc((sizeof *this->hidden)); 76 SDL_malloc((sizeof *this->hidden));
77 } 77 }
78 if ( (this == NULL) || (this->hidden == NULL) ) { 78 if ( (this == NULL) || (this->hidden == NULL) ) {
79 SDL_OutOfMemory(); 79 SDL_OutOfMemory();
80 if ( this ) { 80 if ( this ) {
81 free(this); 81 SDL_free(this);
82 } 82 }
83 return(0); 83 return(0);
84 } 84 }
85 memset(this->hidden, 0, (sizeof *this->hidden)); 85 SDL_memset(this->hidden, 0, (sizeof *this->hidden));
86 86
87 /* Set the function pointers */ 87 /* Set the function pointers */
88 this->OpenAudio = DCAUD_OpenAudio; 88 this->OpenAudio = DCAUD_OpenAudio;
89 this->WaitAudio = DCAUD_WaitAudio; 89 this->WaitAudio = DCAUD_WaitAudio;
90 this->PlayAudio = DCAUD_PlayAudio; 90 this->PlayAudio = DCAUD_PlayAudio;
227 this->hidden->mixlen = spec->size; 227 this->hidden->mixlen = spec->size;
228 this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen); 228 this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
229 if ( this->hidden->mixbuf == NULL ) { 229 if ( this->hidden->mixbuf == NULL ) {
230 return(-1); 230 return(-1);
231 } 231 }
232 memset(this->hidden->mixbuf, spec->silence, spec->size); 232 SDL_memset(this->hidden->mixbuf, spec->silence, spec->size);
233 this->hidden->leftpos = 0x11000; 233 this->hidden->leftpos = 0x11000;
234 this->hidden->rightpos = 0x11000+spec->size; 234 this->hidden->rightpos = 0x11000+spec->size;
235 this->hidden->playing = 0; 235 this->hidden->playing = 0;
236 this->hidden->nextbuf = 0; 236 this->hidden->nextbuf = 0;
237 237