- a few code cleanup items while doing some testing in VC++ 2010

This commit is contained in:
Mark Vejvoda
2012-04-17 19:42:53 +00:00
parent aa831dbb61
commit 329bb58b04
9 changed files with 14 additions and 13 deletions

View File

@@ -105,7 +105,7 @@ void* ftpOpenDir(const char* path)
const char* ftpReadDir(void* dirHandle)
{
WIN32_FIND_DATA findData;
readDir_S* p = dirHandle;
readDir_S* p = (readDir_S *)dirHandle;
if(dirHandle == NULL)
return NULL;

View File

@@ -75,7 +75,7 @@ Pixmap2D* JPGReader::read(ifstream& is, const string& path, Pixmap2D* ret) const
assert(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false);
//Read file
is.seekg(0, ios::end);
size_t length = is.tellg();
streampos length = is.tellg();
if (length < 8) {
return NULL;
}

View File

@@ -16,6 +16,7 @@
#include <cstdlib>
#include <stdexcept>
#include <set>
#include <iterator>
#include "platform_util.h"
#include "conversion.h"

View File

@@ -285,12 +285,12 @@ XmlNode *XmlIoRapid::load(const string &path, std::map<string,string> mapTagRepl
// Determine stream size
xmlFile.seekg(0, ios::end);
size_t size = xmlFile.tellg();
streampos size = xmlFile.tellg();
xmlFile.seekg(0);
// Load data and add terminating 0
vector<char> buffer;
buffer.resize(size + 1);
buffer.resize(size + (streampos)1);
xmlFile.read(&buffer.front(), static_cast<streamsize>(size));
buffer[size] = 0;