comparison src/audio/arts/SDL_artsaudio.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
150 return available; 150 return available;
151 } 151 }
152 152
153 static void Audio_DeleteDevice(SDL_AudioDevice *device) 153 static void Audio_DeleteDevice(SDL_AudioDevice *device)
154 { 154 {
155 free(device->hidden); 155 SDL_free(device->hidden);
156 free(device); 156 SDL_free(device);
157 UnloadARTSLibrary(); 157 UnloadARTSLibrary();
158 } 158 }
159 159
160 static SDL_AudioDevice *Audio_CreateDevice(int devindex) 160 static SDL_AudioDevice *Audio_CreateDevice(int devindex)
161 { 161 {
162 SDL_AudioDevice *this; 162 SDL_AudioDevice *this;
163 163
164 /* Initialize all variables that we clean on shutdown */ 164 /* Initialize all variables that we clean on shutdown */
165 LoadARTSLibrary(); 165 LoadARTSLibrary();
166 this = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice)); 166 this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
167 if ( this ) { 167 if ( this ) {
168 memset(this, 0, (sizeof *this)); 168 SDL_memset(this, 0, (sizeof *this));
169 this->hidden = (struct SDL_PrivateAudioData *) 169 this->hidden = (struct SDL_PrivateAudioData *)
170 malloc((sizeof *this->hidden)); 170 SDL_malloc((sizeof *this->hidden));
171 } 171 }
172 if ( (this == NULL) || (this->hidden == NULL) ) { 172 if ( (this == NULL) || (this->hidden == NULL) ) {
173 SDL_OutOfMemory(); 173 SDL_OutOfMemory();
174 if ( this ) { 174 if ( this ) {
175 free(this); 175 SDL_free(this);
176 } 176 }
177 return(0); 177 return(0);
178 } 178 }
179 memset(this->hidden, 0, (sizeof *this->hidden)); 179 SDL_memset(this->hidden, 0, (sizeof *this->hidden));
180 stream = 0; 180 stream = 0;
181 181
182 /* Set the function pointers */ 182 /* Set the function pointers */
183 this->OpenAudio = ARTSC_OpenAudio; 183 this->OpenAudio = ARTSC_OpenAudio;
184 this->WaitAudio = ARTSC_WaitAudio; 184 this->WaitAudio = ARTSC_WaitAudio;
329 mixlen = spec->size; 329 mixlen = spec->size;
330 mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen); 330 mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
331 if ( mixbuf == NULL ) { 331 if ( mixbuf == NULL ) {
332 return(-1); 332 return(-1);
333 } 333 }
334 memset(mixbuf, spec->silence, spec->size); 334 SDL_memset(mixbuf, spec->silence, spec->size);
335 335
336 /* Get the parent process id (we're the parent of the audio thread) */ 336 /* Get the parent process id (we're the parent of the audio thread) */
337 parent = getpid(); 337 parent = getpid();
338 338
339 /* We're ready to rock and roll. :-) */ 339 /* We're ready to rock and roll. :-) */