stomped on numerous warnings

This was SVN commit r584.
This commit is contained in:
janwas 2004-06-21 16:29:47 +00:00
parent fa0741c5f6
commit fc476e04f6
16 changed files with 75 additions and 60 deletions

View file

@ -1127,8 +1127,8 @@ void CGUI::Xerces_ReadObject(DOMElement *pElement, IGUIObject *pParent)
// There is no harm if the object didn't have a "caption"
}
}
// else
// TODO Gee: give warning
else
debug_warn("Text is only okay if it's the first element i.e. <object>caption ... </object>");
}
}

View file

@ -119,7 +119,7 @@ public:
{
// add to front of LRU list, but not index
// (since we don't have an id yet)
lru_list.push_front(Line(0, e));
lru_list.push_front(Line(e));
return 0;
}
@ -204,9 +204,9 @@ private:
Entry ent;
int refs; // protect from displacement if > 0
Line(u64 _tag, Entry& _ent)
Line(Entry& _ent)
{
id = 0;
id = 0;
ent = _ent;
refs = 0;
}

View file

@ -10,8 +10,8 @@ extern double cpu_freq;
extern int cpus;
extern int cpu_speedstep;
extern int cpu_smp;
// are there actually multiple physical processors,
// not only logical hyperthreaded CPUs? relevant for wtime.
// are there actually multiple physical processors,
// not only logical hyperthreaded CPUs? relevant for wtime.
#ifdef __cplusplus
}

View file

@ -222,6 +222,9 @@ struct DirEnt
DirEnt(const char* const _name, const uint _flags, const off_t _size)
: name(_name), flags(_flags), size(_size) {}
private:
DirEnt& operator=(const DirEnt&);
};
// pointer to DirEnt: faster sorting, but more allocs.
@ -1031,7 +1034,7 @@ debug_out("file_wait_io: hio=%I64x\n", hio);
size = io->user_size;
void* transfer_buf;
void* transfer_buf = 0;
ssize_t bytes_transferred;
// block's tag is in cache. need to check if its read is still pending.

View file

@ -468,6 +468,9 @@ struct FileCBParams
const FileLoc* const loc;
FileCBParams(Dir* _dir, const FileLoc* _loc)
: dir(_dir), loc(_loc) {}
private:
FileCBParams& operator=(const FileCBParams&);
};
// called for each OS dir ent.

View file

@ -423,21 +423,17 @@ static void check_hyperthread()
mov log_cpus_per_package, ebx ; ebx[23:16]
}
// early out, don't have to go through on_each_cpu
if(log_cpus_per_package >= cpus)
return;
cpu_smp = 1;
}
static void check_speedstep()
{
if(vendor == INTEL)
{
}
if(vendor == INTEL && ia32_cap(EST))
cpu_speedstep = true;
}
void ia32_get_cpu_info()
{
cpuid();
@ -453,6 +449,7 @@ void ia32_get_cpu_info()
get_cpu_type();
measure_cpu_freq();
check_hyperthread();
check_speedstep();
}
#endif // #ifndef _M_IX86

View file

@ -65,7 +65,7 @@ enum CpuCap
_3DNOW = 96+31
};
extern bool ia32_cpu_cap(CpuCap cap);
extern bool ia32_cap(CpuCap cap);
extern void ia32_get_cpu_info();

View file

@ -727,6 +727,7 @@ __asm jmp dword ptr [GetTickCount]
__declspec(naked) void __stdcall SDL_Delay(Uint32 ms)
{
UNUSED(ms);
__asm jmp dword ptr [Sleep]
}

View file

@ -29,8 +29,6 @@
#include <algorithm>
#include <numeric>
#include "wdbg.h"
// define to disable time sources (useful for simulating other systems)
//#define NO_QPC
@ -510,6 +508,7 @@ static inline int shutdown_calibration_thread()
if(WaitForSingleObject(hThread, 250) != WAIT_OBJECT_0)
TerminateThread(hThread, 0);
CloseHandle(hThread);
CloseHandle(hExitEvent);
return 0;
}

View file

