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:
Sam Lantinga 2006-02-07 09:29:18 +00:00
parent 098fe1b8e9
commit 09cd73f1b5
192 changed files with 455 additions and 666 deletions

View file

@ -27,9 +27,9 @@
#endif #endif
#include "SDL.h" #include "SDL.h"
#include "SDL_stdlib.h"
#include "SDL_endian.h" #include "SDL_endian.h"
#include "SDL_fatal.h" #include "SDL_fatal.h"
#include "SDL_stdlib.h"
#ifndef DISABLE_VIDEO #ifndef DISABLE_VIDEO
#include "SDL_leaks.h" #include "SDL_leaks.h"
#endif #endif

View file

@ -22,9 +22,9 @@
/* Simple error handling in SDL */ /* Simple error handling in SDL */
#include "SDL_types.h"
#include "SDL_stdlib.h" #include "SDL_stdlib.h"
#include "SDL_string.h" #include "SDL_string.h"
#include "SDL_types.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_error_c.h" #include "SDL_error_c.h"
#ifndef DISABLE_THREADS #ifndef DISABLE_THREADS

View file

@ -24,13 +24,12 @@
#if defined(unix) || defined(__unix__) || defined(__riscos__) #if defined(unix) || defined(__unix__) || defined(__riscos__)
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <string.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audiodev_c.h" #include "SDL_audiodev_c.h"
#ifndef _PATH_DEV_DSP #ifndef _PATH_DEV_DSP
@ -80,7 +79,8 @@ int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic)
instance = 1; instance = 1;
do { /* Don't use errno ENOENT - it may not be thread-safe */ 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; exists = 0;
if ( stat(audiopath, &sb) == 0 ) { if ( stat(audiopath, &sb) == 0 ) {
exists = 1; 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 */ /* Get the name of the audio device we use for output */
#include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <string.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audiodev_c.h" #include "SDL_audiodev_c.h"
#ifndef _PATH_DEV_DSP #ifndef _PATH_DEV_DSP
@ -158,7 +158,7 @@ int SDL_OpenAudioPath(char *path, int maxlen, int flags, int classic)
cycle = 0; cycle = 0;
while( devsettings[cycle][0] != '\0' ) { while( devsettings[cycle][0] != '\0' ) {
sprintf( audiopath, SDL_snprintf( audiopath, SDL_arraysize(audiopath),
_PATH_DEV_DSP, _PATH_DEV_DSP,
devsettings[cycle][0], devsettings[cycle][0],
devsettings[cycle][1], devsettings[cycle][1],

View file

@ -31,8 +31,8 @@
#include <stddef.h> #include <stddef.h>
#endif #endif
#include "SDL_audiomem.h"
#include "SDL_stdlib.h" #include "SDL_stdlib.h"
#include "SDL_audiomem.h"
/* Allocate memory that will be shared between threads (freed on exit) */ /* Allocate memory that will be shared between threads (freed on exit) */
void *SDL_AllocAudioMem(int size) void *SDL_AllocAudioMem(int size)

View file

@ -24,10 +24,10 @@
/* Microsoft WAVE file loading routines */ /* Microsoft WAVE file loading routines */
#include "SDL_error.h"
#include "SDL_audio.h"
#include "SDL_stdlib.h" #include "SDL_stdlib.h"
#include "SDL_string.h" #include "SDL_string.h"
#include "SDL_error.h"
#include "SDL_audio.h"
#include "SDL_wave.h" #include "SDL_wave.h"
#include "SDL_endian.h" #include "SDL_endian.h"

View file

@ -24,16 +24,11 @@
/* Allow access to a raw mixing buffer */ /* 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/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_audio.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_audiomem.h" #include "SDL_audiomem.h"

View file

@ -30,8 +30,6 @@
#else #else
#include <inline/exec.h> #include <inline/exec.h>
#endif #endif
#include <stdlib.h>
#include <string.h>
#include <devices/ahi.h> #include <devices/ahi.h>
#include "mydebug.h" #include "mydebug.h"

View file

@ -22,14 +22,8 @@
/* Allow access to a raw mixing buffer */ /* Allow access to a raw mixing buffer */
#include <sys/types.h> #include "SDL_stdlib.h"
#include <stdlib.h> #include "SDL_string.h"
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include <unistd.h>
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_audiomem.h" #include "SDL_audiomem.h"

View file

@ -22,15 +22,14 @@
/* Allow access to the audio stream on BeOS */ /* Allow access to the audio stream on BeOS */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <SoundPlayer.h> #include <SoundPlayer.h>
#include "SDL_BeApp.h" #include "SDL_BeApp.h"
extern "C" { extern "C" {
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_audio_c.h" #include "SDL_audio_c.h"
#include "SDL_sysaudio.h" #include "SDL_sysaudio.h"

View file

@ -22,10 +22,8 @@
/* Allow access to a raw mixing buffer */ /* Allow access to a raw mixing buffer */
#include <stdio.h> #include "SDL_stdlib.h"
#include <stdlib.h> #include "SDL_string.h"
#include <string.h>
#include "SDL_types.h" #include "SDL_types.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_timer.h" #include "SDL_timer.h"

View file

@ -23,10 +23,6 @@
/* Output dreamcast aica */ /* Output dreamcast aica */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
@ -34,6 +30,8 @@
#include <fcntl.h> #include <fcntl.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_audiomem.h" #include "SDL_audiomem.h"

View file

@ -25,9 +25,7 @@
/* Output raw audio data to a file. */ /* Output raw audio data to a file. */
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -36,6 +34,8 @@
#include <fcntl.h> #include <fcntl.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_audiomem.h" #include "SDL_audiomem.h"

View file

@ -22,9 +22,7 @@
/* Allow access to a raw mixing buffer */ /* Allow access to a raw mixing buffer */
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@ -46,6 +44,8 @@
#define MAP_FAILED ((Uint8 *)-1) #define MAP_FAILED ((Uint8 *)-1)
#endif #endif
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_audiomem.h" #include "SDL_audiomem.h"

View file

@ -23,8 +23,8 @@
/* Allow access to a raw mixing buffer (For IRIX 6.5 and higher) */ /* Allow access to a raw mixing buffer (For IRIX 6.5 and higher) */
/* patch for IRIX 5 by Georg Schwarz 18/07/2004 */ /* 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_endian.h"
#include "SDL_timer.h" #include "SDL_timer.h"
#include "SDL_audio.h" #include "SDL_audio.h"

View file

@ -25,9 +25,7 @@
/* Allow access to a raw mixing buffer */ /* Allow access to a raw mixing buffer */
#include <stdlib.h> #include <stdio.h> /* For perror() ... should we really do this? */
#include <stdio.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@ -43,6 +41,8 @@
#include <sys/soundcard.h> #include <sys/soundcard.h>
#endif #endif
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_audiomem.h" #include "SDL_audiomem.h"
@ -303,7 +303,6 @@ static int DSP_OpenAudio(_THIS, SDL_AudioSpec *spec)
#endif #endif
if ( ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0 ) { if ( ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag_spec) < 0 ) {
perror("SNDCTL_DSP_SETFRAGMENT"); perror("SNDCTL_DSP_SETFRAGMENT");
fprintf(stderr, "Warning: Couldn't set audio fragment size\n");
} }
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
{ audio_buf_info info; { audio_buf_info info;

View file

@ -24,15 +24,12 @@
#ifdef ESD_SUPPORT #ifdef ESD_SUPPORT
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include <signal.h>
#include <unistd.h>
#include <esd.h> #include <esd.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_audiomem.h" #include "SDL_audiomem.h"
@ -257,7 +254,7 @@ static char *get_progname(void)
FILE *fp; FILE *fp;
static char temp[BUFSIZ]; static char temp[BUFSIZ];
sprintf(temp, "/proc/%d/cmdline", getpid()); SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid());
fp = fopen(temp, "r"); fp = fopen(temp, "r");
if ( fp != NULL ) { if ( fp != NULL ) {
if ( fgets(temp, sizeof(temp)-1, fp) ) { if ( fgets(temp, sizeof(temp)-1, fp) ) {

View file

@ -22,11 +22,8 @@
#include <AudioUnit/AudioUnit.h> #include <AudioUnit/AudioUnit.h>
#include <assert.h> #include "SDL_stdlib.h"
#include <stdlib.h> #include "SDL_string.h"
#include <stdio.h>
#include <string.h>
#include "SDL_endian.h" #include "SDL_endian.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_audio_c.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 /* No SDL conversion should be needed here, ever, since we accept
any input format in OpenAudio, and leave the conversion to CoreAudio. any input format in OpenAudio, and leave the conversion to CoreAudio.
*/ */
/*
assert(!this->convert.needed); assert(!this->convert.needed);
assert(this->spec.channels == ioData->mNumberChannels); assert(this->spec.channels == ioData->mNumberChannels);
*/
remaining = ioData->mDataByteSize; remaining = ioData->mDataByteSize;
ptr = ioData->mData; ptr = ioData->mData;
@ -270,7 +269,6 @@ int Core_OpenAudio(_THIS, SDL_AudioSpec *spec)
/* Allocate a sample buffer */ /* Allocate a sample buffer */
bufferOffset = bufferSize = this->spec.size; bufferOffset = bufferSize = this->spec.size;
buffer = SDL_malloc(bufferSize); buffer = SDL_malloc(bufferSize);
assert(buffer);
/* Finally, start processing of the audio unit */ /* Finally, start processing of the audio unit */
result = AudioOutputUnitStart (outputAudioUnit); result = AudioOutputUnitStart (outputAudioUnit);

View file

@ -30,9 +30,6 @@
# include <DriverServices.h> # include <DriverServices.h>
#endif #endif
#include <stdlib.h>
#include <stdio.h>
#if !defined(NewSndCallBackUPP) && (UNIVERSAL_INTERFACES_VERSION < 0x0335) #if !defined(NewSndCallBackUPP) && (UNIVERSAL_INTERFACES_VERSION < 0x0335)
#if !defined(NewSndCallBackProc) /* avoid circular redefinition... */ #if !defined(NewSndCallBackProc) /* avoid circular redefinition... */
#define NewSndCallBackUPP NewSndCallBackProc #define NewSndCallBackUPP NewSndCallBackProc
@ -42,6 +39,8 @@
#endif #endif
#endif #endif
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_endian.h" #include "SDL_endian.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_audio_c.h" #include "SDL_audio_c.h"
@ -455,7 +454,7 @@ static int Mac_OpenAudio(_THIS, SDL_AudioSpec *spec)
/* allocate the 2 double-back buffers */ /* allocate the 2 double-back buffers */
for ( i=0; i<2; ++i ) { 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 ) { if ( audio_buf[i] == NULL ) {
SDL_OutOfMemory(); SDL_OutOfMemory();
return(-1); return(-1);

View file

@ -27,15 +27,13 @@
Patrice Mandin Patrice Mandin
*/ */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
/* Mint includes */ /* Mint includes */
#include <mint/osbind.h> #include <mint/osbind.h>
#include <mint/falcon.h> #include <mint/falcon.h>
#include <mint/cookie.h> #include <mint/cookie.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_endian.h" #include "SDL_endian.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_audio_c.h" #include "SDL_audio_c.h"

View file

@ -27,15 +27,13 @@
Patrice Mandin Patrice Mandin
*/ */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
/* Mint includes */ /* Mint includes */
#include <mint/osbind.h> #include <mint/osbind.h>
#include <mint/falcon.h> #include <mint/falcon.h>
#include <mint/cookie.h> #include <mint/cookie.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_endian.h" #include "SDL_endian.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_audio_c.h" #include "SDL_audio_c.h"

View file

@ -27,9 +27,6 @@
Patrice Mandin Patrice Mandin
*/ */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <support.h> #include <support.h>
/* Mint includes */ /* Mint includes */
@ -37,6 +34,8 @@
#include <mint/falcon.h> #include <mint/falcon.h>
#include <mint/cookie.h> #include <mint/cookie.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_endian.h" #include "SDL_endian.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_audio_c.h" #include "SDL_audio_c.h"

View file

@ -27,15 +27,13 @@
Patrice Mandin Patrice Mandin
*/ */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
/* Mint includes */ /* Mint includes */
#include <mint/osbind.h> #include <mint/osbind.h>
#include <mint/falcon.h> #include <mint/falcon.h>
#include <mint/cookie.h> #include <mint/cookie.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_endian.h" #include "SDL_endian.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_audio_c.h" #include "SDL_audio_c.h"

View file

@ -27,9 +27,6 @@
Patrice Mandin, Didier Méquignon Patrice Mandin, Didier Méquignon
*/ */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include <support.h> #include <support.h>
@ -38,6 +35,8 @@
#include <mint/falcon.h> #include <mint/falcon.h>
#include <mint/cookie.h> #include <mint/cookie.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_endian.h" #include "SDL_endian.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_audio_c.h" #include "SDL_audio_c.h"

View file

@ -91,7 +91,7 @@ static void SetMMerror(char *function, MMRESULT code)
int len; int len;
char errbuf[MAXERRORLENGTH]; char errbuf[MAXERRORLENGTH];
sprintf(errbuf, "%s: ", function); SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function);
len = SDL_strlen(errbuf); len = SDL_strlen(errbuf);
waveOutGetErrorText(code, errbuf+len, MAXERRORLENGTH-len); waveOutGetErrorText(code, errbuf+len, MAXERRORLENGTH-len);
SDL_SetError("%s",errbuf); SDL_SetError("%s",errbuf);

View file

@ -22,9 +22,6 @@
/* Allow access to a raw mixing buffer */ /* Allow access to a raw mixing buffer */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mme_api.h> #include <mme_api.h>
#include "SDL_audio.h" #include "SDL_audio.h"

View file

@ -26,13 +26,11 @@
/* Allow access to a raw mixing buffer */ /* Allow access to a raw mixing buffer */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_audiomem.h" #include "SDL_audiomem.h"

View file

@ -20,9 +20,6 @@
slouken@libsdl.org slouken@libsdl.org
*/ */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@ -34,6 +31,8 @@
#include <sys/neutrino.h> #include <sys/neutrino.h>
#include <sys/asoundlib.h> #include <sys/asoundlib.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_audiomem.h" #include "SDL_audiomem.h"

View file

@ -25,19 +25,17 @@
* vedge@vedge.com.ar. * vedge@vedge.com.ar.
*/ */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <signal.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/audioio.h> #include <sys/audioio.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_audiomem.h" #include "SDL_audiomem.h"

View file

@ -24,9 +24,6 @@
/* Allow access to a raw mixing buffer */ /* Allow access to a raw mixing buffer */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@ -34,6 +31,8 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_audiomem.h" #include "SDL_audiomem.h"

View file

@ -22,11 +22,8 @@
/* Allow access to a raw mixing buffer */ /* Allow access to a raw mixing buffer */
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <string.h>
#ifdef __NetBSD__ #ifdef __NetBSD__
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/audioio.h> #include <sys/audioio.h>
@ -39,6 +36,8 @@
#endif #endif
#include <unistd.h> #include <unistd.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_endian.h" #include "SDL_endian.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_audiomem.h" #include "SDL_audiomem.h"

View file

@ -24,9 +24,6 @@
/* Allow access to a raw mixing buffer */ /* Allow access to a raw mixing buffer */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@ -36,6 +33,8 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/mman.h> #include <sys/mman.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_audio_c.h" #include "SDL_audio_c.h"

View file

@ -25,11 +25,11 @@
#include "SDL_windows.h" #include "SDL_windows.h"
#include <mmsystem.h> #include <mmsystem.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_mutex.h" #include "SDL_mutex.h"
#include "SDL_timer.h" #include "SDL_timer.h"
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio_c.h" #include "SDL_audio_c.h"
#include "SDL_dibaudio.h" #include "SDL_dibaudio.h"
#if defined(_WIN32_WCE) && (_WIN32_WCE < 300) #if defined(_WIN32_WCE) && (_WIN32_WCE < 300)

View file

@ -22,12 +22,12 @@
/* Allow access to a raw mixing buffer */ /* Allow access to a raw mixing buffer */
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_types.h" #include "SDL_types.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_timer.h" #include "SDL_timer.h"
#include "SDL_audio.h" #include "SDL_audio.h"
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_audio_c.h" #include "SDL_audio_c.h"
#include "SDL_dx5audio.h" #include "SDL_dx5audio.h"

View file

@ -22,10 +22,10 @@
/* This is the CD-audio control API for Simple DirectMedia Layer */ /* This is the CD-audio control API for Simple DirectMedia Layer */
#include "SDL_error.h"
#include "SDL_cdrom.h"
#include "SDL_stdlib.h" #include "SDL_stdlib.h"
#include "SDL_string.h" #include "SDL_string.h"
#include "SDL_error.h"
#include "SDL_cdrom.h"
#include "SDL_syscdrom.h" #include "SDL_syscdrom.h"
#if !defined(macintosh) #if !defined(macintosh)

View file

@ -27,11 +27,8 @@
#define DEBUG_CDROM 1 #define DEBUG_CDROM 1
#include <sys/types.h> #include <sys/types.h>
#include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
@ -43,6 +40,8 @@
#include <fstab.h> #include <fstab.h>
#include <sys/scdisk.h> #include <sys/scdisk.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_cdrom.h" #include "SDL_cdrom.h"
#include "SDL_syscdrom.h" #include "SDL_syscdrom.h"

View file

@ -25,10 +25,7 @@
*/ */
#include <sys/types.h> #include <sys/types.h>
#include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include <scsi.h> #include <scsi.h>
@ -36,6 +33,8 @@
#include <Entry.h> #include <Entry.h>
#include <Path.h> #include <Path.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_cdrom.h" #include "SDL_cdrom.h"
extern "C" { extern "C" {

View file

@ -29,18 +29,16 @@
*/ */
#include <sys/types.h> #include <sys/types.h>
#include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <err.h> #include <err.h>
#include <unistd.h> #include <unistd.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include </sys/dev/scsi/scsi.h> #include </sys/dev/scsi/scsi.h>
#include </sys/dev/scsi/scsi_ioctl.h> #include </sys/dev/scsi/scsi_ioctl.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_cdrom.h" #include "SDL_cdrom.h"
#include "SDL_syscdrom.h" #include "SDL_syscdrom.h"
@ -303,7 +301,7 @@ int SDL_SYS_CDInit(void)
char *insert; char *insert;
exists = 1; exists = 1;
for ( j=checklist[i][1]; exists; ++j ) { for ( j=checklist[i][1]; exists; ++j ) {
sprintf(drive, "/dev/%sc", &checklist[i][3]); SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]);
insert = SDL_strchr(drive, '?'); insert = SDL_strchr(drive, '?');
if ( insert != NULL ) { if ( insert != NULL ) {
*insert = j; *insert = j;
@ -323,7 +321,7 @@ int SDL_SYS_CDInit(void)
} }
} }
} else { } else {
sprintf(drive, "/dev/%s", checklist[i]); SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
if ( CheckDrive(drive, &stbuf) > 0 ) { if ( CheckDrive(drive, &stbuf) > 0 ) {
AddDrive(drive, &stbuf); AddDrive(drive, &stbuf);
} }

View file

@ -22,8 +22,6 @@
/* Functions for system-level CD-ROM audio control */ /* Functions for system-level CD-ROM audio control */
#include <stdlib.h>
#include <stdio.h>
#include <dc/cdrom.h> #include <dc/cdrom.h>
#include <dc/spu.h> #include <dc/spu.h>

View file

@ -23,15 +23,14 @@
/* Functions for system-level CD-ROM audio control */ /* Functions for system-level CD-ROM audio control */
#include <sys/types.h> #include <sys/types.h>
#include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <sys/cdio.h> #include <sys/cdio.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_cdrom.h" #include "SDL_cdrom.h"
#include "SDL_syscdrom.h" #include "SDL_syscdrom.h"
@ -189,7 +188,7 @@ int SDL_SYS_CDInit(void)
char *insert; char *insert;
exists = 1; exists = 1;
for ( j=checklist[i][1]; exists; ++j ) { for ( j=checklist[i][1]; exists; ++j ) {
sprintf(drive, "/dev/%sc", &checklist[i][3]); SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%sc", &checklist[i][3]);
insert = SDL_strchr(drive, '?'); insert = SDL_strchr(drive, '?');
if ( insert != NULL ) { if ( insert != NULL ) {
*insert = j; *insert = j;
@ -209,7 +208,7 @@ int SDL_SYS_CDInit(void)
} }
} }
} else { } else {
sprintf(drive, "/dev/%s", checklist[i]); SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
if ( CheckDrive(drive, &stbuf) > 0 ) { if ( CheckDrive(drive, &stbuf) > 0 ) {
AddDrive(drive, &stbuf); AddDrive(drive, &stbuf);
} }

View file

@ -23,12 +23,9 @@
/* Functions for system-level CD-ROM audio control */ /* Functions for system-level CD-ROM audio control */
#include <sys/types.h> #include <sys/types.h>
#include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#ifdef __linux__ #ifdef __linux__
@ -83,6 +80,8 @@
#endif #endif
#endif /* USE_MNTENT */ #endif /* USE_MNTENT */
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_cdrom.h" #include "SDL_cdrom.h"
#include "SDL_syscdrom.h" #include "SDL_syscdrom.h"
@ -336,7 +335,7 @@ int SDL_SYS_CDInit(void)
char *insert; char *insert;
exists = 1; exists = 1;
for ( j=checklist[i][1]; exists; ++j ) { for ( j=checklist[i][1]; exists; ++j ) {
sprintf(drive, "/dev/%s", &checklist[i][3]); SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
insert = SDL_strchr(drive, '?'); insert = SDL_strchr(drive, '?');
if ( insert != NULL ) { if ( insert != NULL ) {
*insert = j; *insert = j;
@ -359,7 +358,7 @@ int SDL_SYS_CDInit(void)
} }
} }
} else { } else {
sprintf(drive, "/dev/%s", checklist[i]); SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
#ifdef DEBUG_CDROM #ifdef DEBUG_CDROM
fprintf(stderr, "Checking possible CD-ROM drive: %s\n", drive); fprintf(stderr, "Checking possible CD-ROM drive: %s\n", drive);
#endif #endif

View file

@ -594,7 +594,7 @@ AudioFileManager *new_AudioFileManager(AudioFilePlayer *inParent,
afm->mBufferOffset = inChunkSize; afm->mBufferOffset = inChunkSize;
afm->mChunkSize = inChunkSize; afm->mChunkSize = inChunkSize;
afm->mFileLength = inFileLength; afm->mFileLength = inFileLength;
afm->mFileBuffer = (char*) malloc (afm->mChunkSize * 2); afm->mFileBuffer = (char*) SDL_malloc(afm->mChunkSize * 2);
FSGetForkPosition(afm->mForkRefNum, &afm->mAudioDataOffset); FSGetForkPosition(afm->mForkRefNum, &afm->mAudioDataOffset);
assert (afm->mFileBuffer != NULL); assert (afm->mFileBuffer != NULL);
return afm; return afm;

View file

@ -68,12 +68,19 @@
// Includes // Includes
//============================================================================= //=============================================================================
/*
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
*/
#include "SDL_stdlib.h"
#include "SDL_string.h"
//#define NDEBUG 1 //#define NDEBUG 1
/*
#include <assert.h> #include <assert.h>
*/
#define assert(X)
#include "SDLOSXCAGuard.h" #include "SDLOSXCAGuard.h"

View file

@ -58,7 +58,7 @@ static int LoadTracks (SDL_CD *cdrom)
return 0; return 0;
/* Allocate memory for tracks */ /* Allocate memory for tracks */
tracks[cdrom->id] = (FSRef*) calloc (1, sizeof(**tracks) * cdrom->numtracks); tracks[cdrom->id] = (FSRef*) SDL_calloc (1, sizeof(**tracks) * cdrom->numtracks);
if (tracks[cdrom->id] == NULL) { if (tracks[cdrom->id] == NULL) {
SDL_OutOfMemory (); SDL_OutOfMemory ();
return -1; return -1;
@ -203,14 +203,14 @@ int SDL_SYS_CDInit (void)
} }
/* Allocate space for volumes */ /* Allocate space for volumes */
volumes = (FSVolumeRefNum*) calloc (1, sizeof(*volumes) * SDL_numcds); volumes = (FSVolumeRefNum*) SDL_calloc (1, sizeof(*volumes) * SDL_numcds);
if (volumes == NULL) { if (volumes == NULL) {
SDL_OutOfMemory (); SDL_OutOfMemory ();
return -1; return -1;
} }
/* Allocate space for tracks */ /* Allocate space for tracks */
tracks = (FSRef**) calloc (1, sizeof(*tracks) * (SDL_numcds + 1)); tracks = (FSRef**) SDL_calloc (1, sizeof(*tracks) * (SDL_numcds + 1));
if (tracks == NULL) { if (tracks == NULL) {
SDL_OutOfMemory (); SDL_OutOfMemory ();
return -1; return -1;

View file

@ -27,9 +27,6 @@
*/ */
#include <errno.h> #include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cdromio.h> #include <cdromio.h>
#include <metados.h> #include <metados.h>

View file

@ -24,16 +24,15 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/cdio.h> #include <sys/cdio.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_cdrom.h" #include "SDL_cdrom.h"
#include "SDL_syscdrom.h" #include "SDL_syscdrom.h"
@ -198,7 +197,7 @@ int SDL_SYS_CDInit(void)
char *insert; char *insert;
exists = 1; exists = 1;
for ( j=checklist[i][1]; exists; ++j ) { for ( j=checklist[i][1]; exists; ++j ) {
sprintf(drive, "/dev/%s", &checklist[i][3]); SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
insert = SDL_strchr(drive, '?'); insert = SDL_strchr(drive, '?');
if ( insert != NULL ) { if ( insert != NULL ) {
*insert = j; *insert = j;
@ -218,7 +217,7 @@ int SDL_SYS_CDInit(void)
} }
} }
} else { } else {
sprintf(drive, "/dev/%s", checklist[i]); SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
if ( CheckDrive(drive, &stbuf) > 0 ) { if ( CheckDrive(drive, &stbuf) > 0 ) {
AddDrive(drive, &stbuf); AddDrive(drive, &stbuf);
} }

View file

@ -25,10 +25,9 @@
#define INCL_MCIOS2 #define INCL_MCIOS2
#include <os2.h> #include <os2.h>
#include <os2me.h> #include <os2me.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_cdrom.h" #include "SDL_cdrom.h"
#include "SDL_syscdrom.h" #include "SDL_syscdrom.h"

View file

@ -31,12 +31,9 @@
#include <io/cam/cdrom.h> #include <io/cam/cdrom.h>
#include <io/cam/rzdisk.h> #include <io/cam/rzdisk.h>
#include <io/common/devgetinfo.h> #include <io/common/devgetinfo.h>
#include <alloca.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_cdrom.h" #include "SDL_cdrom.h"
#include "SDL_syscdrom.h" #include "SDL_syscdrom.h"
@ -218,7 +215,7 @@ int SDL_SYS_CDInit(void)
while (devent = readdir(devdir)) while (devent = readdir(devdir))
if (SDL_memcmp(checklist[i].name, devent->d_name, name_len) == 0) if (SDL_memcmp(checklist[i].name, devent->d_name, name_len) == 0)
if (devent->d_name[devent->d_namlen-1] == 'c') { if (devent->d_name[devent->d_namlen-1] == 'c') {
sprintf(drive, "%s/%s", checklist[i].dir, devent->d_name); SDL_snprintf(drive, SDL_arraysize(drive), "%s/%s", checklist[i].dir, devent->d_name);
#ifdef DEBUG_CDROM #ifdef DEBUG_CDROM
fprintf(stderr, "Try to add drive: %s\n", drive); fprintf(stderr, "Try to add drive: %s\n", drive);
#endif #endif

View file

@ -23,17 +23,16 @@
/* Functions for system-level CD-ROM audio control */ /* Functions for system-level CD-ROM audio control */
#include <sys/types.h> #include <sys/types.h>
#include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h>
#include <errno.h> #include <errno.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include <sys/cdrom.h> #include <sys/cdrom.h>
#include <sys/dcmd_cam.h> #include <sys/dcmd_cam.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_cdrom.h" #include "SDL_cdrom.h"
#include "SDL_timer.h" #include "SDL_timer.h"
@ -218,7 +217,7 @@ int SDL_SYS_CDInit(void)
for ( j=checklist[i][1]; exists; ++j ) for ( j=checklist[i][1]; exists; ++j )
{ {
sprintf(drive, "/dev/%s", &checklist[i][3]); SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", &checklist[i][3]);
insert = SDL_strchr(drive, '?'); insert = SDL_strchr(drive, '?');
if (insert != NULL) if (insert != NULL)
{ {
@ -242,7 +241,7 @@ int SDL_SYS_CDInit(void)
} }
else else
{ {
sprintf(drive, "/dev/%s", checklist[i]); SDL_snprintf(drive, SDL_arraysize(drive), "/dev/%s", checklist[i]);
if (CheckDrive(drive, &stbuf) > 0) if (CheckDrive(drive, &stbuf) > 0)
{ {
AddDrive(drive, &stbuf); AddDrive(drive, &stbuf);

View file

@ -25,10 +25,10 @@
#include "SDL_windows.h" #include "SDL_windows.h"
#include <mmsystem.h> #include <mmsystem.h>
#include "SDL_error.h"
#include "SDL_cdrom.h"
#include "SDL_stdlib.h" #include "SDL_stdlib.h"
#include "SDL_string.h" #include "SDL_string.h"
#include "SDL_error.h"
#include "SDL_cdrom.h"
#include "SDL_syscdrom.h" #include "SDL_syscdrom.h"
/* This really broken?? */ /* This really broken?? */

View file

@ -24,10 +24,10 @@
data sources. It can easily be extended to files, memory, etc. data sources. It can easily be extended to files, memory, etc.
*/ */
#include "SDL_error.h"
#include "SDL_rwops.h"
#include "SDL_stdlib.h" #include "SDL_stdlib.h"
#include "SDL_string.h" #include "SDL_string.h"
#include "SDL_error.h"
#include "SDL_rwops.h"
#ifdef HAVE_STDIO_H #ifdef HAVE_STDIO_H

View file

@ -22,10 +22,10 @@
/* This is the joystick API for Simple DirectMedia Layer */ /* This is the joystick API for Simple DirectMedia Layer */
#include "SDL_error.h"
#include "SDL_events.h"
#include "SDL_stdlib.h" #include "SDL_stdlib.h"
#include "SDL_string.h" #include "SDL_string.h"
#include "SDL_error.h"
#include "SDL_events.h"
#ifndef DISABLE_EVENTS #ifndef DISABLE_EVENTS
#include "SDL_events_c.h" #include "SDL_events_c.h"
#endif #endif

View file

@ -23,8 +23,6 @@
/* This is the system specific header for the SDL joystick API */ /* This is the system specific header for the SDL joystick API */
#include <stdio.h> /* For the definition of NULL */
#include <libraries/lowlevel.h> #include <libraries/lowlevel.h>
#if defined(__SASC) || defined(STORMC4_WOS) #if defined(__SASC) || defined(STORMC4_WOS)
#include <proto/exec.h> #include <proto/exec.h>
@ -39,8 +37,8 @@
extern struct ExecBase *SysBase; extern struct ExecBase *SysBase;
extern struct GfxBase *GfxBase; extern struct GfxBase *GfxBase;
#include <stdlib.h>
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_joystick.h" #include "SDL_joystick.h"
#include "SDL_sysjoystick.h" #include "SDL_sysjoystick.h"

View file

@ -22,15 +22,13 @@
/* This is the system specific header for the SDL joystick API */ /* This is the system specific header for the SDL joystick API */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <be/support/String.h> #include <be/support/String.h>
#include <be/device/Joystick.h> #include <be/device/Joystick.h>
extern "C" { extern "C" {
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_joystick.h" #include "SDL_joystick.h"
#include "SDL_sysjoystick.h" #include "SDL_sysjoystick.h"

View file

@ -29,11 +29,8 @@
#include <sys/param.h> #include <sys/param.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <string.h>
#include <errno.h> #include <errno.h>
#if defined(HAVE_USB_H) #if defined(HAVE_USB_H)
@ -59,6 +56,8 @@
#include <machine/joystick.h> #include <machine/joystick.h>
#endif #endif
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_joystick.h" #include "SDL_joystick.h"
#include "SDL_sysjoystick.h" #include "SDL_sysjoystick.h"
@ -145,7 +144,7 @@ SDL_SYS_JoystickInit(void)
for (i = 0; i < MAX_UHID_JOYS; i++) { for (i = 0; i < MAX_UHID_JOYS; i++) {
SDL_Joystick nj; SDL_Joystick nj;
sprintf(s, "/dev/uhid%d", i); SDL_snprintf(s, SDL_arraysize(s), "/dev/uhid%d", i);
nj.index = SDL_numjoysticks; nj.index = SDL_numjoysticks;
joynames[nj.index] = strdup(s); joynames[nj.index] = strdup(s);
@ -159,7 +158,7 @@ SDL_SYS_JoystickInit(void)
} }
} }
for (i = 0; i < MAX_JOY_JOYS; i++) { for (i = 0; i < MAX_JOY_JOYS; i++) {
sprintf(s, "/dev/joy%d", i); SDL_snprintf(s, SDL_arraysize(s), "/dev/joy%d", i);
fd = open(s, O_RDONLY); fd = open(s, O_RDONLY);
if (fd != -1) { if (fd != -1) {
joynames[SDL_numjoysticks++] = strdup(s); joynames[SDL_numjoysticks++] = strdup(s);
@ -312,7 +311,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick *joy)
case HUG_GAME_PAD: case HUG_GAME_PAD:
s = hid_usage_in_page(hitem.usage); s = hid_usage_in_page(hitem.usage);
sp = SDL_malloc(SDL_strlen(s) + 5); sp = SDL_malloc(SDL_strlen(s) + 5);
sprintf(sp, "%s (%d)", s, SDL_snprintf(sp, SDL_strlen(s) + 5, "%s (%d)", s,
joy->index); joy->index);
joydevnames[joy->index] = sp; joydevnames[joy->index] = sp;
} }

View file

@ -23,11 +23,8 @@
/* SDL joystick driver for Darwin / MacOS X, based on the IOKit HID API */ /* SDL joystick driver for Darwin / MacOS X, based on the IOKit HID API */
/* Written 2001 by Max Horn */ /* Written 2001 by Max Horn */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <ctype.h> #include <ctype.h>
#include <sys/errno.h>
#include <sysexits.h> #include <sysexits.h>
#include <mach/mach.h> #include <mach/mach.h>
#include <mach/mach_error.h> #include <mach/mach_error.h>

View file

@ -22,9 +22,8 @@
/* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */ /* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */
#include <stdlib.h> #include "SDL_stdlib.h"
#include <stdio.h> /* For the definition of NULL */ #include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_joystick.h" #include "SDL_joystick.h"
#include "SDL_sysjoystick.h" #include "SDL_sysjoystick.h"

View file

@ -22,9 +22,6 @@
/* This is the system specific header for the SDL joystick API */ /* This is the system specific header for the SDL joystick API */
#include <stdio.h> /* For the definition of NULL */
#include <stdlib.h> /* For SDL_getenv() prototype */
#include <string.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
@ -38,6 +35,8 @@
#include <linux/input.h> #include <linux/input.h>
#endif #endif
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_joystick.h" #include "SDL_joystick.h"
#include "SDL_sysjoystick.h" #include "SDL_sysjoystick.h"
@ -325,7 +324,7 @@ int SDL_SYS_JoystickInit(void)
for ( i=0; i<SDL_TABLESIZE(joydev_pattern); ++i ) { for ( i=0; i<SDL_TABLESIZE(joydev_pattern); ++i ) {
for ( j=0; j < MAX_JOYSTICKS; ++j ) { for ( j=0; j < MAX_JOYSTICKS; ++j ) {
sprintf(path, joydev_pattern[i], j); SDL_snprintf(path, SDL_arraysize(path), joydev_pattern[i], j);
/* rcg06302000 replaced access(F_OK) call with stat(). /* rcg06302000 replaced access(F_OK) call with stat().
* stat() will fail if the file doesn't exist, so it's * stat() will fail if the file doesn't exist, so it's

View file

@ -26,13 +26,11 @@
* Patrice Mandin * Patrice Mandin
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mint/cookie.h> #include <mint/cookie.h>
#include <mint/osbind.h> #include <mint/osbind.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_types.h" #include "SDL_types.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_joystick.h" #include "SDL_joystick.h"

View file

@ -22,8 +22,6 @@
/* OS/2 Joystick driver, contributed by Daniel Caetano */ /* OS/2 Joystick driver, contributed by Daniel Caetano */
#include <stdlib.h>
#include <stdio.h>
#include <mem.h> #include <mem.h>
#define INCL_DOSDEVICES #define INCL_DOSDEVICES
@ -32,6 +30,8 @@
#include <os2.h> #include <os2.h>
#include "joyos2.h" #include "joyos2.h"
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_joystick.h" #include "SDL_joystick.h"
#include "SDL_sysjoystick.h" #include "SDL_sysjoystick.h"
@ -217,7 +217,7 @@ if (numdevs > 0)
if (joycfg.buttons>=7) SYS_JoyData[0].buttoncalc[2]=((axis[2]->upper+axis[3]->centre)>>1); if (joycfg.buttons>=7) SYS_JoyData[0].buttoncalc[2]=((axis[2]->upper+axis[3]->centre)>>1);
if (joycfg.buttons>=8) SYS_JoyData[0].buttoncalc[3]=((axis[3]->upper+axis[3]->centre)>>1); if (joycfg.buttons>=8) SYS_JoyData[0].buttoncalc[3]=((axis[3]->upper+axis[3]->centre)>>1);
/* Intialize Joystick Name */ /* Intialize Joystick Name */
strcpy (SYS_JoyData[0].szDeviceName,joycfg.name); SDL_strcpy (SYS_JoyData[0].szDeviceName,joycfg.name);
} }
/* Default Init ... autoconfig */ /* Default Init ... autoconfig */
else else
@ -294,7 +294,8 @@ if (numdevs > 0)
} }
/* Hack to define Joystick Port Names */ /* Hack to define Joystick Port Names */
if ( numdevs > maxdevs ) numdevs = maxdevs; if ( numdevs > maxdevs ) numdevs = maxdevs;
for (i=0; i<numdevs; i++) sprintf (SYS_JoyData[i].szDeviceName,"Default Joystick %c",'A'+SYS_JoyData[i].id); for (i=0; i<numdevs; i++) {
SDL_sprintf (SYS_JoyData[i].szDeviceName, SDL_arraysize(szDeviceName), "Default Joystick %c", 'A'+SYS_JoyData[i].id);
} }
} }
/* Return the number of devices found */ /* Return the number of devices found */

View file

@ -29,9 +29,8 @@
/* This is the system specific header for the SDL joystick API */ /* This is the system specific header for the SDL joystick API */
#include <stdio.h> /* For the definition of NULL */ #include "SDL_stdlib.h"
#include <stdlib.h> #include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_joystick.h" #include "SDL_joystick.h"
#include "SDL_sysjoystick.h" #include "SDL_sysjoystick.h"

View file

@ -22,11 +22,11 @@
/* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */ /* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_events.h" #include "SDL_events.h"
#include "SDL_joystick.h" #include "SDL_joystick.h"
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_sysjoystick.h" #include "SDL_sysjoystick.h"
#include "SDL_joystick_c.h" #include "SDL_joystick_c.h"

View file

@ -62,9 +62,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include <pthread.h> #include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <stdarg.h> #include <stdarg.h>
@ -73,6 +70,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <mach-o/nlist.h> #include <mach-o/nlist.h>
#include <mach-o/getsect.h> #include <mach-o/getsect.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
/* Just playing to see if it would compile with the freebsd headers, it does, /* Just playing to see if it would compile with the freebsd headers, it does,
* but because of the different values for RTLD_LOCAL etc, it would break binary * but because of the different values for RTLD_LOCAL etc, it would break binary
* compat... oh well * compat... oh well
@ -390,14 +390,14 @@ static const char *getSearchPath(int i)
} }
if (!path) if (!path)
{ {
path = (char **)calloc(MAX_SEARCH_PATHS, sizeof(char **)); path = (char **)SDL_calloc(MAX_SEARCH_PATHS, sizeof(char **));
} }
if (!list && !end) if (!list && !end)
list = searchList(); list = searchList();
if (i >= (numsize)) if (i >= (numsize))
{ {
debug("Increasing size for long PATH"); debug("Increasing size for long PATH");
tmp = (char **)calloc((MAX_SEARCH_PATHS + numsize), sizeof(char **)); tmp = (char **)SDL_calloc((MAX_SEARCH_PATHS + numsize), sizeof(char **));
if (tmp) if (tmp)
{ {
SDL_memcpy(tmp, path, sizeof(char **) * numsize); SDL_memcpy(tmp, path, sizeof(char **) * numsize);
@ -515,7 +515,7 @@ static struct dlstatus *allocStatus()
dls = dls->next; dls = dls->next;
if (!dls) if (!dls)
#endif #endif
dls = calloc(sizeof(*dls),1); dls = SDL_calloc(sizeof(*dls),1);
return dls; return dls;
} }
@ -1017,7 +1017,7 @@ static void *SDL_OSX_dlsym(void * dl_restrict handle, const char * dl_restrict s
malloc_sym = SDL_malloc(sym_len + 2); malloc_sym = SDL_malloc(sym_len + 2);
if (malloc_sym) if (malloc_sym)
{ {
sprintf(malloc_sym, "_%s", symbol); SDL_sprintf(malloc_sym, sym_len+2, "_%s", symbol);
value = dlsymIntern(handle, malloc_sym, 1); value = dlsymIntern(handle, malloc_sym, 1);
SDL_free(malloc_sym); SDL_free(malloc_sym);
} }
@ -1062,7 +1062,7 @@ static void *dlsym_prepend_underscore_intern(void *handle, const char *symbol)
malloc_sym = SDL_malloc(sym_len + 2); malloc_sym = SDL_malloc(sym_len + 2);
if (malloc_sym) if (malloc_sym)
{ {
sprintf(malloc_sym, "_%s", symbol); SDL_snprintf(malloc_sym, sym_len+2, "_%s", symbol);
value = dlsymIntern(handle, malloc_sym, 1); value = dlsymIntern(handle, malloc_sym, 1);
SDL_free(malloc_sym); SDL_free(malloc_sym);
} }
@ -1347,7 +1347,7 @@ static dlfunc_t SDL_OSX_dlfunc(void * dl_restrict handle, const char * dl_restri
malloc_sym = SDL_malloc(sym_len + 2); malloc_sym = SDL_malloc(sym_len + 2);
if (malloc_sym) if (malloc_sym)
{ {
sprintf(malloc_sym, "_%s", symbol); SDL_snprintf(malloc_sym, sym_len+2, "_%s", symbol);
rv.d = dlsymIntern(handle, malloc_sym, 1); rv.d = dlsymIntern(handle, malloc_sym, 1);
SDL_free(malloc_sym); SDL_free(malloc_sym);
} }

View file

@ -25,8 +25,6 @@
#include <AppKit.h> #include <AppKit.h>
#include <storage/Path.h> #include <storage/Path.h>
#include <storage/Entry.h> #include <storage/Entry.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h> #include <unistd.h>
#include "SDL_BeApp.h" #include "SDL_BeApp.h"

View file

@ -589,7 +589,7 @@ int main(int argc, char *argv[])
/* Parse C-string into argv and argc */ /* Parse C-string into argv and argc */
nargs = ParseCommandLine (commandLine, NULL); nargs = ParseCommandLine (commandLine, NULL);
args = (char **)SDL_malloc((nargs+1)*(sizeof *args)); args = (char **)malloc((nargs+1)*(sizeof *args));
if ( args == NULL ) { if ( args == NULL ) {
exit(-1); exit(-1);
} }

View file

@ -29,19 +29,14 @@
#ifndef HAVE_MALLOC #ifndef HAVE_MALLOC
#define LACKS_STDIO_H #define LACKS_STDIO_H
#define LACKS_UNISTD_H
#define LACKS_FCNTL_H
#define LACKS_SYS_PARAM_H
#define LACKS_SYS_MMAN_H
#define LACKS_STRINGS_H #define LACKS_STRINGS_H
#define LACKS_STRING_H #define LACKS_STRING_H
#define LACKS_SYS_TYPES_H
#define LACKS_ERRNO_H
#define LACKS_STDLIB_H #define LACKS_STDLIB_H
#define ABORT #define ABORT
#define memset SDL_memset #define memset SDL_memset
#define memcpy SDL_memcpy #define memcpy SDL_memcpy
#define malloc SDL_malloc #define malloc SDL_malloc
#define calloc SDL_calloc
#define realloc SDL_realloc #define realloc SDL_realloc
#define free SDL_free #define free SDL_free

View file

@ -343,7 +343,8 @@ char *SDL_strupr(char *string)
{ {
char *bufp = string; char *bufp = string;
while ( *bufp ) { while ( *bufp ) {
*bufp++ = toupper(*bufp); *bufp = toupper(*bufp);
++bufp;
} }
return string; return string;
} }
@ -354,7 +355,8 @@ char *SDL_strlwr(char *string)
{ {
char *bufp = string; char *bufp = string;
while ( *bufp ) { while ( *bufp ) {
*bufp++ = tolower(*bufp); *bufp = tolower(*bufp);
++bufp;
} }
return string; return string;
} }
@ -367,6 +369,7 @@ char *SDL_strchr(const char *string, int c)
if ( *string == c ) { if ( *string == c ) {
return (char *)string; return (char *)string;
} }
++string;
} }
return NULL; return NULL;
} }
@ -380,6 +383,7 @@ char *SDL_strrchr(const char *string, int c)
if ( *bufp == c ) { if ( *bufp == c ) {
return (char *)bufp; return (char *)bufp;
} }
--bufp;
} }
return NULL; return NULL;
} }
@ -393,6 +397,7 @@ char *SDL_strstr(const char *haystack, const char *needle)
if ( SDL_strncmp(haystack, needle, length) == 0 ) { if ( SDL_strncmp(haystack, needle, length) == 0 ) {
return (char *)haystack; return (char *)haystack;
} }
++haystack;
} }
return NULL; return NULL;
} }

View file

@ -22,11 +22,11 @@
/* System independent thread management routines for SDL */ /* System independent thread management routines for SDL */
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_mutex.h" #include "SDL_mutex.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_thread_c.h" #include "SDL_thread_c.h"
#include "SDL_systhread.h" #include "SDL_systhread.h"

View file

@ -102,7 +102,7 @@ int SDL_SYS_CreateThread(SDL_Thread *thread, void *args)
D(bug("Sending %lx to the new thread...\n",args)); D(bug("Sending %lx to the new thread...\n",args));
if(args) if(args)
sprintf(buffer,"%ld",args); SDL_snprintf(buffer, SDL_arraysize(buffer),"%ld",args);
#ifdef STORMC4_WOS #ifdef STORMC4_WOS
thread->handle=CreateTaskPPCTags(TASKATTR_CODE, RunThread, thread->handle=CreateTaskPPCTags(TASKATTR_CODE, RunThread,

View file

@ -31,9 +31,6 @@
#include <inline/exec.h> #include <inline/exec.h>
#endif #endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mydebug.h" #include "mydebug.h"
extern struct ExecBase *SysBase; extern struct ExecBase *SysBase;

View file

@ -22,10 +22,8 @@
/* System independent thread management routines for SDL */ /* System independent thread management routines for SDL */
#include <stdio.h> #include "SDL_stdlib.h"
#include <stdlib.h> #include "SDL_string.h"
#include <string.h>
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_mutex.h" #include "SDL_mutex.h"
#include "SDL_thread.h" #include "SDL_thread.h"

View file

@ -20,15 +20,13 @@
slouken@libsdl.org slouken@libsdl.org
*/ */
#include <stdlib.h> #include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_timer.h" #include "SDL_timer.h"
#ifdef SDL_USE_PTHREADS #ifdef SDL_USE_PTHREADS
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> /* For getpid() */ #include <unistd.h> /* For getpid() */
#include <pthread.h> #include <pthread.h>

View file

@ -26,9 +26,7 @@
implementation, written by Christopher Tate and Owen Smith. Thanks! implementation, written by Christopher Tate and Owen Smith. Thanks!
*/ */
#include <stdio.h> #include "SDL_stdlib.h"
#include <stdlib.h>
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"

View file

@ -22,9 +22,7 @@
/* An implementation of mutexes using semaphores */ /* An implementation of mutexes using semaphores */
#include <stdio.h> #include "SDL_stdlib.h"
#include <stdlib.h>
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_systhread_c.h" #include "SDL_systhread_c.h"

View file

@ -22,8 +22,6 @@
/* An implementation of semaphores using mutexes and condition variables */ /* An implementation of semaphores using mutexes and condition variables */
#include <stdlib.h>
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_timer.h" #include "SDL_timer.h"
#include "SDL_thread.h" #include "SDL_thread.h"

View file

@ -29,9 +29,6 @@
/* Mutex functions using the Win32 API */ /* Mutex functions using the Win32 API */
//#include <stdio.h>
//#include <stdlib.h>
#include<e32std.h> #include<e32std.h>
#include "SDL_error.h" #include "SDL_error.h"

View file

@ -28,8 +28,6 @@
/* Semaphore functions using the Win32 API */ /* Semaphore functions using the Win32 API */
//#include <stdio.h>
//#include <stdlib.h>
#include <e32std.h> #include <e32std.h>
#include "SDL_error.h" #include "SDL_error.h"

View file

@ -28,10 +28,6 @@
*/ */
//#include <stdlib.h>
//#include <stdio.h>
extern "C" { extern "C" {
#undef NULL #undef NULL
#include "SDL_error.h" #include "SDL_error.h"

View file

@ -26,9 +26,9 @@
implementation, written by Christopher Tate and Owen Smith. Thanks! implementation, written by Christopher Tate and Owen Smith. Thanks!
*/ */
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_stdlib.h"
struct SDL_cond struct SDL_cond
{ {

View file

@ -22,9 +22,9 @@
/* An implementation of mutexes using semaphores */ /* An implementation of mutexes using semaphores */
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_stdlib.h"
#include "SDL_systhread_c.h" #include "SDL_systhread_c.h"

View file

@ -22,10 +22,10 @@
/* An implementation of semaphores using mutexes and condition variables */ /* An implementation of semaphores using mutexes and condition variables */
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_timer.h" #include "SDL_timer.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_stdlib.h"
#include "SDL_systhread_c.h" #include "SDL_systhread_c.h"

View file

@ -22,7 +22,6 @@
/* IRIX thread management routines for SDL */ /* IRIX thread management routines for SDL */
#include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <sys/types.h> #include <sys/types.h>

View file

@ -40,9 +40,9 @@
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h>
#include <pthread.h> #include <pthread.h>
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_sysmutex_c.h" #include "SDL_sysmutex_c.h"

View file

@ -37,10 +37,9 @@
#ifdef SDL_USE_PTHREADS #ifdef SDL_USE_PTHREADS
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h> #include <pthread.h>
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
@ -59,7 +58,7 @@ SDL_mutex *SDL_CreateMutex (void)
pthread_mutexattr_t attr; pthread_mutexattr_t attr;
/* Allocate the structure */ /* Allocate the structure */
mutex = (SDL_mutex *)calloc(1, sizeof(*mutex)); mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex));
if ( mutex ) { if ( mutex ) {
pthread_mutexattr_init(&attr); pthread_mutexattr_init(&attr);
#if defined(PTHREAD_RECURSIVE_MUTEX) #if defined(PTHREAD_RECURSIVE_MUTEX)

View file

@ -20,7 +20,7 @@
slouken@libsdl.org slouken@libsdl.org
*/ */
#include <stdlib.h> #include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_timer.h" #include "SDL_timer.h"
@ -46,9 +46,6 @@
#include "generic/SDL_syssem.c" #include "generic/SDL_syssem.c"
#else #else
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> /* For getpid() */
#include <pthread.h> #include <pthread.h>
#include <semaphore.h> #include <semaphore.h>
@ -74,7 +71,7 @@ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
static int semnum = 0; static int semnum = 0;
char name[32]; char name[32];
sprintf(name, "/SDL_sem-%d-%4.4d", getpid(), semnum++); SDL_snprintf(name, SDL_arraysize(name), "/SDL_sem-%d-%4.4d", getpid(), semnum++);
sem->sem = sem_open(name, O_CREAT, 0600, initial_value); sem->sem = sem_open(name, O_CREAT, 0600, initial_value);
if ( sem->sem == (sem_t *)SEM_FAILED ) { if ( sem->sem == (sem_t *)SEM_FAILED ) {
SDL_SetError("sem_open(%s) failed", name); SDL_SetError("sem_open(%s) failed", name);

View file

@ -22,6 +22,7 @@
/* Linux thread management routines for SDL */ /* Linux thread management routines for SDL */
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_systhread.h" #include "SDL_systhread.h"
@ -138,7 +139,6 @@ void SDL_SYS_KillThread(SDL_Thread *thread)
#else /* Linux-specific clone() based implementation */ #else /* Linux-specific clone() based implementation */
#include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <sys/wait.h> #include <sys/wait.h>
@ -227,7 +227,7 @@ void SDL_SYS_WaitThread(SDL_Thread *thread)
*/ */
char command[1024]; char command[1024];
sprintf(command, SDL_snprintf(command, SDL_arraysize(command),
"ps ax|fgrep -v fgrep|fgrep -v '<zombie>'|fgrep %d >/dev/null", "ps ax|fgrep -v fgrep|fgrep -v '<zombie>'|fgrep %d >/dev/null",
thread->handle); thread->handle);
while ( system(command) == 0 ) while ( system(command) == 0 )

View file

@ -26,9 +26,7 @@
implementation, written by Christopher Tate and Owen Smith. Thanks! implementation, written by Christopher Tate and Owen Smith. Thanks!
*/ */
#include <stdio.h> #include "SDL_stdlib.h"
#include <stdlib.h>
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"

View file

@ -22,12 +22,11 @@
/* Mutex functions using the OS/2 API */ /* Mutex functions using the OS/2 API */
#include <stdio.h>
#include <stdlib.h>
#define INCL_DOSERRORS #define INCL_DOSERRORS
#define INCL_DOSSEMAPHORES #define INCL_DOSSEMAPHORES
#include <os2.h> #include <os2.h>
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_mutex.h" #include "SDL_mutex.h"

View file

@ -22,13 +22,12 @@
/* Semaphore functions using the OS/2 API */ /* Semaphore functions using the OS/2 API */
#include <stdio.h>
#include <stdlib.h>
#define INCL_DOS #define INCL_DOS
#define INCL_DOSERRORS #define INCL_DOSERRORS
#define INCL_DOSSEMAPHORES #define INCL_DOSSEMAPHORES
#include <os2.h> #include <os2.h>
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_timer.h" #include "SDL_timer.h"

View file

@ -22,13 +22,12 @@
/* OS/2 thread management routines for SDL */ /* OS/2 thread management routines for SDL */
#include <stdio.h>
#include <stdlib.h>
#include <process.h> #include <process.h>
#define INCL_DOSERRORS #define INCL_DOSERRORS
#define INCL_DOSPROCESS #define INCL_DOSPROCESS
#include <os2.h> #include <os2.h>
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_systhread.h" #include "SDL_systhread.h"

View file

@ -4,10 +4,9 @@
* Patrice Mandin * Patrice Mandin
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <pth.h> #include <pth.h>
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_syscond_c.h" #include "SDL_syscond_c.h"

View file

@ -4,10 +4,9 @@
* Patrice Mandin * Patrice Mandin
*/ */
#include <stdio.h>
#include <stdlib.h>
#include <pth.h> #include <pth.h>
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_mutex.h" #include "SDL_mutex.h"
#include "SDL_sysmutex_c.h" #include "SDL_sysmutex_c.h"

View file

@ -27,10 +27,9 @@
#else #else
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <pthread.h> #include <pthread.h>
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_sysmutex_c.h" #include "SDL_sysmutex_c.h"

View file

@ -26,10 +26,9 @@
#include "../generic/SDL_sysmutex.c" #include "../generic/SDL_sysmutex.c"
#else #else
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h> #include <pthread.h>
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
@ -47,7 +46,7 @@ SDL_mutex *SDL_CreateMutex (void)
pthread_mutexattr_t attr; pthread_mutexattr_t attr;
/* Allocate the structure */ /* Allocate the structure */
mutex = (SDL_mutex *)calloc(1, sizeof(*mutex)); mutex = (SDL_mutex *)SDL_calloc(1, sizeof(*mutex));
if ( mutex ) { if ( mutex ) {
pthread_mutexattr_init(&attr); pthread_mutexattr_init(&attr);
#ifdef PTHREAD_NO_RECURSIVE_MUTEX #ifdef PTHREAD_NO_RECURSIVE_MUTEX

View file

@ -23,12 +23,10 @@
/* RISC OS semiphores based on linux code */ /* RISC OS semiphores based on linux code */
#include <stdlib.h> #include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_timer.h" #include "SDL_timer.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_systhread_c.h" #include "SDL_systhread_c.h"
#ifdef DISABLE_THREADS #ifdef DISABLE_THREADS
@ -76,8 +74,6 @@ int SDL_SemPost(SDL_sem *sem)
#else #else
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h> /* For getpid() */ #include <unistd.h> /* For getpid() */
#include <pthread.h> #include <pthread.h>
#include <semaphore.h> #include <semaphore.h>

View file

@ -24,9 +24,9 @@
#include "SDL_windows.h" #include "SDL_windows.h"
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_mutex.h" #include "SDL_mutex.h"
#include "SDL_stdlib.h"
struct SDL_mutex { struct SDL_mutex {

View file

@ -24,9 +24,9 @@
#include "SDL_windows.h" #include "SDL_windows.h"
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_stdlib.h"
#if defined(_WIN32_WCE) && (_WIN32_WCE < 300) #if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
#include "win_ce_semaphore.h" #include "win_ce_semaphore.h"
#endif #endif

View file

@ -24,9 +24,9 @@
#include "SDL_windows.h" #include "SDL_windows.h"
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_thread.h" #include "SDL_thread.h"
#include "SDL_stdlib.h"
#include "SDL_systhread.h" #include "SDL_systhread.h"
typedef struct ThreadStartParms typedef struct ThreadStartParms

View file

@ -20,9 +20,9 @@
slouken@libsdl.org slouken@libsdl.org
*/ */
#include "SDL_stdlib.h"
#include "SDL_error.h" #include "SDL_error.h"
#include "SDL_timer.h" #include "SDL_timer.h"
#include "SDL_stdlib.h"
#include "SDL_timer_c.h" #include "SDL_timer_c.h"
#include "SDL_mutex.h" #include "SDL_mutex.h"
#include "SDL_systimer.h" #include "SDL_systimer.h"

View file

@ -86,10 +86,10 @@
*/ */
#include "SDL_types.h" #include "SDL_types.h"
#include "SDL_video.h"
#include "SDL_error.h"
#include "SDL_stdlib.h" #include "SDL_stdlib.h"
#include "SDL_string.h" #include "SDL_string.h"
#include "SDL_video.h"
#include "SDL_error.h"
#include "SDL_sysvideo.h" #include "SDL_sysvideo.h"
#include "SDL_blit.h" #include "SDL_blit.h"
#include "SDL_RLEaccel_c.h" #include "SDL_RLEaccel_c.h"

View file

@ -32,8 +32,7 @@
#ifdef HAVE_ALTIVEC_H #ifdef HAVE_ALTIVEC_H
#include <altivec.h> #include <altivec.h>
#endif #endif
#include <assert.h> #define assert(X)
#include <stdlib.h>
#ifdef MACOSX #ifdef MACOSX
#include <sys/sysctl.h> #include <sys/sysctl.h>
static size_t GetL3CacheSize( void ) static size_t GetL3CacheSize( void )
@ -235,7 +234,6 @@ static void Blit_RGB888_RGB565Altivec(SDL_BlitInfo *info) {
assert(width == 0); assert(width == 0);
/* do scalar until we can align... */ /* do scalar until we can align... */
ONE_PIXEL_BLEND((extrawidth), extrawidth); ONE_PIXEL_BLEND((extrawidth), extrawidth);
#undef ONE_PIXEL_BLEND #undef ONE_PIXEL_BLEND

Some files were not shown because too many files have changed in this diff Show more