comparison src/audio/dmedia/SDL_irixaudio.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
60 return 1; 60 return 1;
61 } 61 }
62 62
63 static void Audio_DeleteDevice(SDL_AudioDevice *device) 63 static void Audio_DeleteDevice(SDL_AudioDevice *device)
64 { 64 {
65 free(device->hidden); 65 SDL_free(device->hidden);
66 free(device); 66 SDL_free(device);
67 } 67 }
68 68
69 static SDL_AudioDevice *Audio_CreateDevice(int devindex) 69 static SDL_AudioDevice *Audio_CreateDevice(int devindex)
70 { 70 {
71 SDL_AudioDevice *this; 71 SDL_AudioDevice *this;
72 72
73 /* Initialize all variables that we clean on shutdown */ 73 /* Initialize all variables that we clean on shutdown */
74 this = (SDL_AudioDevice *)malloc(sizeof(SDL_AudioDevice)); 74 this = (SDL_AudioDevice *)SDL_malloc(sizeof(SDL_AudioDevice));
75 if ( this ) { 75 if ( this ) {
76 memset(this, 0, (sizeof *this)); 76 SDL_memset(this, 0, (sizeof *this));
77 this->hidden = (struct SDL_PrivateAudioData *) 77 this->hidden = (struct SDL_PrivateAudioData *)
78 malloc((sizeof *this->hidden)); 78 SDL_malloc((sizeof *this->hidden));
79 } 79 }
80 if ( (this == NULL) || (this->hidden == NULL) ) { 80 if ( (this == NULL) || (this->hidden == NULL) ) {
81 SDL_OutOfMemory(); 81 SDL_OutOfMemory();
82 if ( this ) { 82 if ( this ) {
83 free(this); 83 SDL_free(this);
84 } 84 }
85 return(0); 85 return(0);
86 } 86 }
87 memset(this->hidden, 0, (sizeof *this->hidden)); 87 SDL_memset(this->hidden, 0, (sizeof *this->hidden));
88 88
89 /* Set the function pointers */ 89 /* Set the function pointers */
90 this->OpenAudio = AL_OpenAudio; 90 this->OpenAudio = AL_OpenAudio;
91 this->WaitAudio = AL_WaitAudio; 91 this->WaitAudio = AL_WaitAudio;
92 this->PlayAudio = AL_PlayAudio; 92 this->PlayAudio = AL_PlayAudio;
209 mixbuf = (Uint8 *)SDL_AllocAudioMem(spec->size); 209 mixbuf = (Uint8 *)SDL_AllocAudioMem(spec->size);
210 if ( mixbuf == NULL ) { 210 if ( mixbuf == NULL ) {
211 SDL_OutOfMemory(); 211 SDL_OutOfMemory();
212 return(-1); 212 return(-1);
213 } 213 }
214 memset(mixbuf, spec->silence, spec->size); 214 SDL_memset(mixbuf, spec->silence, spec->size);
215 215
216 /* We're ready to rock and roll. :-) */ 216 /* We're ready to rock and roll. :-) */
217 return(0); 217 return(0);
218 } 218 }