* sorted out some 64bit compatibility issues
This commit is contained in:
parent
1a9e5588d5
commit
f71dc0bd3f
@ -274,7 +274,6 @@ bool DefScriptPackage::LoadScriptFromFile(std::string fn){
|
|||||||
absline++;
|
absline++;
|
||||||
if(line.empty())
|
if(line.empty())
|
||||||
continue; // line is empty, proceed with next line
|
continue; // line is empty, proceed with next line
|
||||||
|
|
||||||
while( !line.empty() && (line.at(0)==' ' || line.at(0)=='\t') )
|
while( !line.empty() && (line.at(0)==' ' || line.at(0)=='\t') )
|
||||||
line.erase(0,1);
|
line.erase(0,1);
|
||||||
//while( !line.empty() && (line.at(line.length()-1)==13 || line.at(line.length()-1)==10) )
|
//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)
|
if(line_strip)
|
||||||
{
|
{
|
||||||
// strip comments at the end of the line
|
// strip comments at the end of the line
|
||||||
unsigned int cmpos = 0;
|
size_t cmpos = 0;
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
// note: this must also cover lines like: "out blah \// no-comment // comment"
|
// note: this must also cover lines like: "out blah \// no-comment // comment"
|
||||||
|
|||||||
@ -55,7 +55,7 @@ ldbl DefScriptTools::toNumber(std::string str)
|
|||||||
str.erase(0,1);
|
str.erase(0,1);
|
||||||
negative=true;
|
negative=true;
|
||||||
}
|
}
|
||||||
unsigned int ppos=str.find('.');
|
size_t ppos=str.find('.');
|
||||||
str=stringToUpper(str);
|
str=stringToUpper(str);
|
||||||
|
|
||||||
if(str.length() > 2 && str[0]=='0' && str[1]=='X')
|
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 DefScriptTools::atoi64(std::string str)
|
||||||
{
|
{
|
||||||
uint64 l = 0;
|
uint64 l = 0;
|
||||||
for (size_t i = 0; i < str.size(); i++)
|
for (size_t i = 0; i < str.size(); i++)
|
||||||
{
|
{
|
||||||
if(!isdigit(str[i]))
|
if(!isdigit(str[i]))
|
||||||
return l;
|
return l;
|
||||||
l = l * 10 + str[i] - 48;
|
l = l * 10 + str[i] - 48;
|
||||||
}
|
}
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -206,7 +206,7 @@ uint32 SCPDatabaseMgr::AutoLoadFile(const char *fn)
|
|||||||
line.clear();
|
line.clear();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
uint32 eq = line.find("=");
|
size_t eq = line.find("=");
|
||||||
if(eq != std::string::npos)
|
if(eq != std::string::npos)
|
||||||
{
|
{
|
||||||
entry=stringToLower(line.substr(0,eq));
|
entry=stringToLower(line.substr(0,eq));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user