Skip to content

Commit

Permalink
Attempt at type correctness.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 12, 2003
1 parent 1c8cec3 commit 01505d8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions archivers/zip.c
Expand Up @@ -250,7 +250,7 @@ static PHYSFS_sint64 ZIP_read(FileHandle *handle, void *buf,
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 */
Expand Down Expand Up @@ -282,13 +282,13 @@ static PHYSFS_sint64 ZIP_read(FileHandle *handle, void *buf,

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 */

Expand All @@ -303,7 +303,7 @@ static PHYSFS_sint64 ZIP_read(FileHandle *handle, void *buf,
} /* else */

if (retval > 0)
finfo->uncompressed_position += (retval * objSize);
finfo->uncompressed_position += (PHYSFS_uint32) (retval * objSize);

return(retval);
} /* ZIP_read */
Expand Down Expand Up @@ -341,7 +341,7 @@ static int ZIP_seek(FileHandle *handle, PHYSFS_uint64 offset)
{
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
Expand Down Expand Up @@ -371,7 +371,9 @@ static int ZIP_seek(FileHandle *handle, PHYSFS_uint64 offset)
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);

Expand Down
2 changes: 1 addition & 1 deletion physfs.c
Expand Up @@ -1712,7 +1712,7 @@ static PHYSFS_sint64 doBufferedRead(PHYSFS_file *handle, void *buffer,
{
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? */
{
Expand Down
2 changes: 1 addition & 1 deletion physfs_internal.h
Expand Up @@ -832,7 +832,7 @@ typedef struct __PHYSFS_FILEHANDLE__
/*
* 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.
Expand Down

0 comments on commit 01505d8

Please sign in to comment.