platform/pocketpc.c
changeset 763 efadd9cdb6a4
parent 754 e7cd7411eadf
child 792 4c278733e281
--- a/platform/pocketpc.c	Mon Nov 28 13:28:33 2005 +0000
+++ b/platform/pocketpc.c	Sun Jan 01 12:19:44 2006 +0000
@@ -675,9 +675,7 @@
 
 void *__PHYSFS_platformAllocatorMalloc(PHYSFS_uint64 s)
 {
-    /* make sure s isn't larger than the address space of the platform... */
-    if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
-        BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
+    BAIL_IF_MACRO(__PHYSFS_ui64FitsAddressSpace(s), ERR_OUT_OF_MEMORY, NULL);
     #undef malloc
     return(malloc((size_t) s));
 } /* __PHYSFS_platformMalloc */
@@ -685,9 +683,7 @@
 
 void *__PHYSFS_platformAllocatorRealloc(void *ptr, PHYSFS_uint64 s)
 {
-    /* make sure s isn't larger than the address space of the platform... */
-    if ( s > (0xFFFFFFFFFFFFFFFF >> (64-(sizeof (size_t) * 8))) )
-        BAIL_MACRO(ERR_OUT_OF_MEMORY, NULL);
+    BAIL_IF_MACRO(__PHYSFS_ui64FitsAddressSpace(s), ERR_OUT_OF_MEMORY, NULL);
     #undef realloc
     return(realloc(ptr, (size_t) s));
 } /* __PHYSFS_platformRealloc */