comparison src/audio/amigaos/SDL_ahiaudio.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 d02b552e5304
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
72 return ok; 72 return ok;
73 } 73 }
74 74
75 static void Audio_DeleteDevice(SDL_AudioDevice *device) 75 static void Audio_DeleteDevice(SDL_AudioDevice *device)
76 { 76 {
77 free(device->hidden); 77 SDL_free(device->hidden);
78 free(device); 78 SDL_free(device);
79 } 79 }
80 80
81 static SDL_AudioDevice *Audio_CreateDevice(int devindex) 81 static SDL_AudioDevice *Audio_CreateDevice(int devindex)
82 { 82 {
83 SDL_AudioDevice *this; 83 SDL_AudioDevice *this;
85 #ifndef NO_AMIGADEBUG 85 #ifndef NO_AMIGADEBUG
86 D(bug("AHI created...\n")); 86 D(bug("AHI created...\n"));
87 #endif 87 #endif
88 88
89 /* Initialize all variables that we clean on shutdown */ 89 /* Initialize all variables that we clean on shutdown */
90 this = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice)); 90 this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
91 if ( this ) { 91 if ( this ) {
92 memset(this, 0, (sizeof *this)); 92 SDL_memset(this, 0, (sizeof *this));
93 this->hidden = (struct SDL_PrivateAudioData *) 93 this->hidden = (struct SDL_PrivateAudioData *)
94 malloc((sizeof *this->hidden)); 94 SDL_malloc((sizeof *this->hidden));
95 } 95 }
96 if ( (this == NULL) || (this->hidden == NULL) ) { 96 if ( (this == NULL) || (this->hidden == NULL) ) {
97 SDL_OutOfMemory(); 97 SDL_OutOfMemory();
98 if ( this ) { 98 if ( this ) {
99 free(this); 99 SDL_free(this);
100 } 100 }
101 return(0); 101 return(0);
102 } 102 }
103 memset(this->hidden, 0, (sizeof *this->hidden)); 103 SDL_memset(this->hidden, 0, (sizeof *this->hidden));
104 104
105 /* Set the function pointers */ 105 /* Set the function pointers */
106 this->OpenAudio = AHI_OpenAudio; 106 this->OpenAudio = AHI_OpenAudio;
107 this->WaitAudio = AHI_WaitAudio; 107 this->WaitAudio = AHI_WaitAudio;
108 this->PlayAudio = AHI_PlayAudio; 108 this->PlayAudio = AHI_PlayAudio;
314 return(-1); 314 return(-1);
315 } 315 }
316 316
317 D(bug("Before audio_req memcpy\n")); 317 D(bug("Before audio_req memcpy\n"));
318 318
319 memcpy(audio_req[1],audio_req[0],sizeof(struct AHIRequest)); 319 SDL_memcpy(audio_req[1],audio_req[0],sizeof(struct AHIRequest));
320 320
321 if ( mixbuf[0] == NULL || mixbuf[1] == NULL ) { 321 if ( mixbuf[0] == NULL || mixbuf[1] == NULL ) {
322 SDL_OutOfMemory(); 322 SDL_OutOfMemory();
323 return(-1); 323 return(-1);
324 } 324 }
325 325
326 D(bug("Before mixbuf memset\n")); 326 D(bug("Before mixbuf memset\n"));
327 327
328 memset(mixbuf[0], spec->silence, spec->size); 328 SDL_memset(mixbuf[0], spec->silence, spec->size);
329 memset(mixbuf[1], spec->silence, spec->size); 329 SDL_memset(mixbuf[1], spec->silence, spec->size);
330 330
331 current_buffer=0; 331 current_buffer=0;
332 playing=0; 332 playing=0;
333 333
334 D(bug("AHI opened: freq:%ld mixbuf:%lx/%lx buflen:%ld bits:%ld channels:%ld\n",spec->freq,mixbuf[0],mixbuf[1],spec->size,this->hidden->bytespersample*8,spec->channels)); 334 D(bug("AHI opened: freq:%ld mixbuf:%lx/%lx buflen:%ld bits:%ld channels:%ld\n",spec->freq,mixbuf[0],mixbuf[1],spec->size,this->hidden->bytespersample*8,spec->channels));