# HG changeset patch # User Wuzzy # Date 1532220387 -7200 # Node ID f8c0a62fa3ac27bb41b254a3f3e7edd2e04dc737 # Parent ecdf6ce2301e5540993d925ff4757335123bb6da Fix deprecation warnings in libphyslayer diff -r ecdf6ce2301e -r f8c0a62fa3ac misc/libphyslayer/physfsrwops.c --- a/misc/libphyslayer/physfsrwops.c Sun Jul 22 02:29:44 2018 +0200 +++ b/misc/libphyslayer/physfsrwops.c Sun Jul 22 02:46:27 2018 +0200 @@ -56,7 +56,7 @@ if (current == -1) { SDL_SetError("Can't find position in file: %s", - PHYSFS_getLastError()); + PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); return -1; } /* if */ @@ -77,7 +77,7 @@ const PHYSFS_sint64 len = PHYSFS_fileLength(handle); if (len == -1) { - SDL_SetError("Can't find end of file: %s", PHYSFS_getLastError()); + SDL_SetError("Can't find end of file: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); return -1; } /* if */ @@ -98,7 +98,7 @@ if (!PHYSFS_seek(handle, (PHYSFS_uint64) pos)) { - SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); + SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); return -1; } /* if */ @@ -123,7 +123,7 @@ if (rc != ((PHYSFS_sint64) readlen)) { if (!PHYSFS_eof(handle)) /* not EOF? Must be an error. */ - SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); + SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); } /* if */ #if TARGET_SDL13 @@ -145,7 +145,7 @@ const PHYSFS_uint64 writelen = (PHYSFS_uint64) (num * size); const PHYSFS_sint64 rc = PHYSFS_writeBytes(handle, ptr, writelen); if (rc != ((PHYSFS_sint64) writelen)) - SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); + SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); #if TARGET_SDL13 return (size_t) rc; @@ -160,7 +160,7 @@ PHYSFS_File *handle = (PHYSFS_File *) rw->hidden.unknown.data1; if (!PHYSFS_close(handle)) { - SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); + SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); return -1; } /* if */ @@ -174,7 +174,7 @@ SDL_RWops *retval = NULL; if (handle == NULL) - SDL_SetError("PhysicsFS error: %s", PHYSFS_getLastError()); + SDL_SetError("PhysicsFS error: %s", PHYSFS_getErrorByCode(PHYSFS_getLastErrorCode())); else { retval = SDL_AllocRW(); diff -r ecdf6ce2301e -r f8c0a62fa3ac misc/libphyslayer/physfsrwops.h --- a/misc/libphyslayer/physfsrwops.h Sun Jul 22 02:29:44 2018 +0200 +++ b/misc/libphyslayer/physfsrwops.h Sun Jul 22 02:46:27 2018 +0200 @@ -41,7 +41,7 @@ * * @param filename File to open in platform-independent notation. * @return A valid SDL_RWops structure on success, NULL on error. Specifics - * of the error can be gleaned from PHYSFS_getLastError(). + * of the error can be gleaned from PHYSFS_getLastErrorCode(). */ PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openRead(const char *fname); @@ -53,7 +53,7 @@ * * @param filename File to open in platform-independent notation. * @return A valid SDL_RWops structure on success, NULL on error. Specifics - * of the error can be gleaned from PHYSFS_getLastError(). + * of the error can be gleaned from PHYSFS_getLastErrorCode(). */ PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openWrite(const char *fname); @@ -65,7 +65,7 @@ * * @param filename File to open in platform-independent notation. * @return A valid SDL_RWops structure on success, NULL on error. Specifics - * of the error can be gleaned from PHYSFS_getLastError(). + * of the error can be gleaned from PHYSFS_getLastErrorCode(). */ PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_openAppend(const char *fname); @@ -77,7 +77,7 @@ * * @param handle a valid PhysicsFS file handle. * @return A valid SDL_RWops structure on success, NULL on error. Specifics - * of the error can be gleaned from PHYSFS_getLastError(). + * of the error can be gleaned from PHYSFS_getLastErrorCode(). */ PHYSFS_DECL SDL_RWops *PHYSFSRWOPS_makeRWops(PHYSFS_File *handle);