mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-29 23:15:56 -04:00
more partial reverts of inadvisable changes from i++ to ++i, per pvs-studio...i'll ignore that type of advice from now on as i wasn't considering the consequences
This commit is contained in:
Executable → Regular
+4
-4
@@ -258,7 +258,7 @@ void AiMovementPathFollow::popNodeBack ( void )
|
||||
|
||||
AiPath::iterator it = m_path->end();
|
||||
|
||||
--it;
|
||||
it--;
|
||||
|
||||
m_path->erase(it);
|
||||
}
|
||||
@@ -293,7 +293,7 @@ void AiMovementPathFollow::swapPath ( AiPath * newPath )
|
||||
AiPath::iterator it;
|
||||
|
||||
#ifdef _DEBUG
|
||||
for(it = m_path->begin(); it != m_path->end(); ++it)
|
||||
for(it = m_path->begin(); it != m_path->end(); it++)
|
||||
{
|
||||
sendEraseWaypoint(*it);
|
||||
}
|
||||
@@ -303,7 +303,7 @@ void AiMovementPathFollow::swapPath ( AiPath * newPath )
|
||||
|
||||
m_path->swap(*newPath);
|
||||
|
||||
for(it = m_path->begin(); it != m_path->end(); ++it)
|
||||
for(it = m_path->begin(); it != m_path->end(); it++)
|
||||
{
|
||||
(*it).detach();
|
||||
|
||||
@@ -323,7 +323,7 @@ void AiMovementPathFollow::clearPath ( void )
|
||||
{
|
||||
AiPath::iterator it;
|
||||
|
||||
for(it = m_path->begin(); it != m_path->end(); ++it)
|
||||
for(it = m_path->begin(); it != m_path->end(); it++)
|
||||
{
|
||||
sendEraseWaypoint(*it);
|
||||
}
|
||||
|
||||
Executable → Regular
+1
-1
@@ -45,7 +45,7 @@ void updateQueue ( BuildQueue * queue, PerformanceTimer const & timer, float tim
|
||||
currentBuilder->update();
|
||||
|
||||
BuildQueue::iterator old = it;
|
||||
++it;
|
||||
it++;
|
||||
|
||||
if(currentBuilder->buildDone())
|
||||
{
|
||||
|
||||
Executable → Regular
+1
-1
@@ -138,7 +138,7 @@ RotaryCache::getNext()
|
||||
{
|
||||
void* retVal = (*mIterList).value;
|
||||
|
||||
++mIterList;
|
||||
mIterList++;
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
+3
-3
@@ -171,7 +171,7 @@ void Logger::LoggerInit(const char *programName)
|
||||
Logger::~Logger()
|
||||
{
|
||||
map<unsigned, LogInfo *>::iterator iter;
|
||||
for(iter = m_logTable.begin(); iter != m_logTable.end(); ++iter)
|
||||
for(iter = m_logTable.begin(); iter != m_logTable.end(); iter++)
|
||||
{
|
||||
logWithSys((*iter).first, LOG_INFO, LOG_FILEONLY, "---=== Log Stopped ===---");
|
||||
fflush((*iter).second->file);
|
||||
@@ -215,7 +215,7 @@ void Logger::flushAll()
|
||||
{
|
||||
map<unsigned, LogInfo *>::iterator iter;
|
||||
|
||||
for(iter = m_logTable.begin(); iter != m_logTable.end(); ++iter)
|
||||
for(iter = m_logTable.begin(); iter != m_logTable.end(); iter++)
|
||||
{
|
||||
LogInfo *info = (*iter).second;
|
||||
fflush(info->file);
|
||||
@@ -660,7 +660,7 @@ void Logger::rollDate(time_t t)
|
||||
m_logPrefix = buf;
|
||||
|
||||
map<unsigned, LogInfo *>::iterator iter;
|
||||
for(iter = m_logTable.begin(); iter != m_logTable.end(); ++iter)
|
||||
for(iter = m_logTable.begin(); iter != m_logTable.end(); iter++)
|
||||
{
|
||||
(*iter).second->filename = m_logPrefix + file_sep + (*iter).second->name.c_str() + ".log";
|
||||
fflush((*iter).second->file);
|
||||
|
||||
Vendored
Executable → Regular
+7
-7
@@ -57,7 +57,7 @@ void Profiler::AddNode(Node & lhs, const Node & rhs)
|
||||
lhs.mData.mMinLatency = rhs.mData.mMinLatency;
|
||||
|
||||
NodeMap_t::const_iterator iter;
|
||||
for (iter = rhs.mNodeMap.begin(); iter != rhs.mNodeMap.end(); ++iter)
|
||||
for (iter = rhs.mNodeMap.begin(); iter != rhs.mNodeMap.end(); iter++)
|
||||
{
|
||||
Node & node = lhs.mNodeMap[iter->first];
|
||||
AddNode(node, iter->second);
|
||||
@@ -69,7 +69,7 @@ void Profiler::AddData(const Profiler & rhs, bool hierarchy)
|
||||
if (hierarchy)
|
||||
{
|
||||
NodeMap_t::const_iterator nodeIter;
|
||||
for (nodeIter = rhs.mNodeMap.begin(); nodeIter != rhs.mNodeMap.end(); ++nodeIter)
|
||||
for (nodeIter = rhs.mNodeMap.begin(); nodeIter != rhs.mNodeMap.end(); nodeIter++)
|
||||
{
|
||||
Node & node = mNodeMap[nodeIter->first];
|
||||
AddNode(node, nodeIter->second);
|
||||
@@ -77,7 +77,7 @@ void Profiler::AddData(const Profiler & rhs, bool hierarchy)
|
||||
}
|
||||
|
||||
DataMap_t::const_iterator iter;
|
||||
for (iter = rhs.mDataMap.begin(); iter != rhs.mDataMap.end(); ++iter)
|
||||
for (iter = rhs.mDataMap.begin(); iter != rhs.mDataMap.end(); iter++)
|
||||
{
|
||||
NodeData & lhs = mDataMap[iter->first];
|
||||
const NodeData & rhs = iter->second;
|
||||
@@ -195,7 +195,7 @@ void Profiler::GetOutput(std::string & output, bool hierarchy)
|
||||
|
||||
// print data map (linear call profile)
|
||||
DataMap_t::const_iterator iter;
|
||||
for (iter = mDataMap.begin(); iter != mDataMap.end(); ++iter)
|
||||
for (iter = mDataMap.begin(); iter != mDataMap.end(); iter++)
|
||||
{
|
||||
const NodeData & data = iter->second;
|
||||
double trueLatency = data.mTotalLatency-data.mTotalChildLatency;
|
||||
@@ -254,7 +254,7 @@ void Profiler::GetXmlOutput(std::string & output, bool hierarchy)
|
||||
// print data map (linear call profile)
|
||||
int i = 1;
|
||||
DataMap_t::const_iterator iter;
|
||||
for (iter = mDataMap.begin(); iter != mDataMap.end(); ++iter)
|
||||
for (iter = mDataMap.begin(); iter != mDataMap.end(); iter++)
|
||||
{
|
||||
const NodeData & data = iter->second;
|
||||
double trueLatency = data.mTotalLatency-data.mTotalChildLatency;
|
||||
@@ -332,7 +332,7 @@ void Profiler::GetNodeOutput(std::string & output, const NodeMap_t & nodeMap, do
|
||||
|
||||
// recursively print node map
|
||||
NodeMap_t::const_iterator iter;
|
||||
for (iter = nodeMap.begin(); iter != nodeMap.end(); ++iter)
|
||||
for (iter = nodeMap.begin(); iter != nodeMap.end(); iter++)
|
||||
{
|
||||
// output node description
|
||||
const Node & node = iter->second;
|
||||
@@ -361,7 +361,7 @@ void Profiler::GetXmlNodeOutput(std::string & output, const NodeMap_t & nodeMap,
|
||||
// recursively print node map
|
||||
int i = 1;
|
||||
NodeMap_t::const_iterator iter;
|
||||
for (iter = nodeMap.begin(); iter != nodeMap.end(); ++iter)
|
||||
for (iter = nodeMap.begin(); iter != nodeMap.end(); iter++)
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "<Node%d>", i);
|
||||
output += buffer;
|
||||
|
||||
Vendored
Executable → Regular
+14
-11
@@ -22,7 +22,7 @@ namespace soe
|
||||
//
|
||||
// This class is designed to handle the serialization of a vector of strings. This was necessary
|
||||
// because the default serialization routines did not handle the length of the string properly, and
|
||||
// there was more risk involved in modifying all the serialization routines to handle the
|
||||
// there was more risk involved in modifying all the serialization routines to handle the
|
||||
// extra length property for the string as well as the vector.
|
||||
//
|
||||
// this is intenede to be used with the serialization macros
|
||||
@@ -50,17 +50,17 @@ namespace soe
|
||||
: mMaxStringLength(maxStringLength), mMaxListLength(maxListLength)
|
||||
{
|
||||
}
|
||||
SerializeStringList(stringList_t vStrings)
|
||||
SerializeStringList::SerializeStringList(stringList_t vStrings)
|
||||
: mMaxStringLength(DEFAULT_MAX_LENGTH_STRING), mMaxListLength(DEFAULT_MAX_NUMBER_ELEMENTS)
|
||||
{
|
||||
for(stringList_t::iterator i = vStrings.begin(); i != vStrings.end(); ++i)
|
||||
for(stringList_t::iterator i = vStrings.begin(); i != vStrings.end(); i++)
|
||||
{
|
||||
push_back(*i);
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
unsigned Read(const unsigned char * stream, unsigned size)
|
||||
unsigned SerializeStringList::Read(const unsigned char * stream, unsigned size)
|
||||
{
|
||||
// fix this:
|
||||
std::string element;
|
||||
@@ -91,7 +91,7 @@ namespace soe
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
unsigned Write(unsigned char * stream, unsigned size) const
|
||||
unsigned SerializeStringList::Write(unsigned char * stream, unsigned size) const
|
||||
{
|
||||
unsigned index = 0;
|
||||
unsigned bytes = 0;
|
||||
@@ -103,7 +103,7 @@ namespace soe
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
for (stringList_t::const_iterator iter = begin(); iter != end(); ++iter, ++index)
|
||||
for (stringList_t::const_iterator iter = begin(); iter != end(); iter++, index++)
|
||||
{
|
||||
elementBytes = soe::Write(stream+bytes, size-bytes, *iter);
|
||||
if (!elementBytes) {
|
||||
@@ -153,17 +153,17 @@ namespace soe
|
||||
: mMaxStringLength(maxStringLength), mMaxVectorLength(maxVectorLength)
|
||||
{
|
||||
}
|
||||
SerializeStringVector(stringVector_t vStrings)
|
||||
SerializeStringVector::SerializeStringVector(stringVector_t vStrings)
|
||||
: mMaxStringLength(DEFAULT_MAX_LENGTH_STRING), mMaxVectorLength(DEFAULT_MAX_NUMBER_ELEMENTS)
|
||||
{
|
||||
for(stringVector_t::iterator i = vStrings.begin(); i != vStrings.end(); ++i)
|
||||
for(stringVector_t::iterator i = vStrings.begin(); i != vStrings.end(); i++)
|
||||
{
|
||||
push_back(*i);
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
unsigned Read(const unsigned char * stream, unsigned size)
|
||||
unsigned SerializeStringVector::Read(const unsigned char * stream, unsigned size)
|
||||
{
|
||||
// fix this:
|
||||
std::string element;
|
||||
@@ -194,7 +194,7 @@ namespace soe
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
unsigned Write(unsigned char * stream, unsigned size) const
|
||||
unsigned SerializeStringVector::Write(unsigned char * stream, unsigned size) const
|
||||
{
|
||||
unsigned index = 0;
|
||||
unsigned bytes = 0;
|
||||
@@ -206,7 +206,7 @@ namespace soe
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
for (stringVector_t::const_iterator iter = begin(); iter != end(); ++iter, ++index)
|
||||
for (stringVector_t::const_iterator iter = begin(); iter != end(); iter++, index++)
|
||||
{
|
||||
elementBytes = soe::Write(stream+bytes, size-bytes, *iter);
|
||||
if (!elementBytes) {
|
||||
@@ -221,6 +221,9 @@ namespace soe
|
||||
return bytes;
|
||||
}
|
||||
|
||||
operator stringVector_t () { return *this; }
|
||||
|
||||
//unsigned Read(const unsigned char * stream, unsigned size);
|
||||
//DECLARE_SCRIBE_MEMBERS
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user