mirror of
https://github.com/glest/glest-source.git
synced 2025-08-20 15:11:20 +02:00
- a few code cleanup items while doing some testing in VC++ 2010
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#include <cstdlib>
|
||||
#include <stdexcept>
|
||||
#include <set>
|
||||
#include <iterator>
|
||||
#include "platform_util.h"
|
||||
#include "conversion.h"
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user