Skip to content

Commit

Permalink
Fixed deprecation warning in physfsrwops
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 19, 2011
1 parent 9d11b99 commit 9fb20ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions extras/physfsrwops.c
Expand Up @@ -100,8 +100,8 @@ static int physfsrwops_seek(SDL_RWops *rw, int offset, int whence)
static int physfsrwops_read(SDL_RWops *rw, void *ptr, int size, int maxnum)
{
PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1;
PHYSFS_sint64 rc = PHYSFS_read(handle, ptr, size, maxnum);
if (rc != maxnum)
PHYSFS_sint64 rc = PHYSFS_readBytes(handle, ptr, size*maxnum);
if (rc != (size*maxnum))
{
if (!PHYSFS_eof(handle)) /* not EOF? Must be an error. */
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());
Expand All @@ -114,8 +114,8 @@ static int physfsrwops_read(SDL_RWops *rw, void *ptr, int size, int maxnum)
static int physfsrwops_write(SDL_RWops *rw, const void *ptr, int size, int num)
{
PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1;
PHYSFS_sint64 rc = PHYSFS_write(handle, ptr, size, num);
if (rc != num)
PHYSFS_sint64 rc = PHYSFS_writeBytes(handle, ptr, size*num);
if (rc != (size*num))
SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError());

return ((int) rc);
Expand Down

0 comments on commit 9fb20ec

Please sign in to comment.