Data::getSize now uses size_t instead of int

This commit is contained in:
Alex Szpakowski
2014-03-18 03:50:00 -03:00
parent aba17607aa
commit 50916825d0
12 changed files with 42 additions and 46 deletions
+6 -11
View File
@@ -20,9 +20,9 @@
#include "FileData.h"
// STD
// C++
#include <iostream>
#include <climits>
#include <limits>
namespace love
{
@@ -31,7 +31,7 @@ namespace filesystem
FileData::FileData(uint64 size, const std::string &filename)
: data(new char[(size_t) size])
, size(size)
, size((size_t) size)
, filename(filename)
{
if (filename.rfind('.') != std::string::npos)
@@ -48,15 +48,10 @@ void *FileData::getData() const
return (void *)data;
}
// TODO: Enable this
/*uint64 FileData::getSize() const
size_t FileData::getSize() const
{
return size;
}*/
int FileData::getSize() const
{
return size > INT_MAX ? INT_MAX : (int) size;
size_t sizemax = std::numeric_limits<size_t>::max();
return size > sizemax ? sizemax : (size_t) size;
}
const std::string &FileData::getFilename() const