Mercurial > sdl-ios-xcode
comparison src/audio/mint/SDL_mintaudio_dma8.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 |
---|---|
79 | 79 |
80 /*--- Audio driver bootstrap functions ---*/ | 80 /*--- Audio driver bootstrap functions ---*/ |
81 | 81 |
82 static int Audio_Available(void) | 82 static int Audio_Available(void) |
83 { | 83 { |
84 const char *envr = getenv("SDL_AUDIODRIVER"); | 84 const char *envr = SDL_getenv("SDL_AUDIODRIVER"); |
85 | 85 |
86 /* Check if user asked a different audio driver */ | 86 /* Check if user asked a different audio driver */ |
87 if ((envr) && (strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) { | 87 if ((envr) && (SDL_strcmp(envr, MINT_AUDIO_DRIVER_NAME)!=0)) { |
88 DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n")); | 88 DEBUG_PRINT((DEBUG_NAME "user asked a different audio driver\n")); |
89 return 0; | 89 return 0; |
90 } | 90 } |
91 | 91 |
92 /* Cookie _MCH present ? if not, assume ST machine */ | 92 /* 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; |
345 SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer"); | 345 SDL_SetError("MINT_OpenAudio: Not enough memory for audio buffer"); |
346 return (-1); | 346 return (-1); |
347 } | 347 } |
348 SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ; | 348 SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + spec->size ; |
349 SDL_MintAudio_numbuf=0; | 349 SDL_MintAudio_numbuf=0; |
350 memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2); | 350 SDL_memset(SDL_MintAudio_audiobuf[0], spec->silence, spec->size *2); |
351 SDL_MintAudio_audiosize = spec->size; | 351 SDL_MintAudio_audiosize = spec->size; |
352 SDL_MintAudio_mutex = 0; | 352 SDL_MintAudio_mutex = 0; |
353 | 353 |
354 DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0])); | 354 DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n", SDL_MintAudio_audiobuf[0])); |
355 DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1])); | 355 DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n", SDL_MintAudio_audiobuf[1])); |