mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 21:33:59 +02:00
- fixed the build on windows
This commit is contained in:
@@ -294,10 +294,10 @@ XmlNode *XmlIoRapid::load(const string &path, const std::map<string,string> &map
|
|||||||
|
|
||||||
// Determine stream size
|
// Determine stream size
|
||||||
int64 file_size = -1;
|
int64 file_size = -1;
|
||||||
if(xmlFile.tellg() != -1) {
|
if((double)xmlFile.tellg() != -1) {
|
||||||
streampos size1 = xmlFile.tellg();
|
streampos size1 = xmlFile.tellg();
|
||||||
xmlFile.seekg(0, ios::end);
|
xmlFile.seekg(0, ios::end);
|
||||||
if(xmlFile.tellg() != -1) {
|
if((double)xmlFile.tellg() != -1) {
|
||||||
streampos size2 = xmlFile.tellg();
|
streampos size2 = xmlFile.tellg();
|
||||||
xmlFile.seekg(0);
|
xmlFile.seekg(0);
|
||||||
file_size = size2 - size1;
|
file_size = size2 - size1;
|
||||||
@@ -313,9 +313,9 @@ XmlNode *XmlIoRapid::load(const string &path, const std::map<string,string> &map
|
|||||||
|
|
||||||
// Load data and add terminating 0
|
// Load data and add terminating 0
|
||||||
vector<char> buffer;
|
vector<char> buffer;
|
||||||
buffer.resize(file_size + 1);
|
buffer.resize((unsigned int)file_size + 1);
|
||||||
xmlFile.read(&buffer.front(), static_cast<streamsize>(file_size));
|
xmlFile.read(&buffer.front(), static_cast<streamsize>(file_size));
|
||||||
buffer[file_size] = 0;
|
buffer[(unsigned int)file_size] = 0;
|
||||||
|
|
||||||
if(showPerfStats) printf("In [%s::%s Line: %d] took msecs: " MG_I64_SPECIFIER "\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
if(showPerfStats) printf("In [%s::%s Line: %d] took msecs: " MG_I64_SPECIFIER "\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user