Removed uses of stdlib.h and string.h
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401342
This commit is contained in:
parent
098fe1b8e9
commit
09cd73f1b5
192 changed files with 455 additions and 666 deletions
|
@ -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"
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -29,9 +29,6 @@
|
|||
|
||||
/* Mutex functions using the Win32 API */
|
||||
|
||||
//#include <stdio.h>
|
||||
//#include <stdlib.h>
|
||||
|
||||
#include<e32std.h>
|
||||
|
||||
#include "SDL_error.h"
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
|
||||
/* Semaphore functions using the Win32 API */
|
||||
|
||||
//#include <stdio.h>
|
||||
//#include <stdlib.h>
|
||||
#include <e32std.h>
|
||||
|
||||
#include "SDL_error.h"
|
||||
|
|
|
@ -28,10 +28,6 @@
|
|||
*/
|
||||
|
||||
|
||||
//#include <stdlib.h>
|
||||
//#include <stdio.h>
|
||||
|
||||
|
||||
extern "C" {
|
||||
#undef NULL
|
||||
#include "SDL_error.h"
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
/* IRIX thread management routines for SDL */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue