Attempt at type correctness.
--- a/archivers/zip.c Fri Jan 31 04:10:19 2003 +0000
+++ b/archivers/zip.c Wed Mar 12 05:39:51 2003 +0000
@@ -250,7 +250,7 @@
if (avail < maxread)
{
maxread = avail - (avail % objSize);
- objCount = maxread / objSize;
+ objCount = (PHYSFS_uint32) (maxread / objSize);
BAIL_IF_MACRO(objCount == 0, ERR_PAST_EOF, 0); /* quick rejection. */
__PHYSFS_setError(ERR_PAST_EOF); /* this is always true here. */
} /* if */
@@ -282,13 +282,13 @@
br = __PHYSFS_platformRead(finfo->handle,
finfo->buffer,
- 1, br);
+ 1, (PHYSFS_uint32) br);
if (br <= 0)
break;
- finfo->compressed_position += br;
+ finfo->compressed_position += (PHYSFS_uint32) br;
finfo->stream.next_in = finfo->buffer;
- finfo->stream.avail_in = br;
+ finfo->stream.avail_in = (PHYSFS_uint32) br;
} /* if */
} /* if */
@@ -303,7 +303,7 @@
} /* else */
if (retval > 0)
- finfo->uncompressed_position += (retval * objSize);
+ finfo->uncompressed_position += (PHYSFS_uint32) (retval * objSize);
return(retval);
} /* ZIP_read */
@@ -341,7 +341,7 @@
{
PHYSFS_sint64 newpos = offset + entry->offset;
BAIL_IF_MACRO(!__PHYSFS_platformSeek(in, newpos), NULL, 0);
- finfo->uncompressed_position = newpos;
+ finfo->uncompressed_position = (PHYSFS_uint32) newpos;
} /* if */
else
@@ -371,7 +371,9 @@
while (finfo->uncompressed_position != offset)
{
PHYSFS_uint8 buf[512];
- PHYSFS_uint32 maxread = offset - finfo->uncompressed_position;
+ PHYSFS_uint32 maxread;
+
+ maxread = (PHYSFS_uint32) (offset - finfo->uncompressed_position);
if (maxread > sizeof (buf))
maxread = sizeof (buf);
--- a/physfs.c Fri Jan 31 04:10:19 2003 +0000
+++ b/physfs.c Wed Mar 12 05:39:51 2003 +0000
@@ -1712,7 +1712,7 @@
{
PHYSFS_uint64 buffered = h->buffill - h->bufpos;
PHYSFS_uint64 mustread = (objSize * objCount) - remainder;
- PHYSFS_uint32 copied;
+ PHYSFS_uint64 copied;
if (buffered == 0) /* need to refill buffer? */
{
--- a/physfs_internal.h Fri Jan 31 04:10:19 2003 +0000
+++ b/physfs_internal.h Wed Mar 12 05:39:51 2003 +0000
@@ -832,7 +832,7 @@
/*
* This is the buffer size, if one is set (0 otherwise). Don't touch.
*/
- PHYSFS_uint64 bufsize;
+ PHYSFS_uint32 bufsize;
/*
* This is the buffer fill size. Don't touch.