comparison src/audio/mint/SDL_mintaudio_stfa.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 856f76a099c7
children 604d73db6802
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
87 87
88 /*--- Audio driver bootstrap functions ---*/ 88 /*--- Audio driver bootstrap functions ---*/
89 89
90 static int Audio_Available(void) 90 static int Audio_Available(void)
91 { 91 {
92 const char *envr = getenv("SDL_AUDIODRIVER"); 92 const char *envr = SDL_getenv("SDL_AUDIODRIVER");
93 93
94 /* Check if user asked a different audio driver */ 94 /* Check if user asked a different audio driver */
95 if ((envr) && (strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) { 95 if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) {
96 DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n")); 96 DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n"));
97 return(0); 97 return(0);
98 } 98 }
99 99
100 /* Cookie _MCH present ? if not, assume ST machine */ 100 /* Cookie _MCH present ? if not, assume ST machine */
119 return(1); 119 return(1);
120 } 120 }
121 121
122 static void Audio_DeleteDevice(SDL_AudioDevice *device) 122 static void Audio_DeleteDevice(SDL_AudioDevice *device)
123 { 123 {
124 free(device->hidden); 124 SDL_free(device->hidden);
125 free(device); 125 SDL_free(device);
126 } 126 }
127 127
128 static SDL_AudioDevice *Audio_CreateDevice(int devindex) 128 static SDL_AudioDevice *Audio_CreateDevice(int devindex)
129 { 129 {
130 SDL_AudioDevice *this; 130 SDL_AudioDevice *this;
131 131
132 /* Initialize all variables that we clean on shutdown */ 132 /* Initialize all variables that we clean on shutdown */
133 this = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice)); 133 this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
134 if ( this ) { 134 if ( this ) {
135 memset(this, 0, (sizeof *this)); 135 SDL_memset(this, 0, (sizeof *this));
136 this->hidden = (struct SDL_PrivateAudioData *) 136 this->hidden = (struct SDL_PrivateAudioData *)
137 malloc((sizeof *this->hidden)); 137 SDL_malloc((sizeof *this->hidden));
138 } 138 }
139 if ( (this == NULL) || (this->hidden == NULL) ) { 139 if ( (this == NULL) || (this->hidden == NULL) ) {
140 SDL_OutOfMemory(); 140 SDL_OutOfMemory();
141 if ( this ) { 141 if ( this ) {
142 free(this); 142 SDL_free(this);
143 } 143 }
144 return(0); 144 return(0);
145 } 145 }
146 memset(this->hidden, 0, (sizeof *this->hidden)); 146 SDL_memset(this->hidden, 0, (sizeof *this->hidden));
147 147
148 /* Set the function pointers */ 148 /* Set the function pointers */
149 this->OpenAudio = Mint_OpenAudio; 149 this->OpenAudio = Mint_OpenAudio;
150 this->CloseAudio = Mint_CloseAudio; 150 this->CloseAudio = Mint_CloseAudio;
151 this->LockAudio = Mint_LockAudio; 151 this->LockAudio = Mint_LockAudio;
306 SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer"); 306 SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer");
307 return (-1); 307 return (-1);
308 } 308 }
309 SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ; 309 SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ;
310 SDL_MintAudio_numbuf=0; 310 SDL_MintAudio_numbuf=0;
311 memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2); 311 SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2);
312 SDL_MintAudio_audiosize = spec->size; 312 SDL_MintAudio_audiosize = spec->size;
313 SDL_MintAudio_mutex = 0; 313 SDL_MintAudio_mutex = 0;
314 314
315 DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0])); 315 DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0]));
316 DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1])); 316 DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1]));