Removed uses of stdlib.h and string.h
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401342
This commit is contained in:
parent
098fe1b8e9
commit
09cd73f1b5
192 changed files with 455 additions and 666 deletions
|
@ -24,13 +24,12 @@
|
|||
|
||||
#if defined(unix) || defined(__unix__) || defined(__riscos__)
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audiodev_c.h"
|
||||
|
||||
#ifndef _PATH_DEV_DSP
|
||||
|
@ -80,7 +79,8 @@ int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic)
|
|||
|
||||
instance = 1;
|
||||
do { /* Don't use errno ENOENT - it may not be thread-safe */
|
||||
sprintf(audiopath, "%s%d", audiodev, instance++);
|
||||
SDL_snprintf(audiopath, SDL_arraysize(audiopath),
|
||||
"%s%d", audiodev, instance++);
|
||||
exists = 0;
|
||||
if ( stat(audiopath, &sb) == 0 ) {
|
||||
exists = 1;
|
||||
|
@ -100,11 +100,11 @@ int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic)
|
|||
|
||||
/* Get the name of the audio device we use for output */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audiodev_c.h"
|
||||
|
||||
#ifndef _PATH_DEV_DSP
|
||||
|
@ -158,7 +158,7 @@ int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic)
|
|||
|
||||
cycle = 0;
|
||||
while( devsettings[cycle][0] != '\0' ) {
|
||||
sprintf( audiopath,
|
||||
SDL_snprintf( audiopath, SDL_arraysize(audiopath),
|
||||
_PATH_DEV_DSP,
|
||||
devsettings[cycle][0],
|
||||
devsettings[cycle][1],
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#include "SDL_audiomem.h"
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_audiomem.h"
|
||||
|
||||
/* Allocate memory that will be shared between threads (freed on exit) */
|
||||
void *SDL_AllocAudioMem(int size)
|
||||
|
|
|
@ -24,10 +24,10 @@
|
|||
|
||||
/* Microsoft WAVE file loading routines */
|
||||
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_wave.h"
|
||||
#include "SDL_endian.h"
|
||||
|
||||
|
|
|
@ -24,16 +24,11 @@
|
|||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <signal.h> /* For kill() */
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audiomem.h"
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
#else
|
||||
#include <inline/exec.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <devices/ahi.h>
|
||||
#include "mydebug.h"
|
||||
|
|
|
@ -22,14 +22,8 @@
|
|||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audiomem.h"
|
||||
|
|
|
@ -22,15 +22,14 @@
|
|||
|
||||
/* Allow access to the audio stream on BeOS */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <SoundPlayer.h>
|
||||
|
||||
#include "SDL_BeApp.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_audio_c.h"
|
||||
#include "SDL_sysaudio.h"
|
||||
|
|
|
@ -22,10 +22,8 @@
|
|||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_types.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_timer.h"
|
||||
|
|
|
@ -23,10 +23,6 @@
|
|||
|
||||
/* Output dreamcast aica */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
@ -34,6 +30,8 @@
|
|||
#include <fcntl.h>
|
||||
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audiomem.h"
|
||||
|
|
|
@ -25,9 +25,7 @@
|
|||
|
||||
/* Output raw audio data to a file. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -36,6 +34,8 @@
|
|||
#include <fcntl.h>
|
||||
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audiomem.h"
|
||||
|
|
|
@ -22,9 +22,7 @@
|
|||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -46,6 +44,8 @@
|
|||
#define MAP_FAILED ((Uint8 *)-1)
|
||||
#endif
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audiomem.h"
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
/* Allow access to a raw mixing buffer (For IRIX 6.5 and higher) */
|
||||
/* patch for IRIX 5 by Georg Schwarz 18/07/2004 */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_timer.h"
|
||||
#include "SDL_audio.h"
|
||||
|
|
|
@ -25,9 +25,7 @@
|
|||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h> /* For perror() ... should we really do this? */
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -43,6 +41,8 @@
|
|||
#include <sys/soundcard.h>
|
||||
#endif
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audiomem.h"
|
||||
|
@ -303,7 +303,6 @@ static int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec)
|
|||
#endif
|
||||
if ( ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0 ) {
|
||||
perror("SNDCTL_DSP_SETFRAGMENT");
|
||||
fprintf(stderr, "Warning: Couldn't set audio fragment size\n");
|
||||
}
|
||||
#ifdef DEBUG_AUDIO
|
||||
{ audio_buf_info info;
|
||||
|
|
|
@ -24,15 +24,12 @@
|
|||
|
||||
#ifdef ESD_SUPPORT
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <esd.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audiomem.h"
|
||||
|
@ -257,7 +254,7 @@ static char *get_progname(void)
|
|||
FILE *fp;
|
||||
static char temp[BUFSIZ];
|
||||
|
||||
sprintf(temp, "/proc/%d/cmdline", getpid());
|
||||
SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid());
|
||||
fp = fopen(temp, "r");
|
||||
if ( fp != NULL ) {
|
||||
if ( fgets(temp, sizeof(temp)-1, fp) ) {
|
||||
|
|
|
@ -22,11 +22,8 @@
|
|||
|
||||
#include <AudioUnit/AudioUnit.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_audio_c.h"
|
||||
|
@ -113,8 +110,10 @@ static OSStatus audioCallback (void *inRefCon,
|
|||
/* No SDL conversion should be needed here, ever, since we accept
|
||||
any input format in OpenAudio, and leave the conversion to CoreAudio.
|
||||
*/
|
||||
/*
|
||||
assert(!this->convert.needed);
|
||||
assert(this->spec.channels == ioData->mNumberChannels);
|
||||
*/
|
||||
|
||||
remaining = ioData->mDataByteSize;
|
||||
ptr = ioData->mData;
|
||||
|
@ -270,8 +269,7 @@ int Core_OpenAudio(_THIS, SDL_AudioSpec *spec)
|
|||
/* Allocate a sample buffer */
|
||||
bufferOffset = bufferSize = this->spec.size;
|
||||
buffer = SDL_malloc(bufferSize);
|
||||
assert(buffer);
|
||||
|
||||
|
||||
/* Finally, start processing of the audio unit */
|
||||
result = AudioOutputUnitStart (outputAudioUnit);
|
||||
CHECK_RESULT("AudioOutputUnitStart")
|
||||
|
|
|
@ -30,9 +30,6 @@
|
|||
# include <DriverServices.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#if !defined(NewSndCallBackUPP) && (UNIVERSAL_INTERFACES_VERSION < 0x0335)
|
||||
#if !defined(NewSndCallBackProc) /* avoid circular redefinition... */
|
||||
#define NewSndCallBackUPP NewSndCallBackProc
|
||||
|
@ -42,6 +39,8 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_audio_c.h"
|
||||
|
@ -455,7 +454,7 @@ static int Mac_OpenAudio(_THIS, SDL_AudioSpec *spec)
|
|||
|
||||
/* allocate the 2 double-back buffers */
|
||||
for ( i=0; i<2; ++i ) {
|
||||
audio_buf[i] = calloc(1, sizeof(SndDoubleBuffer)+spec->size);
|
||||
audio_buf[i] = SDL_calloc(1, sizeof(SndDoubleBuffer)+spec->size);
|
||||
if ( audio_buf[i] == NULL ) {
|
||||
SDL_OutOfMemory();
|
||||
return(-1);
|
||||
|
|
|
@ -27,15 +27,13 @@
|
|||
Patrice Mandin
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Mint includes */
|
||||
#include <mint/osbind.h>
|
||||
#include <mint/falcon.h>
|
||||
#include <mint/cookie.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_audio_c.h"
|
||||
|
|
|
@ -27,15 +27,13 @@
|
|||
Patrice Mandin
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Mint includes */
|
||||
#include <mint/osbind.h>
|
||||
#include <mint/falcon.h>
|
||||
#include <mint/cookie.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_audio_c.h"
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
Patrice Mandin
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <support.h>
|
||||
|
||||
/* Mint includes */
|
||||
|
@ -37,6 +34,8 @@
|
|||
#include <mint/falcon.h>
|
||||
#include <mint/cookie.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_audio_c.h"
|
||||
|
|
|
@ -27,15 +27,13 @@
|
|||
Patrice Mandin
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Mint includes */
|
||||
#include <mint/osbind.h>
|
||||
#include <mint/falcon.h>
|
||||
#include <mint/cookie.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_audio_c.h"
|
||||
|
|
|
@ -27,9 +27,6 @@
|
|||
Patrice Mandin, Didier Méquignon
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <support.h>
|
||||
|
||||
|
@ -38,6 +35,8 @@
|
|||
#include <mint/falcon.h>
|
||||
#include <mint/cookie.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_audio_c.h"
|
||||
|
|
|
@ -91,7 +91,7 @@ static void SetMMerror(char *function, MMRESULT code)
|
|||
int len;
|
||||
char errbuf[MAXERRORLENGTH];
|
||||
|
||||
sprintf(errbuf, "%s: ", function);
|
||||
SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function);
|
||||
len = SDL_strlen(errbuf);
|
||||
waveOutGetErrorText(code, errbuf+len, MAXERRORLENGTH-len);
|
||||
SDL_SetError("%s",errbuf);
|
||||
|
|
|
@ -22,9 +22,6 @@
|
|||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <mme_api.h>
|
||||
|
||||
#include "SDL_audio.h"
|
||||
|
|
|
@ -26,13 +26,11 @@
|
|||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audiomem.h"
|
||||
|
|
|
@ -20,9 +20,6 @@
|
|||
slouken@libsdl.org
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -34,6 +31,8 @@
|
|||
#include <sys/neutrino.h>
|
||||
#include <sys/asoundlib.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audiomem.h"
|
||||
|
|
|
@ -25,19 +25,17 @@
|
|||
* vedge@vedge.com.ar.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/audioio.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audiomem.h"
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -34,6 +31,8 @@
|
|||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audiomem.h"
|
||||
|
|
|
@ -22,11 +22,8 @@
|
|||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#ifdef __NetBSD__
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/audioio.h>
|
||||
|
@ -39,6 +36,8 @@
|
|||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_audiomem.h"
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -36,6 +33,8 @@
|
|||
#include <sys/stat.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_audio_c.h"
|
||||
|
|
|
@ -25,11 +25,11 @@
|
|||
#include "SDL_windows.h"
|
||||
#include <mmsystem.h>
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_mutex.h"
|
||||
#include "SDL_timer.h"
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio_c.h"
|
||||
#include "SDL_dibaudio.h"
|
||||
#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
|
||||
|
|
|
@ -22,12 +22,12 @@
|
|||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_types.h"
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_timer.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_stdlib.h"
|
||||
#include "SDL_string.h"
|
||||
#include "SDL_audio_c.h"
|
||||
#include "SDL_dx5audio.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue