This file is part of MXE. See LICENSE.md for licensing information. This patch was adapted for PhysicsFS 2.0.3's file layout from https://hg.icculus.org/icculus/physfs/rev/67031168b061. # HG changeset patch # User David Yip # Date 1471367884 18000 # Tue Aug 16 12:18:04 2016 -0500 # Branch stable-2.0 # Node ID 990fd55ba0c4979db59888283c7dde6c359927e2 # Parent 34ebe997c5c07f57aff8e56695cd89856800d11d Replace unsigned long cast with cast to uintptr_t. When targeting MinGW-w64's x86_64 target, unsigned long is 4 bytes but void* is 8 bytes. This mismatch triggers the pointer-to-int-cast warning. diff -r 34ebe997c5c0 -r 990fd55ba0c4 archivers/lzma.c --- a/archivers/lzma.c Fri Jan 01 12:53:41 2016 -0500 +++ b/archivers/lzma.c Tue Aug 16 12:18:04 2016 -0500 @@ -9,6 +9,7 @@ #if (defined PHYSFS_SUPPORTS_7Z) +#include #include #include #include @@ -130,7 +131,7 @@ SZ_RESULT SzFileReadImp(void *object, void *buffer, size_t size, size_t *processedSize) { - FileInputStream *s = (FileInputStream *)((unsigned long)object - offsetof(FileInputStream, inStream)); /* HACK! */ + FileInputStream *s = (FileInputStream *)((uintptr_t)object - offsetof(FileInputStream, inStream)); /* HACK! */ size_t processedSizeLoc = __PHYSFS_platformRead(s->file, buffer, 1, size); if (processedSize != 0) *processedSize = processedSizeLoc; @@ -145,7 +146,7 @@ */ SZ_RESULT SzFileSeekImp(void *object, CFileSize pos) { - FileInputStream *s = (FileInputStream *)((unsigned long)object - offsetof(FileInputStream, inStream)); /* HACK! */ + FileInputStream *s = (FileInputStream *)((uintptr_t)object - offsetof(FileInputStream, inStream)); /* HACK! */ if (__PHYSFS_platformSeek(s->file, (PHYSFS_uint64) pos)) return SZ_OK; return SZE_FAIL;