Skip to content

Commit

Permalink
Removed dependencies on standard C runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jun 15, 2015
1 parent bfbc062 commit e5b7d17
Show file tree
Hide file tree
Showing 5 changed files with 4,944 additions and 4,939 deletions.
6 changes: 3 additions & 3 deletions IMG.c
Expand Up @@ -128,7 +128,7 @@ void IMG_Quit()
SDL_Surface *IMG_Load(const char *file)
{
SDL_RWops *src = SDL_RWFromFile(file, "rb");
const char *ext = strrchr(file, '.');
const char *ext = SDL_strrchr(file, '.');
if(ext) {
ext++;
}
Expand All @@ -150,8 +150,8 @@ SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc)
static int IMG_string_equals(const char *str1, const char *str2)
{
while ( *str1 && *str2 ) {
if ( toupper((unsigned char)*str1) !=
toupper((unsigned char)*str2) )
if ( SDL_toupper((unsigned char)*str1) !=
SDL_toupper((unsigned char)*str2) )
break;
++str1;
++str2;
Expand Down
2 changes: 1 addition & 1 deletion IMG_lbm.c
Expand Up @@ -383,7 +383,7 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )

for ( i=0; i < size; i++ )
{
memset( ptr, 0, 8 );
SDL_memset( ptr, 0, 8 );

for ( plane=0; plane < (nbplanes + stencil); plane++ )
{
Expand Down
4 changes: 2 additions & 2 deletions IMG_pnm.c
Expand Up @@ -88,7 +88,7 @@ static int ReadNumber(SDL_RWops *src)
}
} while ( (ch != '\r') && (ch != '\n') );
}
} while ( isspace(ch) );
} while ( SDL_isspace(ch) );

/* Add up the number */
do {
Expand All @@ -98,7 +98,7 @@ static int ReadNumber(SDL_RWops *src)
if ( !SDL_RWread(src, &ch, 1, 1) ) {
return -1;
}
} while ( isdigit(ch) );
} while ( SDL_isdigit(ch) );

return(number);
}
Expand Down
4 changes: 2 additions & 2 deletions IMG_xpm.c
Expand Up @@ -122,7 +122,7 @@ static struct color_hash *create_colorhash(int maxnum)
SDL_free(hash);
return NULL;
}
memset(hash->table, 0, bytes);
SDL_memset(hash->table, 0, bytes);
hash->entries = (struct hash_entry *)SDL_malloc(maxnum * sizeof(struct hash_entry));
if (!hash->entries) {
SDL_free(hash->table);
Expand Down Expand Up @@ -888,7 +888,7 @@ static int color_to_rgb(char *spec, int speclen, Uint32 *rgb)
break;
}
buf[6] = '\0';
*rgb = strtol(buf, NULL, 16);
*rgb = SDL_strtol(buf, NULL, 16);
return 1;
} else {
int i;
Expand Down

0 comments on commit e5b7d17

Please sign in to comment.