src/archiver_qpak.c
changeset 1203 55f147714ce2
parent 1191 f02c977477b9
child 1208 3edcb015089a
--- a/src/archiver_qpak.c	Fri Mar 09 03:55:23 2012 -0500
+++ b/src/archiver_qpak.c	Fri Mar 09 04:50:27 2012 -0500
@@ -69,12 +69,6 @@
 #define QPAK_SIG 0x4b434150   /* "PACK" in ASCII. */
 
 
-static inline int readAll(PHYSFS_Io *io, void *buf, const PHYSFS_uint64 len)
-{
-    return (io->read(io, buf, len) == len);
-} /* readAll */
-
-
 static void QPAK_dirClose(dvoid *opaque)
 {
     QPAKinfo *info = ((QPAKinfo *) opaque);
@@ -225,9 +219,9 @@
 
     for (entry = info->entries; fileCount > 0; fileCount--, entry++)
     {
-        BAIL_IF_MACRO(!readAll(io, &entry->name, 56), NULL, 0);
-        BAIL_IF_MACRO(!readAll(io, &entry->startPos, 4), NULL, 0);
-        BAIL_IF_MACRO(!readAll(io, &entry->size, 4), NULL, 0);
+        BAIL_IF_MACRO(!__PHYSFS_readAll(io, &entry->name, 56), NULL, 0);
+        BAIL_IF_MACRO(!__PHYSFS_readAll(io, &entry->startPos, 4), NULL, 0);
+        BAIL_IF_MACRO(!__PHYSFS_readAll(io, &entry->size, 4), NULL, 0);
         entry->size = PHYSFS_swapULE32(entry->size);
         entry->startPos = PHYSFS_swapULE32(entry->startPos);
     } /* for */
@@ -248,13 +242,13 @@
 
     BAIL_IF_MACRO(forWriting, ERR_ARC_IS_READ_ONLY, 0);
 
-    BAIL_IF_MACRO(!readAll(io, &val, 4), NULL, NULL);
+    BAIL_IF_MACRO(!__PHYSFS_readAll(io, &val, 4), NULL, NULL);
     BAIL_IF_MACRO(PHYSFS_swapULE32(val) != QPAK_SIG, ERR_NOT_AN_ARCHIVE, NULL);
 
-    BAIL_IF_MACRO(!readAll(io, &val, 4), NULL, NULL);
+    BAIL_IF_MACRO(!__PHYSFS_readAll(io, &val, 4), NULL, NULL);
     pos = PHYSFS_swapULE32(val);  /* directory table offset. */
 
-    BAIL_IF_MACRO(!readAll(io, &val, 4), NULL, NULL);
+    BAIL_IF_MACRO(!__PHYSFS_readAll(io, &val, 4), NULL, NULL);
     count = PHYSFS_swapULE32(val);
 
     /* corrupted archive? */