Fixed build problem with SDL_string.c

Officially deprecated SDL_byteorder.h, SDL_getenv.h and SDL_types.h
Moved endian-related SDL_rwops code into SDL_rwops.c
This commit is contained in:
Sam Lantinga
2006-02-09 09:38:05 +00:00
parent 8df54cd371
commit 20c4849e7e
19 changed files with 261 additions and 256 deletions

View File

@@ -20,8 +20,7 @@
slouken@libsdl.org
*/
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_stdinc.h"
#ifndef HAVE_GETENV

View File

@@ -23,8 +23,7 @@
/* This file contains portable memory management functions for SDL */
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_stdinc.h"
#ifndef HAVE_MALLOC

View File

@@ -47,8 +47,7 @@
#include <stdlib.h>
#include <string.h>
*/
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_stdinc.h"
#define assert(X)
#define malloc SDL_malloc

View File

@@ -23,7 +23,7 @@
/* This file contains portable stdlib functions for SDL */
#include "SDL_stdlib.h"
#include "SDL_stdinc.h"
#ifndef HAVE_LIBC
/* These are some C runtime intrinsics that need to be defined */

View File

@@ -23,14 +23,11 @@
/* This file contains portable string manipulation functions for SDL */
#include "SDL_types.h"
#include "SDL_ctype.h"
#include "SDL_stdlib.h"
#include "SDL_string.h"
#include "SDL_stdinc.h"
#define isupperhex(X) (((X) >= 'A') && ((X) <= 'F'))
#define islowerhex(X) (((X) >= 'a') && ((X) <= 'f'))
#define SDL_isupperhex(X) (((X) >= 'A') && ((X) <= 'F'))
#define SDL_islowerhex(X) (((X) >= 'a') && ((X) <= 'f'))
#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOL)
static size_t SDL_ScanLong(const char *text, int radix, long *valuep)
@@ -48,11 +45,11 @@ static size_t SDL_ScanLong(const char *text, int radix, long *valuep)
}
for ( ; ; ) {
int v;
if ( isdigit(*text) ) {
if ( SDL_isdigit(*text) ) {
v = *text - '0';
} else if ( radix == 16 && isupperhex(*text) ) {
} else if ( radix == 16 && SDL_isupperhex(*text) ) {
v = 10 + (*text - 'A');
} else if ( radix == 16 && islowerhex(*text) ) {
} else if ( radix == 16 && SDL_islowerhex(*text) ) {
v = 10 + (*text - 'a');
} else {
break;
@@ -83,11 +80,11 @@ static size_t SDL_ScanUnsignedLong(const char *text, int radix, unsigned long *v
}
for ( ; ; ) {
int v;
if ( isdigit(*text) ) {
if ( SDL_isdigit(*text) ) {
v = *text - '0';
} else if ( radix == 16 && isupperhex(*text) ) {
} else if ( radix == 16 && SDL_isupperhex(*text) ) {
v = 10 + (*text - 'A');
} else if ( radix == 16 && islowerhex(*text) ) {
} else if ( radix == 16 && SDL_islowerhex(*text) ) {
v = 10 + (*text - 'a');
} else {
break;
@@ -120,11 +117,11 @@ static size_t SDL_ScanLongLong(const char *text, int radix, Sint64 *valuep)
}
for ( ; ; ) {
int v;
if ( isdigit(*text) ) {
if ( SDL_isdigit(*text) ) {
v = *text - '0';
} else if ( radix == 16 && isupperhex(*text) ) {
} else if ( radix == 16 && SDL_isupperhex(*text) ) {
v = 10 + (*text - 'A');
} else if ( radix == 16 && islowerhex(*text) ) {
} else if ( radix == 16 && SDL_islowerhex(*text) ) {
v = 10 + (*text - 'a');
} else {
break;
@@ -155,11 +152,11 @@ static size_t SDL_ScanUnsignedLongLong(const char *text, int radix, Uint64 *valu
}
for ( ; ; ) {
int v;
if ( isdigit(*text) ) {
if ( SDL_isdigit(*text) ) {
v = *text - '0';
} else if ( radix == 16 && isupperhex(*text) ) {
} else if ( radix == 16 && SDL_isupperhex(*text) ) {
v = 10 + (*text - 'A');
} else if ( radix == 16 && islowerhex(*text) ) {
} else if ( radix == 16 && SDL_islowerhex(*text) ) {
v = 10 + (*text - 'a');
} else {
break;
@@ -193,7 +190,7 @@ static size_t SDL_ScanFloat(const char *text, double *valuep)
if ( *text == '.' ) {
int mult = 10;
++text;
while ( isdigit(*text) ) {
while ( SDL_isdigit(*text) ) {
lvalue = *text - '0';
value += (double)lvalue / mult;
mult *= 10;
@@ -632,7 +629,7 @@ int SDL_sscanf(const char *text, const char *fmt, ...)
va_start(ap, fmt);
while ( *fmt ) {
if ( *fmt == ' ' ) {
while ( isspace(*text) ) {
while ( SDL_isspace(*text) ) {
++text;
}
++fmt;
@@ -683,7 +680,7 @@ int SDL_sscanf(const char *text, const char *fmt, ...)
continue;
}
while ( isspace(*text) ) {
while ( SDL_isspace(*text) ) {
++text;
}
@@ -845,7 +842,7 @@ int SDL_sscanf(const char *text, const char *fmt, ...)
break;
case 's':
if ( suppress ) {
while ( !isspace(*text) ) {
while ( !SDL_isspace(*text) ) {
++text;
if ( count ) {
if ( --count == 0 ) {
@@ -855,7 +852,7 @@ int SDL_sscanf(const char *text, const char *fmt, ...)
}
} else {
char *valuep = va_arg(ap, char*);
while ( !isspace(*text) ) {
while ( !SDL_isspace(*text) ) {
*valuep++ = *text++;
if ( count ) {
if ( --count == 0 ) {