Apply style fix

This commit is contained in:
Antz 2020-01-10 23:13:44 +00:00
parent 5531a0087d
commit 35405dd549
155 changed files with 10968 additions and 3660 deletions

View file

@ -180,7 +180,9 @@ uint8* BigNumber::AsByteArray(int minSize)
// If we need more bytes than length of BigNumber set the rest to 0
if (length > GetNumBytes())
{ memset((void*)_array, 0, length); }
{
memset((void*)_array, 0, length);
}
BN_bn2bin(_bn, (unsigned char*)_array);

View file

@ -57,7 +57,9 @@ LocaleConstant GetLocaleByName(const std::string& name)
{
for (LocaleNameStr const* itr = &fullLocaleNameList[0]; itr->name; ++itr)
if (name == itr->name)
{ return itr->locale; }
{
return itr->locale;
}
return LOCALE_enUS; // including enGB case
}

View file

@ -37,7 +37,9 @@ INSTANTIATE_SINGLETON_1(Config);
static bool GetValueHelper(ACE_Configuration_Heap* mConf, const char* name, ACE_TString& result)
{
if (!mConf)
{ return false; }
{
return false;
}
ACE_TString section_name;
ACE_Configuration_Section_Key section_key;
@ -48,7 +50,9 @@ static bool GetValueHelper(ACE_Configuration_Heap* mConf, const char* name, ACE_
{
mConf->open_section(root_key, section_name.c_str(), 0, section_key);
if (mConf->get_string_value(section_key, name, result) == 0)
{ return true; }
{
return true;
}
++i;
}
@ -81,7 +85,9 @@ bool Config::Reload()
{
ACE_Ini_ImpExp config_importer(*mConf);
if (config_importer.import_config(mFilename.c_str()) == 0)
{ return true; }
{
return true;
}
}
delete mConf;
@ -99,7 +105,9 @@ bool Config::GetBoolDefault(const char* name, bool def)
{
ACE_TString val;
if (!GetValueHelper(mConf, name, val))
{ return def; }
{
return def;
}
const char* str = val.c_str();
if (strcmp(str, "true") == 0 || strcmp(str, "TRUE") == 0 ||

View file

@ -228,7 +228,9 @@ uint32 DB2FileLoader::GetFormatRecordSize(const char * format,int32* index_pos)
}
if (index_pos)
{ *index_pos = i; }
{
*index_pos = i;
}
return recordsize;
}
@ -258,7 +260,9 @@ char* DB2FileLoader::AutoProduceData(const char* format, uint32& records, char**
typedef char* ptr;
if (strlen(format) != fieldCount)
{ return NULL; }
{
return NULL;
}
// get struct size and index pos
int32 i;
@ -272,7 +276,9 @@ char* DB2FileLoader::AutoProduceData(const char* format, uint32& records, char**
{
uint32 ind = getRecord(y).getUInt(i);
if (ind > maxi)
{ maxi = ind; }
{
maxi = ind;
}
}
++maxi;
@ -342,7 +348,9 @@ static char const* const nullStr = "";
char* DB2FileLoader::AutoProduceStringsArrayHolders(const char* format, char* dataTable)
{
if (strlen(format) != fieldCount)
{ return NULL; }
{
return NULL;
}
// we store flat holders pool as single memory block
size_t stringFields = GetFormatStringsFields(format);

View file

@ -41,7 +41,9 @@ bool DBCFileLoader::Load(const char* filename, const char* fmt)
FILE* f = fopen(filename, "rb");
if (!f)
{ return false; }
{
return false;
}
if (fread(&header, 4, 1, f) != 1) // Number of records
{
@ -94,7 +96,9 @@ bool DBCFileLoader::Load(const char* filename, const char* fmt)
{
fieldsOffset[i] = fieldsOffset[i - 1];
if (fmt[i - 1] == 'b' || fmt[i - 1] == 'X') // byte fields
{ fieldsOffset[i] += 1; }
{
fieldsOffset[i] += 1;
}
else // 4 byte fields (int32/float/strings)
{ fieldsOffset[i] += 4; }
}
@ -164,7 +168,9 @@ uint32 DBCFileLoader::GetFormatRecordSize(const char* format, int32* index_pos)
}
if (index_pos)
{ *index_pos = i; }
{
*index_pos = i;
}
return recordsize;
}
@ -194,7 +200,9 @@ char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**
typedef char* ptr;
if (strlen(format) != fieldCount)
{ return NULL; }
{
return NULL;
}
// get struct size and index pos
int32 i;
@ -208,7 +216,9 @@ char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**
{
uint32 ind = getRecord(y).getUInt(i);
if (ind > maxi)
{ maxi = ind; }
{
maxi = ind;
}
}
++maxi;
@ -337,7 +347,9 @@ char* DBCFileLoader::AutoProduceStringsArrayHolders(const char* format, char* da
char* DBCFileLoader::AutoProduceStrings(const char* format, char* dataTable, LocaleConstant loc)
{
if (strlen(format) != fieldCount)
{ return NULL; }
{
return NULL;
}
// each string field at load have array of string for each locale
size_t stringHolderSize = sizeof(char*) * MAX_LOCALE;

View file

@ -100,7 +100,9 @@ class DBCStorage
DBCFileLoader dbc;
// Check if load was sucessful, only then continue
if (!dbc.Load(fn, fmt))
{ return false; }
{
return false;
}
fieldCount = dbc.GetCols();
@ -143,12 +145,16 @@ class DBCStorage
{
// DBC must be already loaded using Load
if (!indexTable)
{ return false; }
{
return false;
}
DBCFileLoader dbc;
// Check if load was successful, only then continue
if (!dbc.Load(fn, fmt))
{ return false; }
{
return false;
}
// load strings from another locale dbc data
m_stringPoolList.push_back(dbc.AutoProduceStrings(fmt,(char*)m_dataTable,loc));
@ -169,7 +175,9 @@ class DBCStorage
}
if (!indexTable)
{ return; }
{
return;
}
delete[]((char*)indexTable);
indexTable = NULL;

View file

@ -71,7 +71,9 @@ SqlPreparedStatement* SqlConnection::GetStmt(uint32 nIndex)
{
// resize stmt container
if (m_holder.size() <= nIndex)
{ m_holder.resize(nIndex + 1, NULL); }
{
m_holder.resize(nIndex + 1, NULL);
}
SqlPreparedStatement* pStmt = NULL;
@ -102,7 +104,9 @@ SqlPreparedStatement* SqlConnection::GetStmt(uint32 nIndex)
bool SqlConnection::ExecuteStmt(int nIndex, const SqlStmtParameters& id)
{
if (nIndex == -1)
{ return false; }
{
return false;
}
// get prepared statement object
SqlPreparedStatement* pStmt = GetStmt(nIndex);
@ -127,7 +131,9 @@ bool Database::Initialize(const char* infoString, int nConns /*= 1*/)
if (!m_logsDir.empty())
{
if ((m_logsDir.at(m_logsDir.length() - 1) != '/') && (m_logsDir.at(m_logsDir.length() - 1) != '\\'))
{ m_logsDir.append("/"); }
{
m_logsDir.append("/");
}
}
m_pingIntervallms = sConfig.GetIntDefault("MaxPingTime", 30) * (MINUTE * 1000);
@ -136,7 +142,9 @@ bool Database::Initialize(const char* infoString, int nConns /*= 1*/)
// setup connection pool size
if (nConns < MIN_CONNECTION_POOL_SIZE)
{ m_nQueryConnPoolSize = MIN_CONNECTION_POOL_SIZE; }
{
m_nQueryConnPoolSize = MIN_CONNECTION_POOL_SIZE;
}
else if (nConns > MAX_CONNECTION_POOL_SIZE)
{ m_nQueryConnPoolSize = MAX_CONNECTION_POOL_SIZE; }
else
@ -158,7 +166,9 @@ bool Database::Initialize(const char* infoString, int nConns /*= 1*/)
// create and initialize connection for async requests
m_pAsyncConn = CreateConnection();
if (!m_pAsyncConn->Initialize(infoString))
{ return false; }
{
return false;
}
m_pResultQueue = new SqlResultQueue;
@ -222,13 +232,17 @@ void Database::ThreadEnd()
void Database::ProcessResultQueue()
{
if (m_pResultQueue)
{ m_pResultQueue->Update(); }
{
m_pResultQueue->Update();
}
}
void Database::escape_string(std::string& str)
{
if (str.empty())
{ return; }
{
return;
}
char* buf = new char[str.size() * 2 + 1];
// we don't care what connection to use - escape string will be the same
@ -242,7 +256,9 @@ SqlConnection* Database::getQueryConnection()
int nCount = 0;
if (m_nQueryCounter == long(1 << 31))
{ m_nQueryCounter = 0; }
{
m_nQueryCounter = 0;
}
else
{ nCount = ++m_nQueryCounter; }
@ -268,7 +284,9 @@ void Database::Ping()
bool Database::PExecuteLog(const char* format, ...)
{
if (!format)
{ return false; }
{
return false;
}
va_list ap;
char szQuery [MAX_QUERY_LEN];
@ -350,7 +368,9 @@ QueryNamedResult* Database::PQueryNamed(const char* format, ...)
bool Database::Execute(const char* sql)
{
if (!m_pAsyncConn)
{ return false; }
{
return false;
}
SqlTransaction* pTrans = (*m_TransStorage)->get();
if (pTrans)
@ -362,7 +382,9 @@ bool Database::Execute(const char* sql)
{
// if async execution is not available
if (!m_bAllowAsyncTransactions)
{ return DirectExecute(sql); }
{
return DirectExecute(sql);
}
// Simple sql statement
m_threadBody->Delay(new SqlPlainRequest(sql));
@ -374,7 +396,9 @@ bool Database::Execute(const char* sql)
bool Database::PExecute(const char* format, ...)
{
if (!format)
{ return false; }
{
return false;
}
va_list ap;
char szQuery [MAX_QUERY_LEN];
@ -394,7 +418,9 @@ bool Database::PExecute(const char* format, ...)
bool Database::DirectPExecute(const char* format, ...)
{
if (!format)
{ return false; }
{
return false;
}
va_list ap;
char szQuery [MAX_QUERY_LEN];
@ -414,7 +440,9 @@ bool Database::DirectPExecute(const char* format, ...)
bool Database::BeginTransaction()
{
if (!m_pAsyncConn)
{ return false; }
{
return false;
}
// initiate transaction on current thread
// currently we do not support queued transactions
@ -425,15 +453,21 @@ bool Database::BeginTransaction()
bool Database::CommitTransaction()
{
if (!m_pAsyncConn)
{ return false; }
{
return false;
}
// check if we have pending transaction
if (!(*m_TransStorage)->get())
{ return false; }
{
return false;
}
// if async execution is not available
if (!m_bAllowAsyncTransactions)
{ return CommitTransactionDirect(); }
{
return CommitTransactionDirect();
}
// add SqlTransaction to the async queue
m_threadBody->Delay((*m_TransStorage)->detach());
@ -443,11 +477,15 @@ bool Database::CommitTransaction()
bool Database::CommitTransactionDirect()
{
if (!m_pAsyncConn)
{ return false; }
{
return false;
}
// check if we have pending transaction
if (!(*m_TransStorage)->get())
{ return false; }
{
return false;
}
// directly execute SqlTransaction
SqlTransaction* pTrans = (*m_TransStorage)->detach();
@ -460,10 +498,14 @@ bool Database::CommitTransactionDirect()
bool Database::RollbackTransaction()
{
if (!m_pAsyncConn)
{ return false; }
{
return false;
}
if (!(*m_TransStorage)->get())
{ return false; }
{
return false;
}
// remove scheduled transaction
(*m_TransStorage)->reset();
@ -554,7 +596,9 @@ bool Database::CheckDatabaseVersion(DatabaseTypes database)
bool Database::ExecuteStmt(const SqlStatementID& id, SqlStmtParameters* params)
{
if (!m_pAsyncConn)
{ return false; }
{
return false;
}
SqlTransaction* pTrans = (*m_TransStorage)->get();
if (pTrans)
@ -566,7 +610,9 @@ bool Database::ExecuteStmt(const SqlStatementID& id, SqlStmtParameters* params)
{
// if async execution is not available
if (!m_bAllowAsyncTransactions)
{ return DirectExecuteStmt(id, params); }
{
return DirectExecuteStmt(id, params);
}
// Simple sql statement
m_threadBody->Delay(new SqlPreparedRequest(id.ID(), params));
@ -617,13 +663,17 @@ std::string Database::GetStmtString(const int stmtId) const
LOCK_GUARD _guard(m_stmtGuard);
if (stmtId == -1 || stmtId > m_iStmtIndex)
{ return std::string(); }
{
return std::string();
}
PreparedStmtRegistry::const_iterator iter_last = m_stmtRegistry.end();
for (PreparedStmtRegistry::const_iterator iter = m_stmtRegistry.begin(); iter != iter_last; ++iter)
{
if (iter->second == stmtId)
{ return iter->first; }
{
return iter->first;
}
}
return std::string();

View file

@ -296,7 +296,9 @@ class Database
inline bool DirectExecute(const char* sql)
{
if (!m_pAsyncConn)
{ return false; }
{
return false;
}
SqlConnection::Lock guard(m_pAsyncConn);
return guard->Execute(sql);

View file

@ -102,15 +102,25 @@ bool MySQLConnection::Initialize(const char* infoString)
iter = tokens.begin();
if (iter != tokens.end())
{ host = *iter++; }
{
host = *iter++;
}
if (iter != tokens.end())
{ port_or_socket = *iter++; }
{
port_or_socket = *iter++;
}
if (iter != tokens.end())
{ user = *iter++; }
{
user = *iter++;
}
if (iter != tokens.end())
{ password = *iter++; }
{
password = *iter++;
}
if (iter != tokens.end())
{ database = *iter++; }
{
database = *iter++;
}
mysql_options(mysqlInit, MYSQL_SET_CHARSET_NAME, "utf8");
mysql_options(mysqlInit, MYSQL_OPT_RECONNECT, "1");
@ -170,7 +180,9 @@ bool MySQLConnection::Initialize(const char* infoString)
// LEAVE 'AUTOCOMMIT' MODE ALWAYS ENABLED!!!
// W/O IT EVEN 'SELECT' QUERIES WOULD REQUIRE TO BE WRAPPED INTO 'START TRANSACTION'<>'COMMIT' CLAUSES!!!
if (!mysql_autocommit(mMysql, 1))
{ DETAIL_LOG("AUTOCOMMIT SUCCESSFULLY SET TO 1"); }
{
DETAIL_LOG("AUTOCOMMIT SUCCESSFULLY SET TO 1");
}
else
{ DETAIL_LOG("AUTOCOMMIT NOT SET TO 1"); }
/*-------------------------------------*/
@ -186,7 +198,9 @@ bool MySQLConnection::Initialize(const char* infoString)
bool MySQLConnection::_Query(const char* sql, MYSQL_RES** pResult, MYSQL_FIELD** pFields, uint64* pRowCount, uint32* pFieldCount)
{
if (!mMysql)
{ return 0; }
{
return 0;
}
uint32 _s = WorldTimer::getMSTime();
@ -206,7 +220,9 @@ bool MySQLConnection::_Query(const char* sql, MYSQL_RES** pResult, MYSQL_FIELD**
*pFieldCount = mysql_field_count(mMysql);
if (!*pResult)
{ return false; }
{
return false;
}
if (!*pRowCount)
{
@ -226,7 +242,9 @@ QueryResult* MySQLConnection::Query(const char* sql)
uint32 fieldCount = 0;
if (!_Query(sql, &result, &fields, &rowCount, &fieldCount))
{ return NULL; }
{
return NULL;
}
QueryResultMysql* queryResult = new QueryResultMysql(result, fields, rowCount, fieldCount);
@ -242,7 +260,9 @@ QueryNamedResult* MySQLConnection::QueryNamed(const char* sql)
uint32 fieldCount = 0;
if (!_Query(sql, &result, &fields, &rowCount, &fieldCount))
{ return NULL; }
{
return NULL;
}
QueryFieldNames names(fieldCount);
for (uint32 i = 0; i < fieldCount; ++i)
@ -257,7 +277,9 @@ QueryNamedResult* MySQLConnection::QueryNamed(const char* sql)
bool MySQLConnection::Execute(const char* sql)
{
if (!mMysql)
{ return false; }
{
return false;
}
{
uint32 _s = WorldTimer::getMSTime();
@ -311,7 +333,9 @@ bool MySQLConnection::RollbackTransaction()
unsigned long MySQLConnection::escape_string(char* to, const char* from, unsigned long length)
{
if (!mMysql || !to || !from || !length)
{ return 0; }
{
return 0;
}
return(mysql_real_escape_string(mMysql, to, from, length));
}
@ -336,7 +360,9 @@ MySqlPreparedStatement::~MySqlPreparedStatement()
bool MySqlPreparedStatement::prepare()
{
if (isPrepared())
{ return true; }
{
return true;
}
// remove old binds
RemoveBinds();
@ -402,7 +428,9 @@ void MySqlPreparedStatement::bind(const SqlStmtParameters& holder)
// finalize adding params
if (!m_pInputArgs)
{ return; }
{
return;
}
// verify if we bound all needed input parameters
if (m_nParams != holder.boundParams())
@ -450,7 +478,9 @@ void MySqlPreparedStatement::addParam(unsigned int nIndex, const SqlStmtFieldDat
void MySqlPreparedStatement::RemoveBinds()
{
if (!m_stmt)
{ return; }
{
return;
}
delete[] m_pInputArgs;
delete[] m_pResult;
@ -469,7 +499,9 @@ void MySqlPreparedStatement::RemoveBinds()
bool MySqlPreparedStatement::execute()
{
if (!isPrepared())
{ return false; }
{
return false;
}
if (mysql_stmt_execute(m_stmt))
{

View file

@ -72,18 +72,30 @@ bool PostgreSQLConnection::Initialize(const char* infoString)
iter = tokens.begin();
if (iter != tokens.end())
{ host = *iter++; }
{
host = *iter++;
}
if (iter != tokens.end())
{ port_or_socket_dir = *iter++; }
{
port_or_socket_dir = *iter++;
}
if (iter != tokens.end())
{ user = *iter++; }
{
user = *iter++;
}
if (iter != tokens.end())
{ password = *iter++; }
{
password = *iter++;
}
if (iter != tokens.end())
{ database = *iter++; }
{
database = *iter++;
}
if (host == ".")
{ mPGconn = PQsetdbLogin(NULL, port_or_socket_dir == "." ? NULL : port_or_socket_dir.c_str(), NULL, NULL, database.c_str(), user.c_str(), password.c_str()); }
{
mPGconn = PQsetdbLogin(NULL, port_or_socket_dir == "." ? NULL : port_or_socket_dir.c_str(), NULL, NULL, database.c_str(), user.c_str(), password.c_str());
}
else
{ mPGconn = PQsetdbLogin(host.c_str(), port_or_socket_dir.c_str(), NULL, NULL, database.c_str(), user.c_str(), password.c_str()); }
@ -105,13 +117,17 @@ bool PostgreSQLConnection::Initialize(const char* infoString)
bool PostgreSQLConnection::_Query(const char* sql, PGresult** pResult, uint64* pRowCount, uint32* pFieldCount)
{
if (!mPGconn)
{ return false; }
{
return false;
}
uint32 _s = WorldTimer::getMSTime();
// Send the query
*pResult = PQexec(mPGconn, sql);
if (!*pResult)
{ return false; }
{
return false;
}
if (PQresultStatus(*pResult) != PGRES_TUPLES_OK)
{
@ -141,14 +157,18 @@ bool PostgreSQLConnection::_Query(const char* sql, PGresult** pResult, uint64* p
QueryResult* PostgreSQLConnection::Query(const char* sql)
{
if (!mPGconn)
{ return NULL; }
{
return NULL;
}
PGresult* result = NULL;
uint64 rowCount = 0;
uint32 fieldCount = 0;
if (!_Query(sql, &result, &rowCount, &fieldCount))
{ return NULL; }
{
return NULL;
}
QueryResultPostgre* queryResult = new QueryResultPostgre(result, rowCount, fieldCount);
@ -159,14 +179,18 @@ QueryResult* PostgreSQLConnection::Query(const char* sql)
QueryNamedResult* PostgreSQLConnection::QueryNamed(const char* sql)
{
if (!mPGconn)
{ return NULL; }
{
return NULL;
}
PGresult* result = NULL;
uint64 rowCount = 0;
uint32 fieldCount = 0;
if (!_Query(sql, &result, &rowCount, &fieldCount))
{ return NULL; }
{
return NULL;
}
QueryFieldNames names(fieldCount);
for (uint32 i = 0; i < fieldCount; ++i)
@ -181,7 +205,9 @@ QueryNamedResult* PostgreSQLConnection::QueryNamed(const char* sql)
bool PostgreSQLConnection::Execute(const char* sql)
{
if (!mPGconn)
{ return false; }
{
return false;
}
uint32 _s = WorldTimer::getMSTime();
@ -204,7 +230,9 @@ bool PostgreSQLConnection::Execute(const char* sql)
bool PostgreSQLConnection::_TransactionCmd(const char* sql)
{
if (!mPGconn)
{ return false; }
{
return false;
}
PGresult* res = PQexec(mPGconn, sql);
if (PQresultStatus(res) != PGRES_COMMAND_OK)
@ -238,7 +266,9 @@ bool PostgreSQLConnection::RollbackTransaction()
unsigned long PostgreSQLConnection::escape_string(char* to, const char* from, unsigned long length)
{
if (!mPGconn || !to || !from || !length)
{ return 0; }
{
return 0;
}
return PQescapeString(to, from, length);
}

View file

@ -154,7 +154,9 @@ class Field
{
uint64 value = 0;
if (!mValue || sscanf(mValue, UI64FMTD, &value) == -1)
{ return 0; }
{
return 0;
}
return value;
}

View file

@ -176,7 +176,9 @@ class QueryNamedResult
for (size_t idx = 0; idx < mFieldNames.size(); ++idx)
{
if (mFieldNames[idx] == name)
{ return idx; }
{
return idx;
}
}
MANGOS_ASSERT(false && "unknown field name");
return uint32(-1);

View file

@ -47,7 +47,9 @@ bool QueryResultMysql::NextRow()
MYSQL_ROW row;
if (!mResult)
{ return false; }
{
return false;
}
row = mysql_fetch_row(mResult);
if (!row)

View file

@ -45,7 +45,9 @@ QueryResultPostgre::~QueryResultPostgre()
bool QueryResultPostgre::NextRow()
{
if (!mResult)
{ return false; }
{
return false;
}
if (mTableIndex >= mRowCount)
{
@ -58,7 +60,9 @@ bool QueryResultPostgre::NextRow()
{
pPQgetvalue = PQgetvalue(mResult, mTableIndex, j);
if (pPQgetvalue && !(*pPQgetvalue))
{ pPQgetvalue = NULL; }
{
pPQgetvalue = NULL;
}
mCurrentRow[j].SetValue(pPQgetvalue);
}

View file

@ -75,7 +75,9 @@ void SQLStorageBase::prepareToLoad(uint32 maxEntry, uint32 recordCount, uint32 r
void SQLStorageBase::Free()
{
if (!m_data)
{ return; }
{
return;
}
uint32 offset = 0;
for (uint32 x = 0; x < m_dstFieldCount; ++x)
@ -193,7 +195,9 @@ void SQLHashStorage::EraseEntry(uint32 id)
// do not erase from m_records
RecordMap::iterator find = m_indexMap.find(id);
if (find != m_indexMap.end())
{ find->second = NULL; }
{
find->second = NULL;
}
}
SQLHashStorage::SQLHashStorage(const char* fmt, const char* _entry_field, const char* sqlname)

View file

@ -298,7 +298,9 @@ class SQLStorage : public SQLStorageBase
T const* LookupEntry(uint32 id) const
{
if (id >= GetMaxEntry())
{ return NULL; }
{
return NULL;
}
return reinterpret_cast<T const*>(m_Index[id]);
}
@ -390,7 +392,9 @@ class SQLHashStorage : public SQLStorageBase
{
RecordMap::const_iterator find = m_indexMap.find(id);
if (find != m_indexMap.end())
{ return reinterpret_cast<T const*>(find->second); }
{
return reinterpret_cast<T const*>(find->second);
}
return NULL;
}

View file

@ -266,7 +266,9 @@ void SQLStorageLoaderBase<DerivedLoader, StorageClass>::Load(StorageClass& store
if (!result)
{
if (error_at_empty)
{ sLog.outError("%s table is empty!\n", store.GetTableName()); }
{
sLog.outError("%s table is empty!\n", store.GetTableName());
}
else
{ sLog.outString("%s table is empty!\n", store.GetTableName()); }
@ -348,7 +350,9 @@ void SQLStorageLoaderBase<DerivedLoader, StorageClass>::Load(StorageClass& store
// It is required that the input has at least as many columns set as the output requires
if (y >= store.GetSrcFieldCount())
{ assert(false && "SQL storage has too few columns!"); }
{
assert(false && "SQL storage has too few columns!");
}
switch (store.GetSrcFormat(y))
{

View file

@ -50,7 +50,9 @@ SqlTransaction::~SqlTransaction()
bool SqlTransaction::Execute(SqlConnection* conn)
{
if (m_queue.empty())
{ return true; }
{
return true;
}
LOCK_DB_CONN(conn);
@ -91,7 +93,9 @@ bool SqlPreparedRequest::Execute(SqlConnection* conn)
bool SqlQuery::Execute(SqlConnection* conn)
{
if (!m_callback || !m_queue)
{ return false; }
{
return false;
}
LOCK_DB_CONN(conn);
/// execute the query and store the result in the callback
@ -116,7 +120,9 @@ void SqlResultQueue::Update()
bool SqlQueryHolder::Execute(MaNGOS::IQueryCallback* callback, SqlDelayThread* thread, SqlResultQueue* queue)
{
if (!callback || !thread || !queue)
{ return false; }
{
return false;
}
/// delay the execution of the queries, sync them with the delay thread
/// which will in turn resync on execution (via the queue) and call back
@ -189,7 +195,9 @@ void SqlQueryHolder::SetResult(size_t index, QueryResult* result)
{
/// store the result in the holder
if (index < m_queries.size())
{ m_queries[index].second = result; }
{
m_queries[index].second = result;
}
}
SqlQueryHolder::~SqlQueryHolder()
@ -215,7 +223,9 @@ void SqlQueryHolder::SetSize(size_t size)
bool SqlQueryHolderEx::Execute(SqlConnection* conn)
{
if (!m_holder || !m_callback || !m_queue)
{ return false; }
{
return false;
}
LOCK_DB_CONN(conn);
/// we can do this, we are friends

View file

@ -28,7 +28,9 @@ SqlStmtParameters::SqlStmtParameters(uint32 nParams)
{
// reserve memory if needed
if (nParams > 0)
{ m_params.reserve(nParams); }
{
m_params.reserve(nParams);
}
}
void SqlStmtParameters::reset(const SqlStatement& stmt)
@ -36,7 +38,9 @@ void SqlStmtParameters::reset(const SqlStatement& stmt)
m_params.clear();
// reserve memory if needed
if (stmt.arguments() > 0)
{ m_params.reserve(stmt.arguments()); }
{
m_params.reserve(stmt.arguments());
}
}
//////////////////////////////////////////////////////////////////////////
@ -51,7 +55,9 @@ SqlStatement& SqlStatement::operator=(const SqlStatement& index)
m_pParams = NULL;
if (index.m_pParams)
{ m_pParams = new SqlStmtParameters(*(index.m_pParams)); }
{
m_pParams = new SqlStmtParameters(*(index.m_pParams));
}
}
return *this;
@ -132,7 +138,9 @@ void SqlPlainPreparedStatement::bind(const SqlStmtParameters& holder)
bool SqlPlainPreparedStatement::execute()
{
if (m_szPlainRequest.empty())
{ return false; }
{
return false;
}
return m_pConn.Execute(m_szPlainRequest.c_str());
}

View file

@ -446,7 +446,9 @@ class SqlStatement
SqlStatement(const SqlStatement& index) : m_index(index.m_index), m_pDB(index.m_pDB), m_pParams(NULL)
{
if (index.m_pParams)
{ m_pParams = new SqlStmtParameters(*(index.m_pParams)); }
{
m_pParams = new SqlStmtParameters(*(index.m_pParams));
}
}
/**
@ -655,7 +657,9 @@ class SqlStatement
SqlStmtParameters* get()
{
if (!m_pParams)
{ m_pParams = new SqlStmtParameters(arguments()); }
{
m_pParams = new SqlStmtParameters(arguments());
}
return m_pParams;
}

View file

@ -86,7 +86,9 @@ namespace ACE_Based
ACE_GUARD_RETURN(LockType, g, this->_lock, false);
if (_queue.empty())
{ return false; }
{
return false;
}
result = _queue.front();
_queue.pop_front();
@ -107,11 +109,15 @@ namespace ACE_Based
ACE_GUARD_RETURN(LockType, g, this->_lock, false);
if (_queue.empty())
{ return false; }
{
return false;
}
result = _queue.front();
if (!check.Process(result))
{ return false; }
{
return false;
}
_queue.pop_front();
return true;

View file

@ -100,10 +100,14 @@ void Log::InitColors(const std::string& str)
ss >> color[i];
if (!ss)
{ return; }
{
return;
}
if (color[i] < 0 || color[i] >= Color_count)
{ return; }
{
return;
}
}
for (int i = 0; i < LogType_count; ++i)
@ -197,7 +201,9 @@ void Log::SetLogLevel(char* level)
int32 newLevel = atoi((char*)level);
if (newLevel < LOG_LVL_MINIMAL)
{ newLevel = LOG_LVL_MINIMAL; }
{
newLevel = LOG_LVL_MINIMAL;
}
else if (newLevel > LOG_LVL_DEBUG)
{ newLevel = LOG_LVL_DEBUG; }
@ -211,7 +217,9 @@ void Log::SetLogFileLevel(char* level)
int32 newLevel = atoi((char*)level);
if (newLevel < LOG_LVL_MINIMAL)
{ newLevel = LOG_LVL_MINIMAL; }
{
newLevel = LOG_LVL_MINIMAL;
}
else if (newLevel > LOG_LVL_DEBUG)
{ newLevel = LOG_LVL_DEBUG; }
@ -227,7 +235,9 @@ void Log::Initialize()
if (!m_logsDir.empty())
{
if ((m_logsDir.at(m_logsDir.length() - 1) != '/') && (m_logsDir.at(m_logsDir.length() - 1) != '\\'))
{ m_logsDir.append("/"); }
{
m_logsDir.append("/");
}
}
m_logsTimestamp = "_" + GetTimestampStr();
@ -237,7 +247,9 @@ void Log::Initialize()
m_gmlog_per_account = sConfig.GetBoolDefault("GmLogPerAccount", false);
if (!m_gmlog_per_account)
{ gmLogfile = openLogFile("GMLogFile", "GmLogTimestamp", "a"); }
{
gmLogfile = openLogFile("GMLogFile", "GmLogTimestamp", "a");
}
else
{
// GM log settings for per account case
@ -250,7 +262,9 @@ void Log::Initialize()
if (dot_pos != m_gmlog_filename_format.npos)
{
if (m_gmlog_timestamp)
{ m_gmlog_filename_format.insert(dot_pos, m_logsTimestamp); }
{
m_gmlog_filename_format.insert(dot_pos, m_logsTimestamp);
}
m_gmlog_filename_format.insert(dot_pos, "_#%u");
}
@ -259,7 +273,9 @@ void Log::Initialize()
m_gmlog_filename_format += "_#%u";
if (m_gmlog_timestamp)
{ m_gmlog_filename_format += m_logsTimestamp; }
{
m_gmlog_filename_format += m_logsTimestamp;
}
}
m_gmlog_filename_format = m_logsDir + m_gmlog_filename_format;
@ -286,7 +302,9 @@ void Log::Initialize()
for (int i = 0; i < LOG_FILTER_COUNT; ++i)
if (*logFilterData[i].name)
if (sConfig.GetBoolDefault(logFilterData[i].configName, logFilterData[i].defaultState))
{ m_logFilter |= (1 << i); }
{
m_logFilter |= (1 << i);
}
// Char log settings
m_charLog_Dump = sConfig.GetBoolDefault("CharLogDump", false);
@ -296,13 +314,17 @@ FILE* Log::openLogFile(char const* configFileName, char const* configTimeStampFl
{
std::string logfn = sConfig.GetStringDefault(configFileName, "");
if (logfn.empty())
{ return NULL; }
{
return NULL;
}
if (configTimeStampFlag && sConfig.GetBoolDefault(configTimeStampFlag, false))
{
size_t dot_pos = logfn.find_last_of(".");
if (dot_pos != logfn.npos)
{ logfn.insert(dot_pos, m_logsTimestamp); }
{
logfn.insert(dot_pos, m_logsTimestamp);
}
else
{ logfn += m_logsTimestamp; }
}
@ -313,7 +335,9 @@ FILE* Log::openLogFile(char const* configFileName, char const* configTimeStampFl
FILE* Log::openGmlogPerAccount(uint32 account)
{
if (m_gmlog_filename_format.empty())
{ return NULL; }
{
return NULL;
}
char namebuf[MANGOS_PATH_MAX];
snprintf(namebuf, MANGOS_PATH_MAX, m_gmlog_filename_format.c_str(), account);
@ -364,7 +388,9 @@ std::string Log::GetTimestampStr()
void Log::outString()
{
if (m_includeTime)
{ outTime(); }
{
outTime();
}
printf("\n");
if (logfile)
{
@ -379,13 +405,19 @@ void Log::outString()
void Log::outString(const char* str, ...)
{
if (!str)
{ return; }
{
return;
}
if (m_colored)
{ SetColor(true, m_colors[LogNormal]); }
{
SetColor(true, m_colors[LogNormal]);
}
if (m_includeTime)
{ outTime(); }
{
outTime();
}
va_list ap;
@ -394,7 +426,9 @@ void Log::outString(const char* str, ...)
va_end(ap);
if (m_colored)
{ ResetColor(true); }
{
ResetColor(true);
}
printf("\n");
@ -461,7 +495,9 @@ void Log::outError(const char* err, ...)
void Log::outErrorDb()
{
if (m_includeTime)
{ outTime(); }
{
outTime();
}
fprintf(stderr, "\n");
@ -485,13 +521,19 @@ void Log::outErrorDb()
void Log::outErrorDb(const char* err, ...)
{
if (!err)
{ return; }
{
return;
}
if (m_colored)
{ SetColor(false, m_colors[LogError]); }
{
SetColor(false, m_colors[LogError]);
}
if (m_includeTime)
{ outTime(); }
{
outTime();
}
va_list ap;
@ -500,7 +542,9 @@ void Log::outErrorDb(const char* err, ...)
va_end(ap);
if (m_colored)
{ ResetColor(false); }
{
ResetColor(false);
}
fprintf(stderr, "\n");
@ -621,7 +665,9 @@ void Log::outErrorEluna(const char* err, ...) {}
void Log::outErrorEventAI()
{
if (m_includeTime)
{ outTime(); }
{
outTime();
}
fprintf(stderr, "\n");
@ -645,13 +691,19 @@ void Log::outErrorEventAI()
void Log::outErrorEventAI(const char* err, ...)
{
if (!err)
{ return; }
{
return;
}
if (m_colored)
{ SetColor(false, m_colors[LogError]); }
{
SetColor(false, m_colors[LogError]);
}
if (m_includeTime)
{ outTime(); }
{
outTime();
}
va_list ap;
@ -660,7 +712,9 @@ void Log::outErrorEventAI(const char* err, ...)
va_end(ap);
if (m_colored)
{ ResetColor(false); }
{
ResetColor(false);
}
fprintf(stderr, "\n");
@ -696,15 +750,21 @@ void Log::outErrorEventAI(const char* err, ...)
void Log::outBasic(const char* str, ...)
{
if (!str)
{ return; }
{
return;
}
if (m_logLevel >= LOG_LVL_BASIC)
{
if (m_colored)
{ SetColor(true, m_colors[LogDetails]); }
{
SetColor(true, m_colors[LogDetails]);
}
if (m_includeTime)
{ outTime(); }
{
outTime();
}
va_list ap;
va_start(ap, str);
@ -712,7 +772,9 @@ void Log::outBasic(const char* str, ...)
va_end(ap);
if (m_colored)
{ ResetColor(true); }
{
ResetColor(true);
}
printf("\n");
}
@ -734,15 +796,21 @@ void Log::outBasic(const char* str, ...)
void Log::outDetail(const char* str, ...)
{
if (!str)
{ return; }
{
return;
}
if (m_logLevel >= LOG_LVL_DETAIL)
{
if (m_colored)
{ SetColor(true, m_colors[LogDetails]); }
{
SetColor(true, m_colors[LogDetails]);
}
if (m_includeTime)
{ outTime(); }
{
outTime();
}
va_list ap;
va_start(ap, str);
@ -750,7 +818,9 @@ void Log::outDetail(const char* str, ...)
va_end(ap);
if (m_colored)
{ ResetColor(true); }
{
ResetColor(true);
}
printf("\n");
}
@ -775,15 +845,21 @@ void Log::outDebug(const char* str, ...)
{
#ifdef MANGOS_DEBUG
if (!str)
{ return; }
{
return;
}
if (m_logLevel >= LOG_LVL_DEBUG)
{
if (m_colored)
{ SetColor(true, m_colors[LogDebug]); }
{
SetColor(true, m_colors[LogDebug]);
}
if (m_includeTime)
{ outTime(); }
{
outTime();
}
va_list ap;
va_start(ap, str);
@ -791,7 +867,9 @@ void Log::outDebug(const char* str, ...)
va_end(ap);
if (m_colored)
{ ResetColor(true); }
{
ResetColor(true);
}
printf("\n");
}
@ -816,15 +894,21 @@ void Log::outDebug(const char* str, ...)
void Log::outCommand(uint32 account, const char* str, ...)
{
if (!str)
{ return; }
{
return;
}
if (m_logLevel >= LOG_LVL_DETAIL)
{
if (m_colored)
{ SetColor(true, m_colors[LogDetails]); }
{
SetColor(true, m_colors[LogDetails]);
}
if (m_includeTime)
{ outTime(); }
{
outTime();
}
va_list ap;
va_start(ap, str);
@ -832,7 +916,9 @@ void Log::outCommand(uint32 account, const char* str, ...)
va_end(ap);
if (m_colored)
{ ResetColor(true); }
{
ResetColor(true);
}
printf("\n");
}
@ -941,7 +1027,9 @@ void Log::outWarden(const char* str, ...)
void Log::outChar(const char* str, ...)
{
if (!str)
{ return; }
{
return;
}
if (charLogfile)
{
@ -958,7 +1046,9 @@ void Log::outChar(const char* str, ...)
void Log::outErrorScriptLib()
{
if (m_includeTime)
{ outTime(); }
{
outTime();
}
fprintf(stderr, "\n");
@ -966,7 +1056,9 @@ void Log::outErrorScriptLib()
{
outTimestamp(logfile);
if (m_scriptLibName)
{ fprintf(logfile, "<%s ERROR:> ", m_scriptLibName); }
{
fprintf(logfile, "<%s ERROR:> ", m_scriptLibName);
}
else
{ fprintf(logfile, "<Scripting Library ERROR>: "); }
fflush(logfile);
@ -985,13 +1077,19 @@ void Log::outErrorScriptLib()
void Log::outErrorScriptLib(const char* err, ...)
{
if (!err)
{ return; }
{
return;
}
if (m_colored)
{ SetColor(false, m_colors[LogError]); }
{
SetColor(false, m_colors[LogError]);
}
if (m_includeTime)
{ outTime(); }
{
outTime();
}
va_list ap;
@ -1000,7 +1098,9 @@ void Log::outErrorScriptLib(const char* err, ...)
va_end(ap);
if (m_colored)
{ ResetColor(false); }
{
ResetColor(false);
}
fprintf(stderr, "\n");
@ -1008,7 +1108,9 @@ void Log::outErrorScriptLib(const char* err, ...)
{
outTimestamp(logfile);
if (m_scriptLibName)
{ fprintf(logfile, "<%s ERROR>: ", m_scriptLibName); }
{
fprintf(logfile, "<%s ERROR>: ", m_scriptLibName);
}
else
{ fprintf(logfile, "<Scripting Library ERROR>: "); }
@ -1039,7 +1141,9 @@ void Log::outErrorScriptLib(const char* err, ...)
void Log::outWorldPacketDump(uint32 socket, uint32 opcode, char const* opcodeName, ByteBuffer const* packet, bool incoming)
{
if (!worldLogfile)
{ return; }
{
return;
}
ACE_GUARD(ACE_Thread_Mutex, GuardObj, m_worldLogMtx);
@ -1074,7 +1178,9 @@ void Log::outCharDump(const char* str, uint32 account_id, uint32 guid, const cha
void Log::outRALog(const char* str, ...)
{
if (!str)
{ return; }
{
return;
}
if (raLogfile)
{
@ -1118,7 +1224,9 @@ void Log::setScriptLibraryErrorFile(char const* fname, char const* libName)
m_scriptLibName = libName;
if (scriptErrLogFile)
{ fclose(scriptErrLogFile); }
{
fclose(scriptErrLogFile);
}
if (!fname)
{
@ -1134,7 +1242,9 @@ void Log::setScriptLibraryErrorFile(char const* fname, char const* libName)
void outstring_log(const char* str, ...)
{
if (!str)
{ return; }
{
return;
}
char buf[256];
va_list ap;
@ -1148,7 +1258,9 @@ void outstring_log(const char* str, ...)
void detail_log(const char* str, ...)
{
if (!str)
{ return; }
{
return;
}
char buf[256];
va_list ap;
@ -1162,7 +1274,9 @@ void detail_log(const char* str, ...)
void debug_log(const char* str, ...)
{
if (!str)
{ return; }
{
return;
}
char buf[256];
va_list ap;
@ -1176,7 +1290,9 @@ void debug_log(const char* str, ...)
void error_log(const char* str, ...)
{
if (!str)
{ return; }
{
return;
}
char buf[256];
va_list ap;
@ -1190,7 +1306,9 @@ void error_log(const char* str, ...)
void error_db_log(const char* str, ...)
{
if (!str)
{ return; }
{
return;
}
char buf[256];
va_list ap;
@ -1209,7 +1327,9 @@ void setScriptLibraryErrorFile(char const* fname, char const* libName)
void script_error_log(const char* str, ...)
{
if (!str)
{ return; }
{
return;
}
char buf[256];
va_list ap;

View file

@ -133,19 +133,27 @@ class Log : public MaNGOS::Singleton<Log, MaNGOS::ClassLevelLockable<Log, ACE_Th
~Log()
{
if (logfile != NULL)
{ fclose(logfile); }
{
fclose(logfile);
}
logfile = NULL;
if (gmLogfile != NULL)
{ fclose(gmLogfile); }
{
fclose(gmLogfile);
}
gmLogfile = NULL;
if (charLogfile != NULL)
{ fclose(charLogfile); }
{
fclose(charLogfile);
}
charLogfile = NULL;
if (dberLogfile != NULL)
{ fclose(dberLogfile); }
{
fclose(dberLogfile);
}
dberLogfile = NULL;
#ifdef ENABLE_ELUNA
@ -155,19 +163,27 @@ class Log : public MaNGOS::Singleton<Log, MaNGOS::ClassLevelLockable<Log, ACE_Th
#endif /* ENABLE_ELUNA */
if (eventAiErLogfile != NULL)
{ fclose(eventAiErLogfile); }
{
fclose(eventAiErLogfile);
}
eventAiErLogfile = NULL;
if (scriptErrLogFile != NULL)
{ fclose(scriptErrLogFile); }
{
fclose(scriptErrLogFile);
}
scriptErrLogFile = NULL;
if (raLogfile != NULL)
{ fclose(raLogfile); }
{
fclose(raLogfile);
}
raLogfile = NULL;
if (worldLogfile != NULL)
{ fclose(worldLogfile); }
{
fclose(worldLogfile);
}
worldLogfile = NULL;
if (wardenLogfile != NULL)

View file

@ -72,7 +72,9 @@ ThreadPriority::ThreadPriority()
const size_t _divider = 4;
size_t _div = (norm_pos - min_pos) / _divider;
if (_div == 0)
{ _div = 1; }
{
_div = 1;
}
min_pos = (norm_pos - 1);
@ -81,7 +83,9 @@ ThreadPriority::ThreadPriority()
_div = (max_pos - norm_pos) / _divider;
if (_div == 0)
{ _div = 1; }
{
_div = 1;
}
min_pos = norm_pos - 1;
@ -93,10 +97,14 @@ ThreadPriority::ThreadPriority()
int ThreadPriority::getPriority(Priority p) const
{
if (p < Idle)
{ p = Idle; }
{
p = Idle;
}
if (p > Realtime)
{ p = Realtime; }
{
p = Realtime;
}
return m_priority[p];
}
@ -115,7 +123,9 @@ Thread::Thread(Runnable* instance) : m_iThreadId(0), m_hThreadHandle(0), m_task(
{
// register reference to m_task to prevent it deeltion until destructor
if (m_task)
{ m_task->incReference(); }
{
m_task->incReference();
}
bool _start = start();
MANGOS_ASSERT(_start);
@ -127,7 +137,9 @@ Thread::~Thread()
// deleted runnable object (if no other references)
if (m_task)
{ m_task->decReference(); }
{
m_task->decReference();
}
}
// initialize Thread's class static member
@ -137,7 +149,9 @@ ThreadPriority Thread::m_TpEnum;
bool Thread::start()
{
if (m_task == 0 || m_iThreadId != 0)
{ return false; }
{
return false;
}
// incRef before spawing the thread, otherwise Thread::ThreadTask() might call decRef and delete m_task
m_task->incReference();
@ -147,7 +161,9 @@ bool Thread::start()
bool res = (ACE_Thread::spawn(&Thread::ThreadTask, (void*)m_task, THREADFLAG, &m_iThreadId, &m_hThreadHandle) == 0);
if (res)
{ m_task->decReference(); }
{
m_task->decReference();
}
return res;
}
@ -155,7 +171,9 @@ bool Thread::start()
bool Thread::wait()
{
if (!m_hThreadHandle || !m_task)
{ return false; }
{
return false;
}
ACE_THR_FUNC_RETURN _value = ACE_THR_FUNC_RETURN(-1);
int _res = ACE_Thread::join(m_hThreadHandle, &_value);
@ -171,10 +189,14 @@ bool Thread::wait()
void Thread::destroy()
{
if (!m_iThreadId || !m_task)
{ return; }
{
return;
}
if (ACE_Thread::kill(m_iThreadId, -1) != 0)
{ return; }
{
return;
}
m_iThreadId = 0;
m_hThreadHandle = 0;

View file

@ -62,7 +62,9 @@ namespace ACE_Based
void decReference()
{
if (!--m_refs)
{ delete this; }
{
delete this;
}
}
private:
ACE_Atomic_Op<ACE_Thread_Mutex, long> m_refs; /**< TODO */

View file

@ -645,7 +645,9 @@ class ByteBuffer
{
char c = read<char>();
if (c == 0)
{ break; }
{
break;
}
value += c;
}
return *this;
@ -726,7 +728,9 @@ class ByteBuffer
{
ResetBitReader();
if (_rpos + skip > size())
{ throw ByteBufferException(false, _rpos, skip, size()); }
{
throw ByteBufferException(false, _rpos, skip, size());
}
_rpos += skip;
return *this;
@ -754,7 +758,9 @@ class ByteBuffer
template <typename T> T read(size_t pos) const
{
if (pos + sizeof(T) > size())
{ throw ByteBufferException(false, pos, sizeof(T), size()); }
{
throw ByteBufferException(false, pos, sizeof(T), size());
}
T val = *((T const*)&_storage[pos]);
EndianConvert(val);
return val;
@ -770,7 +776,9 @@ class ByteBuffer
{
ResetBitReader();
if (_rpos + len > size())
{ throw ByteBufferException(false, _rpos, len, size()); }
{
throw ByteBufferException(false, _rpos, len, size());
}
memcpy(dest, &_storage[_rpos], len);
_rpos += len;
@ -929,7 +937,9 @@ class ByteBuffer
void reserve(size_t ressize)
{
if (ressize > size())
{ _storage.reserve(ressize); }
{
_storage.reserve(ressize);
}
}
/**
@ -978,7 +988,9 @@ class ByteBuffer
MANGOS_ASSERT(size() < 10000000);
if (_storage.size() < _wpos + cnt)
{ _storage.resize(_wpos + cnt); }
{
_storage.resize(_wpos + cnt);
}
memcpy(&_storage[_wpos], src, cnt);
_wpos += cnt;
@ -1049,7 +1061,9 @@ class ByteBuffer
void put(size_t pos, const uint8* src, size_t cnt)
{
if (pos + cnt > size())
{ throw ByteBufferException(true, pos, cnt, size()); }
{
throw ByteBufferException(true, pos, cnt, size());
}
memcpy(&_storage[pos], src, cnt);
}

View file

@ -44,7 +44,9 @@ BarGoLink::BarGoLink(int row_count)
BarGoLink::~BarGoLink()
{
if (!m_showOutput)
{ return; }
{
return;
}
printf("\n");
fflush(stdout);
@ -58,7 +60,9 @@ void BarGoLink::init(int row_count)
num_rec = row_count;
if (!m_showOutput)
{ return; }
{
return;
}
#ifdef _WIN32
printf("\x3D");
@ -77,7 +81,9 @@ void BarGoLink::init(int row_count)
void BarGoLink::step()
{
if (!m_showOutput)
{ return; }
{
return;
}
int i, n;

View file

@ -129,7 +129,9 @@ class IntervalTimer
{
_current += diff;
if (_current < 0)
{ _current = 0; }
{
_current = 0;
}
}
/**
* @brief
@ -144,7 +146,9 @@ class IntervalTimer
void Reset()
{
if (_current >= _interval)
{ _current -= _interval; }
{
_current -= _interval;
}
}
/**
@ -213,7 +217,9 @@ class ShortIntervalTimer
void Reset()
{
if (_current >= _interval)
{ _current -= _interval; }
{
_current -= _interval;
}
}
/**

View file

@ -148,7 +148,9 @@ Tokens StrSplit(const std::string& src, const std::string& sep)
uint32 GetUInt32ValueFromArray(Tokens const& data, uint16 index)
{
if (index >= data.size())
{ return 0; }
{
return 0;
}
return (uint32)atoi(data[index].c_str());
}
@ -197,7 +199,9 @@ void stripLineInvisibleChars(std::string& str)
else
{
if (wpos != pos)
{ str[wpos++] = str[pos]; }
{
str[wpos++] = str[pos];
}
else
{ ++wpos; }
space = false;
@ -205,7 +209,9 @@ void stripLineInvisibleChars(std::string& str)
}
if (wpos < str.size())
{ str.erase(wpos, str.size()); }
{
str.erase(wpos, str.size());
}
}
std::string secsToTimeString(time_t timeInSecs, bool shortText, bool hoursOnly)
@ -217,15 +223,23 @@ std::string secsToTimeString(time_t timeInSecs, bool shortText, bool hoursOnly)
std::ostringstream ss;
if (days)
{ ss << days << (shortText ? "d" : " Day(s) "); }
{
ss << days << (shortText ? "d" : " Day(s) ");
}
if (hours || hoursOnly)
{ ss << hours << (shortText ? "h" : " Hour(s) "); }
{
ss << hours << (shortText ? "h" : " Hour(s) ");
}
if (!hoursOnly)
{
if (minutes)
{ ss << minutes << (shortText ? "m" : " Minute(s) "); }
{
ss << minutes << (shortText ? "m" : " Minute(s) ");
}
if (secs || (!days && !hours && !minutes))
{ ss << secs << (shortText ? "s" : " Second(s)."); }
{
ss << secs << (shortText ? "s" : " Second(s).");
}
}
return ss.str();
@ -311,7 +325,9 @@ std::string MoneyToString(uint64 money)
bool IsIPAddress(char const* ipaddress)
{
if (!ipaddress)
{ return false; }
{
return false;
}
// Let the big boys do it.
// Drawback: all valid ip address formats are recognized e.g.: 12.23,121234,0xABCD)
@ -338,7 +354,9 @@ uint32 CreatePIDFile(const std::string& filename)
{
FILE* pid_file = fopen(filename.c_str(), "w");
if (pid_file == NULL)
{ return 0; }
{
return 0;
}
#ifdef WIN32
DWORD pid = GetCurrentProcessId();
@ -371,7 +389,9 @@ void utf8truncate(std::string& utf8str, size_t len)
{
size_t wlen = utf8::distance(utf8str.c_str(), utf8str.c_str() + utf8str.size());
if (wlen <= len)
{ return; }
{
return;
}
std::wstring wstr;
wstr.resize(wlen);
@ -405,7 +425,9 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
if (len > wsize)
{
if (wsize > 0)
{ wstr[0] = L'\0'; }
{
wstr[0] = L'\0';
}
wsize = 0;
return false;
}
@ -417,7 +439,9 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
catch (std::exception)
{
if (wsize > 0)
{ wstr[0] = L'\0'; }
{
wstr[0] = L'\0';
}
wsize = 0;
return false;
}
@ -433,7 +457,9 @@ bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr)
wstr.resize(len);
if (len)
{ utf8::utf8to16(utf8str.c_str(), utf8str.c_str() + utf8str.size(), &wstr[0]); }
{
utf8::utf8to16(utf8str.c_str(), utf8str.c_str() + utf8str.size(), &wstr[0]);
}
}
catch (std::exception)
{
@ -490,7 +516,9 @@ std::wstring GetMainPartOfName(std::wstring wname, uint32 declension)
{
// supported only Cyrillic cases
if (wname.size() < 1 || !isCyrillicCharacter(wname[0]) || declension > 5)
{ return wname; }
{
return wname;
}
// Important: end length must be <= MAX_INTERNAL_PLAYER_NAME-MAX_PLAYER_NAME (3 currently)
@ -526,7 +554,9 @@ std::wstring GetMainPartOfName(std::wstring wname, uint32 declension)
size_t len = size_t((*itr)[-1]); // get length from string size field
if (wname.substr(wname.size() - len, len) == *itr)
{ return wname.substr(0, wname.size() - len); }
{
return wname.substr(0, wname.size() - len);
}
}
return wname;
@ -538,7 +568,9 @@ bool utf8ToConsole(const std::string& utf8str, std::string& conStr)
#if PLATFORM == PLATFORM_WINDOWS
std::wstring wstr;
if (!Utf8toWStr(utf8str, wstr))
{ return false; }
{
return false;
}
conStr.resize(wstr.size());
CharToOemBuffW(&wstr[0], &conStr[0], wstr.size());
@ -570,13 +602,17 @@ bool Utf8FitTo(const std::string& str, std::wstring search)
std::wstring temp;
if (!Utf8toWStr(str, temp))
{ return false; }
{
return false;
}
// converting to lower case
wstrToLower(temp);
if (temp.find(search) == std::wstring::npos)
{ return false; }
{
return false;
}
return true;
}
@ -609,7 +645,9 @@ void hexEncodeByteArray(uint8* bytes, uint32 arrayLen, std::string& result)
unsigned char nibble = 0x0F & (bytes[i] >> ((1 - j) * 4));
char encodedNibble;
if (nibble < 0x0A)
{ encodedNibble = '0' + nibble; }
{
encodedNibble = '0' + nibble;
}
else
{ encodedNibble = 'A' + nibble - 0x0A; }
ss << encodedNibble;
@ -673,7 +711,9 @@ void utf8print(void* /*arg*/, const char* str)
wchar_t wtemp_buf[6000];
size_t wtemp_len = 6000 - 1;
if (!Utf8toWStr(str, strlen(str), wtemp_buf, wtemp_len))
{ return; }
{
return;
}
char temp_buf[6000];
CharToOemBuffW(&wtemp_buf[0], &temp_buf[0], wtemp_len + 1);
@ -796,4 +836,4 @@ void print_banner()
"\n");
break;
}
}
}

View file

@ -234,7 +234,9 @@ inline void ApplyModUInt32Var(uint32& var, int32 val, bool apply)
int32 cur = var;
cur += (apply ? val : -val);
if (cur < 0)
{ cur = 0; }
{
cur = 0;
}
var = cur;
}
@ -249,7 +251,9 @@ inline void ApplyModFloatVar(float& var, float val, bool apply)
{
var += (apply ? val : -val);
if (var < 0)
{ var = 0; }
{
var = 0;
}
}
/**
@ -262,7 +266,9 @@ inline void ApplyModFloatVar(float& var, float val, bool apply)
inline void ApplyPercentModFloatVar(float& var, float val, bool apply)
{
if (val == -100.0f) // prevent set var to zero
{ val = -99.99f; }
{
val = -99.99f;
}
var *= (apply ? (100.0f + val) / 100.0f : 100.0f / (100.0f + val));
}
@ -347,9 +353,13 @@ void utf8truncate(std::string& utf8str, size_t len);
inline bool isBasicLatinCharacter(wchar_t wchar)
{
if (wchar >= L'a' && wchar <= L'z') // LATIN SMALL LETTER A - LATIN SMALL LETTER Z
{ return true; }
{
return true;
}
if (wchar >= L'A' && wchar <= L'Z') // LATIN CAPITAL LETTER A - LATIN CAPITAL LETTER Z
{ return true; }
{
return true;
}
return false;
}
@ -362,21 +372,37 @@ inline bool isBasicLatinCharacter(wchar_t wchar)
inline bool isExtendedLatinCharacter(wchar_t wchar)
{
if (isBasicLatinCharacter(wchar))
{ return true; }
{
return true;
}
if (wchar >= 0x00C0 && wchar <= 0x00D6) // LATIN CAPITAL LETTER A WITH GRAVE - LATIN CAPITAL LETTER O WITH DIAERESIS
{ return true; }
{
return true;
}
if (wchar >= 0x00D8 && wchar <= 0x00DF) // LATIN CAPITAL LETTER O WITH STROKE - LATIN CAPITAL LETTER THORN
{ return true; }
{
return true;
}
if (wchar == 0x00DF) // LATIN SMALL LETTER SHARP S
{ return true; }
{
return true;
}
if (wchar >= 0x00E0 && wchar <= 0x00F6) // LATIN SMALL LETTER A WITH GRAVE - LATIN SMALL LETTER O WITH DIAERESIS
{ return true; }
{
return true;
}
if (wchar >= 0x00F8 && wchar <= 0x00FE) // LATIN SMALL LETTER O WITH STROKE - LATIN SMALL LETTER THORN
{ return true; }
{
return true;
}
if (wchar >= 0x0100 && wchar <= 0x012F) // LATIN CAPITAL LETTER A WITH MACRON - LATIN SMALL LETTER I WITH OGONEK
{ return true; }
{
return true;
}
if (wchar == 0x1E9E) // LATIN CAPITAL LETTER SHARP S
{ return true; }
{
return true;
}
return false;
}
@ -389,9 +415,13 @@ inline bool isExtendedLatinCharacter(wchar_t wchar)
inline bool isCyrillicCharacter(wchar_t wchar)
{
if (wchar >= 0x0410 && wchar <= 0x044F) // CYRILLIC CAPITAL LETTER A - CYRILLIC SMALL LETTER YA
{ return true; }
{
return true;
}
if (wchar == 0x0401 || wchar == 0x0451) // CYRILLIC CAPITAL LETTER IO, CYRILLIC SMALL LETTER IO
{ return true; }
{
return true;
}
return false;
}
@ -404,21 +434,37 @@ inline bool isCyrillicCharacter(wchar_t wchar)
inline bool isEastAsianCharacter(wchar_t wchar)
{
if (wchar >= 0x1100 && wchar <= 0x11F9) // Hangul Jamo
{ return true; }
{
return true;
}
if (wchar >= 0x3041 && wchar <= 0x30FF) // Hiragana + Katakana
{ return true; }
{
return true;
}
if (wchar >= 0x3131 && wchar <= 0x318E) // Hangul Compatibility Jamo
{ return true; }
{
return true;
}
if (wchar >= 0x31F0 && wchar <= 0x31FF) // Katakana Phonetic Ext.
{ return true; }
{
return true;
}
if (wchar >= 0x3400 && wchar <= 0x4DB5) // CJK Ideographs Ext. A
{ return true; }
{
return true;
}
if (wchar >= 0x4E00 && wchar <= 0x9FC3) // Unified CJK Ideographs
{ return true; }
{
return true;
}
if (wchar >= 0xAC00 && wchar <= 0xD7A3) // Hangul Syllables
{ return true; }
{
return true;
}
if (wchar >= 0xFF01 && wchar <= 0xFFEE) // Halfwidth forms
{ return true; }
{
return true;
}
return false;
}
@ -476,7 +522,9 @@ inline bool isNumeric(char const* str)
{
for (char const* c = str; *c; ++c)
if (!isNumeric(*c))
{ return false; }
{
return false;
}
return true;
}
@ -491,7 +539,9 @@ inline bool isNumeric(std::string const& str)
{
for (std::string::const_iterator itr = str.begin(); itr != str.end(); ++itr)
if (!isNumeric(*itr))
{ return false; }
{
return false;
}
return true;
}
@ -506,7 +556,9 @@ inline bool isNumeric(std::wstring const& str)
{
for (std::wstring::const_iterator itr = str.begin(); itr != str.end(); ++itr)
if (!isNumeric(*itr))
{ return false; }
{
return false;
}
return true;
}
@ -522,7 +574,9 @@ inline bool isBasicLatinString(const std::wstring &wstr, bool numericOrSpace)
{
for (size_t i = 0; i < wstr.size(); ++i)
if (!isBasicLatinCharacter(wstr[i]) && (!numericOrSpace || !isNumericOrSpace(wstr[i])))
{ return false; }
{
return false;
}
return true;
}
@ -537,7 +591,9 @@ inline bool isExtendedLatinString(const std::wstring &wstr, bool numericOrSpace)
{
for (size_t i = 0; i < wstr.size(); ++i)
if (!isExtendedLatinCharacter(wstr[i]) && (!numericOrSpace || !isNumericOrSpace(wstr[i])))
{ return false; }
{
return false;
}
return true;
}
@ -552,7 +608,9 @@ inline bool isCyrillicString(const std::wstring &wstr, bool numericOrSpace)
{
for (size_t i = 0; i < wstr.size(); ++i)
if (!isCyrillicCharacter(wstr[i]) && (!numericOrSpace || !isNumericOrSpace(wstr[i])))
{ return false; }
{
return false;
}
return true;
}
@ -567,7 +625,9 @@ inline bool isEastAsianString(const std::wstring &wstr, bool numericOrSpace)
{
for (size_t i = 0; i < wstr.size(); ++i)
if (!isEastAsianCharacter(wstr[i]) && (!numericOrSpace || !isNumericOrSpace(wstr[i])))
{ return false; }
{
return false;
}
return true;
}
@ -600,22 +660,36 @@ inline void strToLower(std::string& str)
inline wchar_t wcharToUpper(wchar_t wchar)
{
if (wchar >= L'a' && wchar <= L'z') // LATIN SMALL LETTER A - LATIN SMALL LETTER Z
{ return wchar_t(uint16(wchar) - 0x0020); }
{
return wchar_t(uint16(wchar) - 0x0020);
}
if (wchar == 0x00DF) // LATIN SMALL LETTER SHARP S
{ return wchar_t(0x1E9E); }
{
return wchar_t(0x1E9E);
}
if (wchar >= 0x00E0 && wchar <= 0x00F6) // LATIN SMALL LETTER A WITH GRAVE - LATIN SMALL LETTER O WITH DIAERESIS
{ return wchar_t(uint16(wchar) - 0x0020); }
{
return wchar_t(uint16(wchar) - 0x0020);
}
if (wchar >= 0x00F8 && wchar <= 0x00FE) // LATIN SMALL LETTER O WITH STROKE - LATIN SMALL LETTER THORN
{ return wchar_t(uint16(wchar) - 0x0020); }
{
return wchar_t(uint16(wchar) - 0x0020);
}
if (wchar >= 0x0101 && wchar <= 0x012F) // LATIN SMALL LETTER A WITH MACRON - LATIN SMALL LETTER I WITH OGONEK (only %2=1)
{
if (wchar % 2 == 1)
{ return wchar_t(uint16(wchar) - 0x0001); }
{
return wchar_t(uint16(wchar) - 0x0001);
}
}
if (wchar >= 0x0430 && wchar <= 0x044F) // CYRILLIC SMALL LETTER A - CYRILLIC SMALL LETTER YA
{ return wchar_t(uint16(wchar) - 0x0020); }
{
return wchar_t(uint16(wchar) - 0x0020);
}
if (wchar == 0x0451) // CYRILLIC SMALL LETTER IO
{ return wchar_t(0x0401); }
{
return wchar_t(0x0401);
}
return wchar;
}
@ -640,22 +714,36 @@ inline wchar_t wcharToUpperOnlyLatin(wchar_t wchar)
inline wchar_t wcharToLower(wchar_t wchar)
{
if (wchar >= L'A' && wchar <= L'Z') // LATIN CAPITAL LETTER A - LATIN CAPITAL LETTER Z
{ return wchar_t(uint16(wchar) + 0x0020); }
{
return wchar_t(uint16(wchar) + 0x0020);
}
if (wchar >= 0x00C0 && wchar <= 0x00D6) // LATIN CAPITAL LETTER A WITH GRAVE - LATIN CAPITAL LETTER O WITH DIAERESIS
{ return wchar_t(uint16(wchar) + 0x0020); }
{
return wchar_t(uint16(wchar) + 0x0020);
}
if (wchar >= 0x00D8 && wchar <= 0x00DE) // LATIN CAPITAL LETTER O WITH STROKE - LATIN CAPITAL LETTER THORN
{ return wchar_t(uint16(wchar) + 0x0020); }
{
return wchar_t(uint16(wchar) + 0x0020);
}
if (wchar >= 0x0100 && wchar <= 0x012E) // LATIN CAPITAL LETTER A WITH MACRON - LATIN CAPITAL LETTER I WITH OGONEK (only %2=0)
{
if (wchar % 2 == 0)
{ return wchar_t(uint16(wchar) + 0x0001); }
{
return wchar_t(uint16(wchar) + 0x0001);
}
}
if (wchar == 0x1E9E) // LATIN CAPITAL LETTER SHARP S
{ return wchar_t(0x00DF); }
{
return wchar_t(0x00DF);
}
if (wchar == 0x0401) // CYRILLIC CAPITAL LETTER IO
{ return wchar_t(0x0451); }
{
return wchar_t(0x0451);
}
if (wchar >= 0x0410 && wchar <= 0x042F) // CYRILLIC CAPITAL LETTER A - CYRILLIC CAPITAL LETTER YA
{ return wchar_t(uint16(wchar) + 0x0020); }
{
return wchar_t(uint16(wchar) + 0x0020);
}
return wchar;
}

View file

@ -167,7 +167,9 @@ bool WinServiceUninstall()
if (QueryServiceStatus(service, &serviceStatus2))
{
if (serviceStatus2.dwCurrentState == SERVICE_STOPPED)
{ DeleteService(service); }
{
DeleteService(service);
}
}
CloseServiceHandle(service);

View file

@ -60,7 +60,9 @@ WheatyExceptionReport::WheatyExceptionReport() // Constructor
WheatyExceptionReport::~WheatyExceptionReport()
{
if (m_previousFilter)
{ SetUnhandledExceptionFilter(m_previousFilter); }
{
SetUnhandledExceptionFilter(m_previousFilter);
}
}
//===========================================================
@ -73,7 +75,9 @@ LONG WINAPI WheatyExceptionReport::WheatyUnhandledExceptionFilter(
GetModuleFileName(0, module_folder_name, MAX_PATH);
TCHAR* pos = _tcsrchr(module_folder_name, '\\');
if (!pos)
{ return 0; }
{
return 0;
}
pos[0] = '\0';
++pos;
@ -82,7 +86,9 @@ LONG WINAPI WheatyExceptionReport::WheatyUnhandledExceptionFilter(
if (!CreateDirectory(crash_folder_path, NULL))
{
if (GetLastError() != ERROR_ALREADY_EXISTS)
{ return 0; }
{
return 0;
}
}
SYSTEMTIME systime;
@ -109,7 +115,9 @@ LONG WINAPI WheatyExceptionReport::WheatyUnhandledExceptionFilter(
}
if (m_previousFilter)
{ return m_previousFilter(pExceptionInfo); }
{
return m_previousFilter(pExceptionInfo);
}
else
{ return EXCEPTION_EXECUTE_HANDLER/*EXCEPTION_CONTINUE_SEARCH*/; }
}
@ -117,20 +125,26 @@ LONG WINAPI WheatyExceptionReport::WheatyUnhandledExceptionFilter(
BOOL WheatyExceptionReport::_GetProcessorName(TCHAR* sProcessorName, DWORD maxcount)
{
if (!sProcessorName)
{ return FALSE; }
{
return FALSE;
}
HKEY hKey;
LONG lRet;
lRet = ::RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0"),
0, KEY_QUERY_VALUE, &hKey);
if (lRet != ERROR_SUCCESS)
{ return FALSE; }
{
return FALSE;
}
TCHAR szTmp[2048];
DWORD cntBytes = sizeof(szTmp);
lRet = ::RegQueryValueEx(hKey, _T("ProcessorNameString"), NULL, NULL,
(LPBYTE)szTmp, &cntBytes);
if (lRet != ERROR_SUCCESS)
{ return FALSE; }
{
return FALSE;
}
::RegCloseKey(hKey);
sProcessorName[0] = '\0';
// Skip spaces
@ -153,7 +167,9 @@ BOOL WheatyExceptionReport::_GetWindowsVersion(TCHAR* szVersion, DWORD cntMax)
{
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (!::GetVersionEx((OSVERSIONINFO*)&osvi))
{ return FALSE; }
{
return FALSE;
}
}
*szVersion = _T('\0');
TCHAR wszTmp[128];
@ -166,19 +182,25 @@ BOOL WheatyExceptionReport::_GetWindowsVersion(TCHAR* szVersion, DWORD cntMax)
{
default: // 2
if (osvi.wProductType == VER_NT_WORKSTATION)
{ _tcsncat(szVersion, _T("Windows 8 "), cntMax); }
{
_tcsncat(szVersion, _T("Windows 8 "), cntMax);
}
else
{ _tcsncat(szVersion, _T("Windows Server 2012 "), cntMax); }
break;
case 1:
if (osvi.wProductType == VER_NT_WORKSTATION)
{ _tcsncat(szVersion, _T("Windows 7 "), cntMax); }
{
_tcsncat(szVersion, _T("Windows 7 "), cntMax);
}
else
{ _tcsncat(szVersion, _T("Windows Server 2008 R2 "), cntMax); }
break;
case 0:
if (osvi.wProductType == VER_NT_WORKSTATION)
{ _tcsncat(szVersion, _T("Windows Vista "), cntMax); }
{
_tcsncat(szVersion, _T("Windows Vista "), cntMax);
}
else
{ _tcsncat(szVersion, _T("Windows Server 2008 "), cntMax); }
break;
@ -234,7 +256,9 @@ void WheatyExceptionReport::PrintSystemInfo()
SystemInfo.dwNumberOfProcessors, MemoryStatus.dwTotalPhys / 0x400, MemoryStatus.dwAvailPhys / 0x400, MemoryStatus.dwTotalPageFile / 0x400);
if (_GetWindowsVersion(sString, countof(sString)))
{ _tprintf(_T("\r\n*** Operation System ***\r\n%s\r\n"), sString); }
{
_tprintf(_T("\r\n*** Operation System ***\r\n%s\r\n"), sString);
}
else
{ _tprintf(_T("\r\n*** Operation System:\r\n<unknown>\r\n")); }
}
@ -250,7 +274,9 @@ void WheatyExceptionReport::printTracesForAllThreads()
// Take a snapshot of all running threads
hThreadSnap = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
if (hThreadSnap == INVALID_HANDLE_VALUE)
{ return; }
{
return;
}
// Fill in the size of the structure before using it.
te32.dwSize = sizeof(THREADENTRY32);
@ -455,12 +481,16 @@ BOOL WheatyExceptionReport::GetLogicalAddress(
MEMORY_BASIC_INFORMATION mbi;
if (!VirtualQuery(addr, &mbi, sizeof(mbi)))
{ return FALSE; }
{
return FALSE;
}
DWORD_PTR hMod = (DWORD_PTR)mbi.AllocationBase;
if (!GetModuleFileName((HMODULE)hMod, szModule, len))
{ return FALSE; }
{
return FALSE;
}
// Point to the DOS header in memory
PIMAGE_DOS_HEADER pDosHdr = (PIMAGE_DOS_HEADER)hMod;
@ -667,13 +697,17 @@ bool WheatyExceptionReport::FormatSymbolValue(
// Indicate if the variable is a local or parameter
if (pSym->Flags & IMAGEHLP_SYMBOL_INFO_PARAMETER)
{ pszCurrBuffer += sprintf(pszCurrBuffer, "Parameter "); }
{
pszCurrBuffer += sprintf(pszCurrBuffer, "Parameter ");
}
else if (pSym->Flags & IMAGEHLP_SYMBOL_INFO_LOCAL)
{ pszCurrBuffer += sprintf(pszCurrBuffer, "Local "); }
// If it's a function, don't do anything.
if (pSym->Tag == 5) // SymTagFunction from CVCONST.H from the DIA SDK
{ return false; }
{
return false;
}
DWORD_PTR pVariable = 0; // Will point to the variable's data in memory
@ -753,7 +787,9 @@ char* WheatyExceptionReport::DumpTypeIndex(
&dwChildrenCount);
if (!dwChildrenCount) // If no children, we're done
{ return pszCurrBuffer; }
{
return pszCurrBuffer;
}
// Prepare to get an array of "TypeIds", representing each of the children.
// SymGetTypeInfo(TI_FINDCHILDREN) expects more memory than just a
@ -839,7 +875,9 @@ char* WheatyExceptionReport::FormatOutputValue(char* pszCurrBuffer,
{
// Format appropriately (assuming it's a 1, 2, or 4 bytes (!!!)
if (length == 1)
{ pszCurrBuffer += sprintf(pszCurrBuffer, " = %X", *(PBYTE)pAddress); }
{
pszCurrBuffer += sprintf(pszCurrBuffer, " = %X", *(PBYTE)pAddress);
}
else if (length == 2)
{ pszCurrBuffer += sprintf(pszCurrBuffer, " = %X", *(PWORD)pAddress); }
else if (length == 4)