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
#include "SDL.h"
#include "SDL_stdlib.h"
#include "SDL_endian.h"
#include "SDL_fatal.h"
#include "SDL_stdlib.h"
#ifndef DISABLE_VIDEO
#include "SDL_leaks.h"
#endif

View file

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

View file

@ -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],

View file

@ -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)

View file

@ -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"

View file

@ -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"

View file

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

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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;

View file

@ -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) ) {

View file

@ -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,7 +269,6 @@ 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);

View file

@ -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);

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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);

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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)

View file

@ -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"

View file

@ -22,10 +22,10 @@
/* 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_string.h"
#include "SDL_error.h"
#include "SDL_cdrom.h"
#include "SDL_syscdrom.h"
#if !defined(macintosh)

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -58,7 +58,7 @@ static int LoadTracks (SDL_CD *cdrom)
return 0;
/* 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) {
SDL_OutOfMemory ();
return -1;
@ -203,14 +203,14 @@ int SDL_SYS_CDInit (void)
}
/* Allocate space for volumes */
volumes = (FSVolumeRefNum*) calloc (1, sizeof(*volumes) * SDL_numcds);
volumes = (FSVolumeRefNum*) SDL_calloc (1, sizeof(*volumes) * SDL_numcds);
if (volumes == NULL) {
SDL_OutOfMemory ();
return -1;
}
/* 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) {
SDL_OutOfMemory ();
return -1;

View file

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

View file

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

View file

@ -25,10 +25,9 @@
#define INCL_MCIOS2
#include <os2.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_cdrom.h"
#include "SDL_syscdrom.h"

View file

@ -31,12 +31,9 @@
#include <io/cam/cdrom.h>
#include <io/cam/rzdisk.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_cdrom.h"
#include "SDL_syscdrom.h"
@ -218,7 +215,7 @@ int SDL_SYS_CDInit(void)
while (devent = readdir(devdir))
if (SDL_memcmp(checklist[i].name, devent->d_name, name_len) == 0)
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
fprintf(stderr, "Try to add drive: %s\n", drive);
#endif

View file

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

View file

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

View file

@ -24,10 +24,10 @@
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_string.h"
#include "SDL_error.h"
#include "SDL_rwops.h"
#ifdef HAVE_STDIO_H

View file

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

View file

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

View file

@ -22,15 +22,13 @@
/* 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/device/Joystick.h>
extern "C" {
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h"
#include "SDL_joystick.h"
#include "SDL_sysjoystick.h"

View file

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

View file

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

View file

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

View file

@ -22,9 +22,6 @@
/* 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 <unistd.h>
#include <fcntl.h>
@ -38,6 +35,8 @@
#include <linux/input.h>
#endif
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h"
#include "SDL_joystick.h"
#include "SDL_sysjoystick.h"
@ -325,7 +324,7 @@ int SDL_SYS_JoystickInit(void)
for ( i=0; i<SDL_TABLESIZE(joydev_pattern); ++i ) {
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().
* stat() will fail if the file doesn't exist, so it's

View file

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

View file

@ -22,8 +22,6 @@
/* OS/2 Joystick driver, contributed by Daniel Caetano */
#include <stdlib.h>
#include <stdio.h>
#include <mem.h>
#define INCL_DOSDEVICES
@ -32,6 +30,8 @@
#include <os2.h>
#include "joyos2.h"
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h"
#include "SDL_joystick.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>=8) SYS_JoyData[0].buttoncalc[3]=((axis[3]->upper+axis[3]->centre)>>1);
/* Intialize Joystick Name */
strcpy (SYS_JoyData[0].szDeviceName,joycfg.name);
SDL_strcpy (SYS_JoyData[0].szDeviceName,joycfg.name);
}
/* Default Init ... autoconfig */
else
@ -294,7 +294,8 @@ if (numdevs > 0)
}
/* Hack to define Joystick Port Names */
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 */

View file

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

View file

@ -22,11 +22,11 @@
/* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h"
#include "SDL_events.h"
#include "SDL_joystick.h"
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_sysjoystick.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 <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.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/getsect.h>
#include "SDL_stdlib.h"
#include "SDL_string.h"
/* 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
* compat... oh well
@ -390,14 +390,14 @@ static const char *getSearchPath(int i)
}
if (!path)
{
path = (char **)calloc(MAX_SEARCH_PATHS, sizeof(char **));
path = (char **)SDL_calloc(MAX_SEARCH_PATHS, sizeof(char **));
}
if (!list && !end)
list = searchList();
if (i >= (numsize))
{
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)
{
SDL_memcpy(tmp, path, sizeof(char **) * numsize);
@ -515,7 +515,7 @@ static struct dlstatus *allocStatus()
dls = dls->next;
if (!dls)
#endif
dls = calloc(sizeof(*dls),1);
dls = SDL_calloc(sizeof(*dls),1);
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);
if (malloc_sym)
{
sprintf(malloc_sym, "_%s", symbol);
SDL_sprintf(malloc_sym, sym_len+2, "_%s", symbol);
value = dlsymIntern(handle, malloc_sym, 1);
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);
if (malloc_sym)
{
sprintf(malloc_sym, "_%s", symbol);
SDL_snprintf(malloc_sym, sym_len+2, "_%s", symbol);
value = dlsymIntern(handle, malloc_sym, 1);
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);
if (malloc_sym)
{
sprintf(malloc_sym, "_%s", symbol);
SDL_snprintf(malloc_sym, sym_len+2, "_%s", symbol);
rv.d = dlsymIntern(handle, malloc_sym, 1);
SDL_free(malloc_sym);
}

View file

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

View file

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

View file

@ -29,19 +29,14 @@
#ifndef HAVE_MALLOC
#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_STRING_H
#define LACKS_SYS_TYPES_H
#define LACKS_ERRNO_H
#define LACKS_STDLIB_H
#define ABORT
#define memset SDL_memset
#define memcpy SDL_memcpy
#define malloc SDL_malloc
#define calloc SDL_calloc
#define realloc SDL_realloc
#define free SDL_free

View file

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

View file

@ -22,11 +22,11 @@
/* System independent thread management routines for SDL */
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_error.h"
#include "SDL_mutex.h"
#include "SDL_thread.h"
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_thread_c.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));
if(args)
sprintf(buffer,"%ld",args);
SDL_snprintf(buffer, SDL_arraysize(buffer),"%ld",args);
#ifdef STORMC4_WOS
thread->handle=CreateTaskPPCTags(TASKATTR_CODE, RunThread,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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