src/archiver_hog.c
changeset 1240 22d4d1bd4e21
parent 1203 55f147714ce2
child 1258 074d08049aa7
--- a/src/archiver_hog.c	Tue Mar 20 15:28:19 2012 -0400
+++ b/src/archiver_hog.c	Tue Mar 20 15:38:12 2012 -0400
@@ -48,13 +48,13 @@
     {
         entCount++;
         ptr = allocator.Realloc(ptr, sizeof (UNPKentry) * entCount);
-        GOTO_IF_MACRO(ptr == NULL, ERR_OUT_OF_MEMORY, failed);
+        GOTO_IF_MACRO(ptr == NULL, PHYSFS_ERR_OUT_OF_MEMORY, failed);
         entries = (UNPKentry *) ptr;
         entry = &entries[entCount-1];
 
-        GOTO_IF_MACRO(!__PHYSFS_readAll(io, &entry->name, 13), NULL, failed);
+        GOTO_IF_MACRO(!__PHYSFS_readAll(io, &entry->name, 13), ERRPASS, failed);
         pos += 13;
-        GOTO_IF_MACRO(!__PHYSFS_readAll(io, &size, 4), NULL, failed);
+        GOTO_IF_MACRO(!__PHYSFS_readAll(io, &size, 4), ERRPASS, failed);
         pos += 4;
 
         entry->size = PHYSFS_swapULE32(size);
@@ -62,7 +62,7 @@
         pos += size;
 
         /* skip over entry */
-        GOTO_IF_MACRO(!io->seek(io, pos), NULL, failed);
+        GOTO_IF_MACRO(!io->seek(io, pos), ERRPASS, failed);
     } /* while */
 
     *_entCount = entCount;
@@ -81,12 +81,12 @@
     UNPKentry *entries = NULL;
 
     assert(io != NULL);  /* shouldn't ever happen. */
-    BAIL_IF_MACRO(forWriting, ERR_ARC_IS_READ_ONLY, 0);
-    BAIL_IF_MACRO(!__PHYSFS_readAll(io, buf, 3), NULL, 0);
-    BAIL_IF_MACRO(memcmp(buf, "DHF", 3) != 0, ERR_NOT_AN_ARCHIVE, NULL);
+    BAIL_IF_MACRO(forWriting, PHYSFS_ERR_READ_ONLY, NULL);
+    BAIL_IF_MACRO(!__PHYSFS_readAll(io, buf, 3), ERRPASS, NULL);
+    BAIL_IF_MACRO(memcmp(buf, "DHF", 3) != 0, PHYSFS_ERR_UNSUPPORTED, NULL);
 
     entries = hogLoadEntries(io, &count);
-    BAIL_IF_MACRO(entries == NULL, NULL, NULL);
+    BAIL_IF_MACRO(!entries, ERRPASS, NULL);
     return UNPK_openArchive(io, entries, count);
 } /* HOG_openArchive */