1
0
forked from 0ad/0ad

Linux compat, const qualifiers, newlines at end of file =)

This was SVN commit r87.
This commit is contained in:
Simon Brenner 2003-11-25 02:17:52 +00:00
parent b732a1e1c5
commit a26fdd8f5c
4 changed files with 12 additions and 10 deletions

View File

@ -342,13 +342,13 @@ _bool CStr::operator>=(const CStr &Str) const
return (m_String >= Str.m_String);
}
CStr &CStr::operator+=(CStr &Str)
CStr &CStr::operator+=(const CStr &Str)
{
m_String += Str.m_String;
return *this;
}
CStr CStr::operator+(CStr &Str)
CStr CStr::operator+(const CStr &Str)
{
CStr NewStr(*this);
NewStr.m_String += Str.m_String;
@ -393,4 +393,4 @@ ostream &operator<<(ostream &os, CStr &Str)
{
os << (const TCHAR*)Str;
return os;
}
}

View File

@ -38,6 +38,7 @@ More Info:
#include <iostream>
#include "posix.h"
#include "misc.h"
#include <cstdlib>
using namespace std;
@ -161,8 +162,8 @@ public:
_bool operator<=(const CStr &Str) const;
_bool operator>(const CStr &Str) const;
_bool operator>=(const CStr &Str) const;
CStr &operator+=(CStr &Str);
CStr operator+(CStr &Str);
CStr &operator+=(const CStr &Str);
CStr operator+(const CStr &Str);
operator const TCHAR*();
operator const TCHAR*() const; // Gee, I've added this, Maybe the one above should be removed?
TCHAR &operator[](_int n);

View File

@ -1,6 +1,7 @@
// last modified Thursday, May 08, 2003
#include "LogFile.h"
#include "misc.h"
//-------------------------------------------------
//Add a hyperlink to Link.
@ -328,7 +329,7 @@ string CLogFile::Line(const PS_DISPLAY_SETTINGS &options)
lineText = options.file;
char temp[8];
itoa(options.line, temp, 10);
_itoa(options.line, temp, 10);
lineText += ", Line ";
lineText += temp;
lineText += ": ";
@ -352,4 +353,4 @@ string CLogFile::Date(const PS_DISPLAY_SETTINGS &options)
}
return dateText;
}
}

View File

@ -143,7 +143,7 @@ _bool CParserValue::GetDouble(_double &ret)
// Check if a digit is found
if (m_String[i] >= '0' && m_String[i] <= '9')
{
TempRet += (m_String[i]-'0')*pow(10,(DecimalPos-i-1));
TempRet += (m_String[i]-'0')*pow(double(10),(DecimalPos-i-1));
}
else
{
@ -162,7 +162,7 @@ _bool CParserValue::GetDouble(_double &ret)
// Check if a digit is found
if (m_String[i] >= '0' && m_String[i] <= '9')
{
TempRet += (m_String[i]-'0')*pow(10,DecimalPos-i);
TempRet += (m_String[i]-'0')*pow(double(10),DecimalPos-i);
}
// It will accept and ending f, like 1.0f
else if (!(i==Size-1 && m_String[i] == 'f'))
@ -1007,4 +1007,4 @@ _bool CParser::InputTaskType(const string& strName, const string& strSyntax)
}
return !Error;
}
}