src/file/SDL_rwops.c
changeset 1336 3692456e7b0f
parent 1330 450721ad5436
child 1338 604d73db6802
     1.1 --- a/src/file/SDL_rwops.c	Mon Feb 06 17:28:04 2006 +0000
     1.2 +++ b/src/file/SDL_rwops.c	Tue Feb 07 06:59:48 2006 +0000
     1.3 @@ -120,7 +120,7 @@
     1.4  		total_bytes = mem_available;
     1.5  	}
     1.6  
     1.7 -	memcpy(ptr, context->hidden.mem.here, total_bytes);
     1.8 +	SDL_memcpy(ptr, context->hidden.mem.here, total_bytes);
     1.9  	context->hidden.mem.here += total_bytes;
    1.10  
    1.11  	return (total_bytes / size);
    1.12 @@ -130,7 +130,7 @@
    1.13  	if ( (context->hidden.mem.here + (num*size)) > context->hidden.mem.stop ) {
    1.14  		num = (context->hidden.mem.stop-context->hidden.mem.here)/size;
    1.15  	}
    1.16 -	memcpy(context->hidden.mem.here, ptr, num*size);
    1.17 +	SDL_memcpy(context->hidden.mem.here, ptr, num*size);
    1.18  	context->hidden.mem.here += num*size;
    1.19  	return(num);
    1.20  }
    1.21 @@ -162,8 +162,8 @@
    1.22   */
    1.23  static char *unix_to_mac(const char *file)
    1.24  {
    1.25 -	int flen = strlen(file);
    1.26 -	char *path = malloc(flen + 2);
    1.27 +	int flen = SDL_strlen(file);
    1.28 +	char *path = SDL_malloc(flen + 2);
    1.29  	const char *src = file;
    1.30  	char *dst = path;
    1.31  	if(*src == '/') {
    1.32 @@ -175,7 +175,7 @@
    1.33  			*dst++ = ':';   /* relative paths begin with ':' */
    1.34  	}
    1.35  	while(src < file + flen) {
    1.36 -		const char *end = strchr(src, '/');
    1.37 +		const char *end = SDL_strchr(src, '/');
    1.38  		int len;
    1.39  		if(!end)
    1.40  			end = file + flen; /* last component */
    1.41 @@ -186,7 +186,7 @@
    1.42  			if(len == 2 && src[0] == '.' && src[1] == '.') {
    1.43  				/* replace .. with the empty string */
    1.44  			} else {
    1.45 -				memcpy(dst, src, len);
    1.46 +				SDL_memcpy(dst, src, len);
    1.47  				dst += len;
    1.48  			}
    1.49  			if(end < file + flen)
    1.50 @@ -209,7 +209,7 @@
    1.51  	{
    1.52  		char *mpath = unix_to_mac(file);
    1.53  		fp = fopen(mpath, mode);
    1.54 -		free(mpath);
    1.55 +		SDL_free(mpath);
    1.56  	}
    1.57  #else
    1.58  	fp = fopen(file, mode);
    1.59 @@ -292,7 +292,7 @@
    1.60  {
    1.61  	SDL_RWops *area;
    1.62  
    1.63 -	area = (SDL_RWops *)malloc(sizeof *area);
    1.64 +	area = (SDL_RWops *)SDL_malloc(sizeof *area);
    1.65  	if ( area == NULL ) {
    1.66  		SDL_OutOfMemory();
    1.67  	}
    1.68 @@ -301,5 +301,5 @@
    1.69  
    1.70  void SDL_FreeRW(SDL_RWops *area)
    1.71  {
    1.72 -	free(area);
    1.73 +	SDL_free(area);
    1.74  }