comparison src/audio/openbsd/SDL_openbsdaudio.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 0276947bee66
children 604d73db6802
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
93 } 93 }
94 94
95 static void 95 static void
96 Audio_DeleteDevice(SDL_AudioDevice *device) 96 Audio_DeleteDevice(SDL_AudioDevice *device)
97 { 97 {
98 free(device->hidden); 98 SDL_free(device->hidden);
99 free(device); 99 SDL_free(device);
100 } 100 }
101 101
102 static SDL_AudioDevice 102 static SDL_AudioDevice
103 *Audio_CreateDevice(int devindex) 103 *Audio_CreateDevice(int devindex)
104 { 104 {
105 SDL_AudioDevice *this; 105 SDL_AudioDevice *this;
106 106
107 /* Initialize all variables that we clean on shutdown */ 107 /* Initialize all variables that we clean on shutdown */
108 this = (SDL_AudioDevice*)malloc(sizeof(SDL_AudioDevice)); 108 this = (SDL_AudioDevice*)SDL_malloc(sizeof(SDL_AudioDevice));
109 if(this) { 109 if(this) {
110 memset(this, 0, (sizeof *this)); 110 SDL_memset(this, 0, (sizeof *this));
111 this->hidden = 111 this->hidden =
112 (struct SDL_PrivateAudioData*)malloc((sizeof *this->hidden)); 112 (struct SDL_PrivateAudioData*)SDL_malloc((sizeof *this->hidden));
113 } 113 }
114 if((this == NULL) || (this->hidden == NULL)) { 114 if((this == NULL) || (this->hidden == NULL)) {
115 SDL_OutOfMemory(); 115 SDL_OutOfMemory();
116 if(this) free(this); 116 if(this) SDL_free(this);
117 return(0); 117 return(0);
118 } 118 }
119 memset(this->hidden, 0, (sizeof *this->hidden)); 119 SDL_memset(this->hidden, 0, (sizeof *this->hidden));
120 audio_fd = -1; 120 audio_fd = -1;
121 121
122 /* Set the function pointers */ 122 /* Set the function pointers */
123 this->OpenAudio = OBSD_OpenAudio; 123 this->OpenAudio = OBSD_OpenAudio;
124 this->WaitAudio = OBSD_WaitAudio; 124 this->WaitAudio = OBSD_WaitAudio;
395 mixlen = spec->size; 395 mixlen = spec->size;
396 mixbuf = (Uint8*)SDL_AllocAudioMem(mixlen); 396 mixbuf = (Uint8*)SDL_AllocAudioMem(mixlen);
397 if(mixbuf == NULL) { 397 if(mixbuf == NULL) {
398 return(-1); 398 return(-1);
399 } 399 }
400 memset(mixbuf, spec->silence, spec->size); 400 SDL_memset(mixbuf, spec->silence, spec->size);
401 401
402 /* Get the parent process id (we're the parent of the audio thread) */ 402 /* Get the parent process id (we're the parent of the audio thread) */
403 parent = getpid(); 403 parent = getpid();
404 404
405 #ifdef DEBUG_AUDIO 405 #ifdef DEBUG_AUDIO