Hopefully fix some more warnings in filesystem

This commit is contained in:
Bart van Strien
2011-12-28 14:39:13 +01:00
parent cde8b92113
commit 4b6df9baa2
3 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -142,7 +142,7 @@ namespace physfs
// Sadly, we'll have to clamp to 32 bits here
size = (size > LOVE_UINT32_MAX) ? LOVE_UINT32_MAX : size;
int64 read = (int64)PHYSFS_read(file, dst, 1, size);
int64 read = (int64)PHYSFS_read(file, dst, 1, (int) size);
if (!isOpen)
close();
@@ -159,7 +159,7 @@ namespace physfs
size = (size > LOVE_UINT32_MAX) ? LOVE_UINT32_MAX : size;
// Try to write.
int64 written = static_cast<int64>(PHYSFS_write(file, data, 1, size));
int64 written = static_cast<int64>(PHYSFS_write(file, data, 1, (int) size));
// Check that correct amount of data was written.
if (written != size)
+4 -4
View File
@@ -489,7 +489,7 @@ namespace physfs
{
int64 current = file->tell();
int64 read = file->read(buf, bufsize);
totalread += read;
totalread += (int) read; //TODO: Support integer-overflowing files/lines
if (read < 0)
return luaL_error(L, "Readline failed!");
@@ -498,7 +498,7 @@ namespace physfs
{
if (buf[i] == '\n')
{
newline = current+i;
newline = (int) current+i; // TODO: See above
break;
}
}
@@ -509,13 +509,13 @@ namespace physfs
// Special case for the last "line".
if (newline <= 0 && file->eof() && totalread > 0)
newline = pos + totalread;
newline = (int) pos + totalread; // TODO: See above
// We've got a newline.
if (newline > 0)
{
// Ok, we've got a line.
int linesize = (newline-pos);
int linesize = (newline-(int) pos); // TODO: See above
// Allocate memory for the string.
char * str = new char[linesize];