comparison src/audio/dsp/SDL_dspaudio.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
80 return(available); 80 return(available);
81 } 81 }
82 82
83 static void Audio_DeleteDevice(SDL_AudioDevice *device) 83 static void Audio_DeleteDevice(SDL_AudioDevice *device)
84 { 84 {
85 free(device->hidden); 85 SDL_free(device->hidden);
86 free(device); 86 SDL_free(device);
87 } 87 }
88 88
89 static SDL_AudioDevice *Audio_CreateDevice(int devindex) 89 static SDL_AudioDevice *Audio_CreateDevice(int devindex)
90 { 90 {
91 SDL_AudioDevice *this; 91 SDL_AudioDevice *this;
92 92
93 /* Initialize all variables that we clean on shutdown */ 93 /* Initialize all variables that we clean on shutdown */
94 this = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice)); 94 this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
95 if ( this ) { 95 if ( this ) {
96 memset(this, 0, (sizeof *this)); 96 SDL_memset(this, 0, (sizeof *this));
97 this->hidden = (struct SDL_PrivateAudioData *) 97 this->hidden = (struct SDL_PrivateAudioData *)
98 malloc((sizeof *this->hidden)); 98 SDL_malloc((sizeof *this->hidden));
99 } 99 }
100 if ( (this == NULL) || (this->hidden == NULL) ) { 100 if ( (this == NULL) || (this->hidden == NULL) ) {
101 SDL_OutOfMemory(); 101 SDL_OutOfMemory();
102 if ( this ) { 102 if ( this ) {
103 free(this); 103 SDL_free(this);
104 } 104 }
105 return(0); 105 return(0);
106 } 106 }
107 memset(this->hidden, 0, (sizeof *this->hidden)); 107 SDL_memset(this->hidden, 0, (sizeof *this->hidden));
108 audio_fd = -1; 108 audio_fd = -1;
109 109
110 /* Set the function pointers */ 110 /* Set the function pointers */
111 this->OpenAudio = DSP_OpenAudio; 111 this->OpenAudio = DSP_OpenAudio;
112 this->WaitAudio = DSP_WaitAudio; 112 this->WaitAudio = DSP_WaitAudio;
320 mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen); 320 mixbuf = (Uint8 *)SDL_AllocAudioMem(mixlen);
321 if ( mixbuf == NULL ) { 321 if ( mixbuf == NULL ) {
322 DSP_CloseAudio(this); 322 DSP_CloseAudio(this);
323 return(-1); 323 return(-1);
324 } 324 }
325 memset(mixbuf, spec->silence, spec->size); 325 SDL_memset(mixbuf, spec->silence, spec->size);
326 326
327 /* Get the parent process id (we're the parent of the audio thread) */ 327 /* Get the parent process id (we're the parent of the audio thread) */
328 parent = getpid(); 328 parent = getpid();
329 329
330 /* We're ready to rock and roll. :-) */ 330 /* We're ready to rock and roll. :-) */