Corrected __PHYSFS_platformTell()'s return value to be correct.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 01 Aug 2011 17:56:30 -0400
changeset 1180 b463fbb66af9
parent 1176 367c1f9a996c
child 1181 af43226e45e6
Corrected __PHYSFS_platformTell()'s return value to be correct.
src/physfs_internal.h
src/platform_pocketpc.c
src/platform_windows.c
--- a/src/physfs_internal.h	Mon Aug 01 17:32:56 2011 -0400
+++ b/src/physfs_internal.h	Mon Aug 01 17:56:30 2011 -0400
@@ -1176,8 +1176,7 @@
  *
  * Not all file types can "tell"; this is to be expected by the caller.
  *
- * On error, call __PHYSFS_setError() and return zero. On success, return
- *  a non-zero value.
+ * On error, call __PHYSFS_setError() and return -1. On success, return >= 0.
  */
 PHYSFS_sint64 __PHYSFS_platformTell(void *opaque);
 
--- a/src/platform_pocketpc.c	Mon Aug 01 17:32:56 2011 -0400
+++ b/src/platform_pocketpc.c	Mon Aug 01 17:56:30 2011 -0400
@@ -409,7 +409,7 @@
     LowPos = SetFilePointer(Handle, 0, &HighPos, FILE_CURRENT);
     if ((LowPos == INVALID_SET_FILE_POINTER) && (GetLastError() != NO_ERROR))
     {
-        BAIL_MACRO(win32strerror(), 0);
+        BAIL_MACRO(win32strerror(), -1);
     } /* if */
     else
     {
--- a/src/platform_windows.c	Mon Aug 01 17:32:56 2011 -0400
+++ b/src/platform_windows.c	Mon Aug 01 17:56:30 2011 -0400
@@ -1051,7 +1051,7 @@
     if ( (LowPos == PHYSFS_INVALID_SET_FILE_POINTER) &&
          (GetLastError() != NO_ERROR) )
     {
-        BAIL_MACRO(winApiStrError(), 0);
+        BAIL_MACRO(winApiStrError(), -1);
     } /* if */
     else
     {