Fixed deprecation warning in physfsrwops
authorSam Lantinga <slouken@libsdl.org>
Tue, 18 Oct 2011 22:48:45 -0400
changeset 1192 586f4cdee6af
parent 1191 f02c977477b9
child 1193 e4cc35000826
Fixed deprecation warning in physfsrwops
extras/physfsrwops.c
--- a/extras/physfsrwops.c	Tue Oct 18 15:55:29 2011 -0400
+++ b/extras/physfsrwops.c	Tue Oct 18 22:48:45 2011 -0400
@@ -100,8 +100,8 @@
 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());
@@ -114,8 +114,8 @@
 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);