From f71dc0bd3f85ff20212681ba13245043e1ebdf6a Mon Sep 17 00:00:00 2001 From: shlainn Date: Tue, 2 Mar 2010 20:46:58 +0000 Subject: [PATCH] * sorted out some 64bit compatibility issues --- src/Client/DefScript/DefScript.cpp | 3 +-- src/Client/DefScript/DefScriptTools.cpp | 16 ++++++++-------- src/Client/SCPDatabase.cpp | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Client/DefScript/DefScript.cpp b/src/Client/DefScript/DefScript.cpp index 92593c3..5e14c4a 100644 --- a/src/Client/DefScript/DefScript.cpp +++ b/src/Client/DefScript/DefScript.cpp @@ -274,7 +274,6 @@ bool DefScriptPackage::LoadScriptFromFile(std::string fn){ absline++; if(line.empty()) continue; // line is empty, proceed with next line - while( !line.empty() && (line.at(0)==' ' || line.at(0)=='\t') ) line.erase(0,1); //while( !line.empty() && (line.at(line.length()-1)==13 || line.at(line.length()-1)==10) ) @@ -287,7 +286,7 @@ bool DefScriptPackage::LoadScriptFromFile(std::string fn){ if(line_strip) { // strip comments at the end of the line - unsigned int cmpos = 0; + size_t cmpos = 0; while(true) { // note: this must also cover lines like: "out blah \// no-comment // comment" diff --git a/src/Client/DefScript/DefScriptTools.cpp b/src/Client/DefScript/DefScriptTools.cpp index 6207c0e..58fac64 100644 --- a/src/Client/DefScript/DefScriptTools.cpp +++ b/src/Client/DefScript/DefScriptTools.cpp @@ -55,7 +55,7 @@ ldbl DefScriptTools::toNumber(std::string str) str.erase(0,1); negative=true; } - unsigned int ppos=str.find('.'); + size_t ppos=str.find('.'); str=stringToUpper(str); if(str.length() > 2 && str[0]=='0' && str[1]=='X') @@ -137,13 +137,13 @@ uint64 DefScriptTools::toUint64(std::string str) uint64 DefScriptTools::atoi64(std::string str) { - uint64 l = 0; - for (size_t i = 0; i < str.size(); i++) - { - if(!isdigit(str[i])) - return l; - l = l * 10 + str[i] - 48; - } + uint64 l = 0; + for (size_t i = 0; i < str.size(); i++) + { + if(!isdigit(str[i])) + return l; + l = l * 10 + str[i] - 48; + } return l; } diff --git a/src/Client/SCPDatabase.cpp b/src/Client/SCPDatabase.cpp index 221691b..996eebd 100644 --- a/src/Client/SCPDatabase.cpp +++ b/src/Client/SCPDatabase.cpp @@ -206,7 +206,7 @@ uint32 SCPDatabaseMgr::AutoLoadFile(const char *fn) line.clear(); continue; } - uint32 eq = line.find("="); + size_t eq = line.find("="); if(eq != std::string::npos) { entry=stringToLower(line.substr(0,eq));