Mercurial > sdl-ios-xcode
comparison src/audio/mint/SDL_mintaudio_gsxb.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 |
---|---|
83 | 83 |
84 /*--- Audio driver bootstrap functions ---*/ | 84 /*--- Audio driver bootstrap functions ---*/ |
85 | 85 |
86 static int Audio_Available(void) | 86 static int Audio_Available(void) |
87 { | 87 { |
88 const char *envr = getenv("SDL_AUDIODRIVER"); | 88 const char *envr = SDL_getenv("SDL_AUDIODRIVER"); |
89 | 89 |
90 /* Check if user asked a different audio driver */ | 90 /* Check if user asked a different audio driver */ |
91 if ((envr) && (strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) { | 91 if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) { |
92 DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n")); | 92 DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n")); |
93 return(0); | 93 return(0); |
94 } | 94 } |
95 | 95 |
96 /* Cookie _SND present ? if not, assume ST machine */ | 96 /* Cookie _SND present ? if not, assume ST machine */ |
125 return(1); | 125 return(1); |
126 } | 126 } |
127 | 127 |
128 static void Audio_DeleteDevice(SDL_AudioDevice *device) | 128 static void Audio_DeleteDevice(SDL_AudioDevice *device) |
129 { | 129 { |
130 free(device->hidden); | 130 SDL_free(device->hidden); |
131 free(device); | 131 SDL_free(device); |
132 } | 132 } |
133 | 133 |
134 static SDL_AudioDevice *Audio_CreateDevice(int devindex) | 134 static SDL_AudioDevice *Audio_CreateDevice(int devindex) |
135 { | 135 { |
136 SDL_AudioDevice *this; | 136 SDL_AudioDevice *this; |
137 | 137 |
138 /* Initialize all variables that we clean on shutdown */ | 138 /* Initialize all variables that we clean on shutdown */ |
139 this = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice)); | 139 this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice)); |
140 if ( this ) { | 140 if ( this ) { |
141 memset(this, 0, (sizeof *this)); | 141 SDL_memset(this, 0, (sizeof *this)); |
142 this->hidden = (struct SDL_PrivateAudioData *) | 142 this->hidden = (struct SDL_PrivateAudioData *) |
143 malloc((sizeof *this->hidden)); | 143 SDL_malloc((sizeof *this->hidden)); |
144 } | 144 } |
145 if ( (this == NULL) || (this->hidden == NULL) ) { | 145 if ( (this == NULL) || (this->hidden == NULL) ) { |
146 SDL_OutOfMemory(); | 146 SDL_OutOfMemory(); |
147 if ( this ) { | 147 if ( this ) { |
148 free(this); | 148 SDL_free(this); |
149 } | 149 } |
150 return(0); | 150 return(0); |
151 } | 151 } |
152 memset(this->hidden, 0, (sizeof *this->hidden)); | 152 SDL_memset(this->hidden, 0, (sizeof *this->hidden)); |
153 | 153 |
154 /* Set the function pointers */ | 154 /* Set the function pointers */ |
155 this->OpenAudio = Mint_OpenAudio; | 155 this->OpenAudio = Mint_OpenAudio; |
156 this->CloseAudio = Mint_CloseAudio; | 156 this->CloseAudio = Mint_CloseAudio; |
157 this->LockAudio = Mint_LockAudio; | 157 this->LockAudio = Mint_LockAudio; |
382 SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer"); | 382 SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer"); |
383 return (-1); | 383 return (-1); |
384 } | 384 } |
385 SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ; | 385 SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ; |
386 SDL_MintAudio_numbuf=0; | 386 SDL_MintAudio_numbuf=0; |
387 memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2); | 387 SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2); |
388 SDL_MintAudio_audiosize = spec->size; | 388 SDL_MintAudio_audiosize = spec->size; |
389 SDL_MintAudio_mutex = 0; | 389 SDL_MintAudio_mutex = 0; |
390 | 390 |
391 DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0])); | 391 DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0])); |
392 DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1])); | 392 DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1])); |