@ -545,7 +545,7 @@ static void psInit()
// GUI uses VFS, so this must come after VFS init.
g_GUI.Initialize();
g_GUI.LoadXMLFile("gui/styles.xml");
g_GUI.LoadXMLFile("gui/hello.xml");
g_GUI.LoadXMLFile("gui/hello2.xml");
g_GUI.LoadXMLFile("gui/sprite1.xml");
#endif
}

View file

@ -245,7 +245,7 @@ void CConsole::DrawCursor(void)
//Inserts a character into the buffer.
void CConsole::InsertChar(const int szChar, const int cooked )
void CConsole::InsertChar(const int szChar, const wchar_t cooked )
{
static int iHistoryPos = -1;
@ -296,7 +296,7 @@ void CConsole::InsertChar(const int szChar, const int cooked )
/* BEGIN: Buffer History Lookup */
case SDLK_UP:
if (m_deqBufHistory.size() && iHistoryPos != m_deqBufHistory.size() - 1)
if (m_deqBufHistory.size() && iHistoryPos != (int)m_deqBufHistory.size() - 1)
{
iHistoryPos++;
SetBuffer(m_deqBufHistory.at(iHistoryPos).data());
@ -314,7 +314,7 @@ void CConsole::InsertChar(const int szChar, const int cooked )
/* BEGIN: Message History Lookup */
case SDLK_PAGEUP:
if (m_iMsgHistPos != m_deqMsgHistory.size()) m_iMsgHistPos++;
if (m_iMsgHistPos != (int)m_deqMsgHistory.size()) m_iMsgHistPos++;
return;
case SDLK_PAGEDOWN:
@ -490,6 +490,6 @@ bool conInputHandler(const SDL_Event& ev)
if(ev.type != SDL_KEYDOWN)
return false;
g_Console->InsertChar(ev.key.keysym.sym, ev.key.keysym.unicode );
g_Console->InsertChar(ev.key.keysym.sym, (wchar_t)ev.key.keysym.unicode );
return g_Console->IsActive();
}

View file

@ -70,7 +70,7 @@ public:
void Render();
void InsertMessage(const wchar_t* szMessage, ...);
void InsertChar(const int szChar, const int cooked);
void InsertChar(const int szChar, const wchar_t cooked);
void SetBuffer(const wchar_t* szMessage, ...);
void FlushBuffer();

View file

@ -39,6 +39,8 @@ public:
private:
CLogger();
CLogger(const CLogger& init);
CLogger& operator=(const CLogger& rhs);
//the two filestreams
std::ofstream m_MainLog;

View file

@ -136,10 +136,10 @@ CStr CStr::GetSubstring(size_t start, size_t len) const
//Search the string for another string
long CStr::Find(const CStr& Str) const
{
long Pos = (long)m_String.find(Str.m_String, 0);
size_t Pos = m_String.find(Str.m_String, 0);
if (Pos != tstring::npos)
return Pos;
return (long)Pos;
return -1;
}
@ -147,10 +147,10 @@ long CStr::Find(const CStr& Str) const
//Search the string for another string
long CStr::Find(const TCHAR &tchar) const
{
long Pos = (long)m_String.find(tchar, 0);
size_t Pos = m_String.find(tchar, 0);
if (Pos != tstring::npos)
return Pos;
return (long)Pos;
return -1;
}
@ -158,20 +158,20 @@ long CStr::Find(const TCHAR &tchar) const
//Search the string for another string
long CStr::Find(const int &start, const TCHAR &tchar) const
{
long Pos = (long)m_String.find(tchar, start);
size_t Pos = m_String.find(tchar, start);
if (Pos != tstring::npos)
return Pos;
return (long)Pos;
return -1;
}
long CStr::ReverseFind(const CStr& Str) const
{
long Pos = (long)m_String.rfind(Str.m_String, m_String.length() );
size_t Pos = m_String.rfind(Str.m_String, m_String.length() );
if (Pos != tstring::npos)
return Pos;
return (long)Pos;
return -1;
@ -182,7 +182,7 @@ CStr CStr::LowerCase() const
{
tstring NewTString = m_String;
for (size_t i = 0; i < m_String.length(); i++)
NewTString[i] = _totlower(m_String[i]);
NewTString[i] = (TCHAR)_totlower(m_String[i]);
return CStr(NewTString);
}
@ -191,7 +191,7 @@ CStr CStr::UpperCase() const
{
tstring NewTString = m_String;
for (size_t i = 0; i < m_String.length(); i++)
NewTString[i] = _totlower(m_String[i]);
NewTString[i] = (TCHAR)_totlower(m_String[i]);
return CStr(NewTString);
}
@ -202,7 +202,7 @@ CStr CStr::LCase() const
{
tstring NewTString = m_String;
for (size_t i = 0; i < m_String.length(); i++)
NewTString[i] = _totlower(m_String[i]);
NewTString[i] = (TCHAR)_totlower(m_String[i]);
return CStr(NewTString);
}
@ -211,7 +211,7 @@ CStr CStr::UCase() const
{
tstring NewTString = m_String;
for (size_t i = 0; i < m_String.length(); i++)
NewTString[i] = _totlower(m_String[i]);
NewTString[i] = (TCHAR)_totlower(m_String[i]);
return CStr(NewTString);
}
@ -261,7 +261,7 @@ void CStr::Replace(const CStr& ToReplace, const CStr& ReplaceWith)
// returns a trimed string, removes whitespace from the left/right/both
CStr CStr::Trim(PS_TRIM_MODE Mode)
{
size_t Left, Right;
size_t Left = 0, Right = 0;
switch (Mode)
@ -292,6 +292,9 @@ CStr CStr::Trim(PS_TRIM_MODE Mode)
if (_istspace(m_String[Right]) == false)
break; // end found, trim len-1 to Right+1 inclusive
} break;
default:
debug_warn("CStr::Trim: invalid Mode");
}

View file

@ -133,6 +133,9 @@ public:
PS_RESULT AddLink(string LinkText, string Link, string Colour);
private:
CLogFile(const CLogFile& init);
CLogFile& operator=(const CLogFile& rhs);
bool m_IsFileOpen; //Is the file open.
bool m_HasFrame; //Have frames been enabled.
ofstream m_TheFile; //The main file.

View file

@ -3,6 +3,7 @@
#include "precompiled.h"
#include "Parser.h"
#include "lib.h"
#pragma warning(disable:4786)
using namespace std;
@ -117,11 +118,11 @@ bool CParserValue::GetDouble(double &ret)
{
// locals
double TempRet = 0.0;
int Size = (int)m_String.size();
int i;
size_t Size = m_String.size();
size_t i;
bool AtLeastOne = false; // Checked if at least one of the loops
// run, otherwise "." would parse OK
int DecimalPos;
// run, otherwise "." would parse OK
size_t DecimalPos;
bool Negative = false; // "-" is found
// Check if '-' is found
@ -131,7 +132,7 @@ bool CParserValue::GetDouble(double &ret)
}
// find decimal position
DecimalPos = (int)m_String.find(".");
DecimalPos = m_String.find(".");
if (DecimalPos == string::npos)
DecimalPos = Size;
@ -145,7 +146,8 @@ 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(double(10),(DecimalPos-i-1));
double exp = (DecimalPos-i-1); // disambiguate pow() argument type
TempRet += (m_String[i]-'0')*pow(10.0, exp);
}
else
{
@ -164,7 +166,8 @@ 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(double(10),DecimalPos-i);
double exp = DecimalPos-i; // disambiguate pow() argument type
TempRet += (m_String[i]-'0')*pow(10.0,exp);
}
// It will accept and ending f, like 1.0f
else if (!(i==Size-1 && m_String[i] == 'f'))
@ -308,12 +311,12 @@ bool CParserLine::ParseString(const CParser& Parser, string strLine)
// Locals
bool Extract=false;
int ExtractPos=0;
size_t ExtractPos=0;
char Buffer[256];
char Letter[] = {'\0','\0'}; // Letter as string
vector<string> Segments;
string strSub;
int i;
size_t i;
// Set result to false, then if a match is found, turn it true
m_ParseOK = false;
@ -330,7 +333,7 @@ bool CParserLine::ParseString(const CParser& Parser, string strLine)
// Divide string into smaller vectors, seperators are unusual signs
// * * * *
for (i=0; i<(int)strLine.size(); ++i)
for (i=0; i<strLine.size(); ++i)
{
// Check if we're trying to use some kind of type
if (!Extract)
@ -347,7 +350,7 @@ bool CParserLine::ParseString(const CParser& Parser, string strLine)
if (strLine[i] == '\"')
{
// Extract a string, search for another "
int pos = (int)strLine.find("\"", i+1);
size_t pos = strLine.find("\"", i+1);
// If matching can't be found,
// the parsing will fail!
@ -423,15 +426,15 @@ bool CParserLine::ParseString(const CParser& Parser, string strLine)
// * * * *
// Locals
int Progress; // progress in Segments index
int Lane=0; // Have many alternative routes we are in
size_t Progress; // progress in Segments index
size_t Lane=0; // Have many alternative routes we are in
bool Match; // If a task-type match has been found
// The vector of these three represents the different lanes
// LastValidProgress[1] takes you back to lane 1 and how
// the variables was set at that point
vector<int> LastValidProgress; // When diving into a dynamic argument store store
vector<size_t> LastValidProgress; // When diving into a dynamic argument store store
// the last valid so you can go back to it
vector<int> LastValidArgCount; // If an alternative route turns out to fail, we
vector<size_t> LastValidArgCount; // If an alternative route turns out to fail, we
// need to know the amount of arguments on the last
// valid position, so we can remove them.
vector<bool> LastValidMatch; // Match at that point
@ -443,6 +446,7 @@ bool CParserLine::ParseString(const CParser& Parser, string strLine)
// found and no further looking is required
CParserTaskTypeNode *CurNode=NULL; // Current node on task type
CParserTaskTypeNode *PrevNode=NULL; // Last node
UNUSED(PrevNode);
// Iterate all different TaskType, and all TaskTypeElements...
// start from left and go to the right (prog), comparing
@ -490,7 +494,7 @@ bool CParserLine::ParseString(const CParser& Parser, string strLine)
CParserTaskTypeNode *OldNode = NULL;
// Go back to regular route!
while (1)
for(;;)
{
OldNode = CurNode;
CurNode = CurNode->m_ParentNode;
@ -566,7 +570,7 @@ bool CParserLine::ParseString(const CParser& Parser, string strLine)
{
// Find blank space if any!
// and jump to the next non-blankspace
if (Progress < (int)Segments.size())
if (Progress < Segments.size())
{
// Skip blankspaces AND tabs!
while (Segments[Progress].size()==1 &&
@ -586,7 +590,7 @@ bool CParserLine::ParseString(const CParser& Parser, string strLine)
else
// CHECK LETTER IF IT'S CORRECT
{
if (Progress < (int)Segments.size())
if (Progress < Segments.size())
{
// This should be 1-Letter long
if (Segments[Progress].size() != 1)
@ -630,7 +634,7 @@ bool CParserLine::ParseString(const CParser& Parser, string strLine)
{
// Store argument in CParserValue!
CParserValue value;
int i;
size_t i;
switch(CurNode->m_Type)
{
@ -683,7 +687,7 @@ bool CParserLine::ParseString(const CParser& Parser, string strLine)
// Reset, probably is but still
value.m_String = string();
for (i=Progress; i<(int)Segments.size(); ++i)
for (i=Progress; i<Segments.size(); ++i)
{
value.m_String += Segments[i];
@ -716,7 +720,7 @@ bool CParserLine::ParseString(const CParser& Parser, string strLine)
CParserTaskTypeNode *OldNode = NULL;
// Go back to regular route!
while (1)
for(;;)
{
OldNode = CurNode;
CurNode = CurNode->m_ParentNode;
@ -805,7 +809,7 @@ bool CParser::InputTaskType(const string& strName, const string& strSyntax)
size_t ExtractPos = 0;
bool Extract = false;
bool Error = false;
int i;
size_t i;
bool ConstructNew = false; // If it's the first input, then don't
// construct a new node, because we
// we already have m_BaseNode
@ -857,7 +861,7 @@ bool CParser::InputTaskType(const string& strName, const string& strSyntax)
CParserTaskTypeNode *OldNode = NULL;
// Jump out of this alternative route
while (1)
for(;;)
{
OldNode = CurNode;
CurNode = CurNode->m_ParentNode;