Attempt at type correctness.

This commit is contained in:
Ryan C. Gordon 2003-03-12 05:39:51 +00:00
parent 1c8cec3d3e
commit 01505d8d58
3 changed files with 11 additions and 9 deletions

View File

@ -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 */
@ -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 */
@ -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 */
@ -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
@ -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);

View File

@ -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? */
{

View File

@ -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.