Removed uses of stdlib.h and string.h

This commit is contained in:
Sam Lantinga
2006-02-07 09:29:18 +00:00
parent c7319385b8
commit 1e037cc218
192 changed files with 455 additions and 666 deletions

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