Merge branch 'master' into 'master'

merge a ton of fixes



See merge request !7
This commit is contained in:
DarthArgus
2015-10-14 02:32:42 -04:00
48 changed files with 151 additions and 353 deletions
+3 -3
View File
@@ -47,9 +47,9 @@ if(WIN32)
elseif(UNIX)
find_package(Curses REQUIRED)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DDEBUG_LEVEL=2 -DPRODUCTION=0 -g -pipe -Wall -Wno-unknown-pragmas -Wno-reorder -O0")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDEBUG_LEVEL=0 -DPRODUCTION=1 -march=native -pipe -mtune=native -O2 ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DDEBUG_LEVEL=2 -DPRODUCTION=0 -g -pipe -O0 -Wall -Wno-overloaded-virtual -Wno-missing-braces -Wno-unused-private-field -Wno-format -Wno-unused-but-set-variable -Wno-write-strings -Wno-unknown-pragmas -Wno-uninitialized -Wno-reorder -Wno-unused-const-variable -Wno-unknown-warning-option")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DDEBUG_LEVEL=0 -DPRODUCTION=1 -march=native -pipe -mtune=native -O2 -Wno-overloaded-virtual -Wno-missing-braces -Wno-unused-private-field -Wno-format -Wno-unused-but-set-variable -Wno-write-strings -Wno-unknown-pragmas -Wno-uninitialized -Wno-reorder -Wno-unused-const-variable -Wno-unknown-warning-option")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0")
add_definitions(-DLINUX -D_REENTRANT -Dlinux -D_USING_STL -D__STL_NO_BAD_ALLOC -D_GNU_SOURCE -D_XOPEN_SOURCE=500)
endif()
@@ -421,7 +421,7 @@ void ConnectionServerConnection::onReceive(const Archive::ByteStream & message)
NetworkId targetId = message.getKickeeId();
std::string const & targetName = message.getKickeeName();
if(targetId.isValid() ||
!targetName.empty() && (ChatServer::getVoiceChatLoginInfoFromName(targetName, targetId)))
(!targetName.empty() && (ChatServer::getVoiceChatLoginInfoFromName(targetName, targetId))))
{
ChatServer::requestKickPlayerFromChannel(message.getRequester(), targetId, message.getChannelName());
}
@@ -193,7 +193,6 @@ DatabaseProcess::~DatabaseProcess()
void DatabaseProcess::run(void)
{
static bool shouldSleep = ConfigServerDatabase::getShouldSleep();
unsigned long startTime;
bool idle=false;
int loopcount=0;
float nextMemoryReportTime=0;
@@ -205,8 +204,6 @@ void DatabaseProcess::run(void)
{
PROFILER_AUTO_BLOCK_DEFINE("main loop");
startTime = Clock::timeMs();
if (!Os::update())
setDone("OS condition (Parent pid change)");
@@ -3923,8 +3923,8 @@ void GameServer::run(void)
NetworkHandler::update();
}
if ( ServerWorld::isSpaceScene() && ConfigServerGame::getSpaceShouldSleep()
|| !ServerWorld::isSpaceScene() && ConfigServerGame::getGroundShouldSleep())
if ((ServerWorld::isSpaceScene() && ConfigServerGame::getSpaceShouldSleep())
|| (!ServerWorld::isSpaceScene() && ConfigServerGame::getGroundShouldSleep()))
{
PROFILER_AUTO_BLOCK_DEFINE("Os::sleep");
Os::sleep(1);
@@ -1814,8 +1814,6 @@ void CreatureObject::initializeFirstTimeObject()
void CreatureObject::onLoadedFromDatabase()
{
typedef const std::string * strptr;
if (isAuthoritative())
{
if (isPlayerControlled())
@@ -8545,8 +8543,6 @@ void CreatureObject::onCharacterMatchRetrieved(MatchMakingCharacterResult const
if (creatureController != NULL)
{
typedef std::pair<NetworkId, Unicode::String> Payload;
MessageQueueGenericValueType<MatchMakingCharacterResult> * const msg = new MessageQueueGenericValueType<MatchMakingCharacterResult>(results);
creatureController->appendMessage(static_cast<int>(CM_characterMatchRetrieved), 0.0f, msg, GameControllerMessageFlags::SEND | GameControllerMessageFlags::RELIABLE | GameControllerMessageFlags::DEST_AUTH_CLIENT);
@@ -4156,11 +4156,13 @@ void ServerObject::performCombatSpam (const MessageQueueCombatSpam & spamMsg, bo
if (sendToTarget && !sendToBystanders)
{
ServerObject * const target = safe_cast<ServerObject *>(NetworkIdManager::getObjectById(spamMsg.m_defender));
if (target)
if (target->getNetworkId() != spamMsg.m_attacker)
if (target) {
if (target->getNetworkId() != spamMsg.m_attacker) {
target->seeCombatSpam (spamMsg);
else
}
} else {
WARNING_STRICT_FATAL (!sendToSelf && !sendToBystanders, ("null target_obj in commandFuncCombatSpam, when sendToTarget was set true"));
}
}
if (sendToBystanders)
@@ -1232,7 +1232,7 @@ void JavaLibrary::initializeJavaThread()
}
#ifdef JNI_VERSION_1_4
if (!ms_javaVmType == JV_ibm)
if ((!ms_javaVmType) == JV_ibm)
{
tempOption.optionString = "-Xrs";
options.push_back(tempOption);
@@ -1243,14 +1243,6 @@ void JavaLibrary::initializeJavaThread()
{
tempOption.optionString = "-Xloggc:javagc.log";
options.push_back(tempOption);
// tempOption.optionString = "-Xrunpri";
// options.push_back(tempOption);
// tempOption.optionString = "-Xbootclasspath/a:/home/sjakab/temp/OptimizeitSuiteDemo/lib/oibcp.jar";
// options.push_back(tempOption);
// tempOption.optionString = "-Xboundthreads";
// options.push_back(tempOption);
// tempOption.optionString = "-Xrunhprof:heap=format=b";
// options.push_back(tempOption);
}
#endif
@@ -2699,58 +2699,6 @@ namespace
//-----------------------------------------------------------------------
bool DebugDumpCustomVar(JNIEnv *env, LocalRefPtr customVar)
{
NOT_NULL(env);
NOT_NULL(customVar.get());
NOT_NULL(customVar->getValue());
//-- get class for custom_var
const jclass customVarClass = env->FindClass("custom_var");
DEBUG_REPORT_LOG(!customVarClass, ("FindClass() failed for custom_var.\n"));
if (!customVarClass)
return false;
//-- invoke "String getVarName()" method
const jmethodID getVarNameMid = env->GetMethodID(customVarClass, "getVarName", "()Ljava/lang/String;");
DEBUG_REPORT_LOG(!getVarNameMid , ("GetMethodId() failed for getVarName().\n"));
if (!getVarNameMid)
{
env->DeleteLocalRef(customVarClass);
return false;
}
std::string nativeCustomVarName;
JavaStringPtr javaCustomVarName = callStringMethod(*customVar, getVarNameMid);
JavaLibrary::convert(*javaCustomVarName, nativeCustomVarName);
//-- invoke "int getTypeId()" method
const jmethodID getTypeIdMid = env->GetMethodID(customVarClass, "getTypeId", "()I");
DEBUG_REPORT_LOG(!getTypeIdMid, ("GetMethodId() failed for getTypeId().\n"));
if (!getTypeIdMid)
{
env->DeleteLocalRef(customVarClass);
return false;
}
const int nativeCustomVarTypeId = callIntMethod(*customVar, getTypeIdMid);
//-- cleanup
env->DeleteLocalRef(customVarClass);
//-- print results
REPORT_LOG(true, ("<*> <CustomVar varName=[%s] typeId=[%d]\n", nativeCustomVarName.c_str(), nativeCustomVarTypeId));
//-- success
return true;
}
// ----------------------------------------------------------------------
void CustomizationVariableCollector(const std::string &fullVariablePathName, CustomizationVariable *customizationVariable, void *context)
{
//-- validate arguments
@@ -2770,51 +2718,6 @@ namespace
// ----------------------------------------------------------------------
void BasicRangedIntCustomizationVariableCollector(const std::string &fullVariablePathName, CustomizationVariable *customizationVariable, void *context)
{
//-- validate arguments
if (!customizationVariable || !context)
{
DEBUG_FATAL(true, ("programmer error: callback made with NULL arguments.\n"));
return;
}
//-- check if this is a basic ranged int
BasicRangedIntCustomizationVariable *const variable = dynamic_cast<BasicRangedIntCustomizationVariable*>(customizationVariable);
if (!variable)
return;
//-- convert context to customization variable collection
CustomizationVariableIteratorData *const iteratorData = reinterpret_cast<CustomizationVariableIteratorData*>(context);
//-- add CustomizationVariable to the container
iteratorData->m_variableNames.push_back(fullVariablePathName);
iteratorData->m_customizationVariables.push_back(customizationVariable);
}
// ----------------------------------------------------------------------
void PalcolorCustomizationVariableCollector(const std::string &fullVariablePathName, CustomizationVariable *customizationVariable, void *context)
{
//-- validate arguments
if (!customizationVariable || !context)
{
DEBUG_FATAL(true, ("programmer error: callback made with NULL arguments.\n"));
return;
}
//-- check if this is a PaletteColorCustomizationVariable
PaletteColorCustomizationVariable *const variable = dynamic_cast<PaletteColorCustomizationVariable*>(customizationVariable);
if (!variable)
return;
//-- convert context to customization variable collection
CustomizationVariableIteratorData *const iteratorData = reinterpret_cast<CustomizationVariableIteratorData*>(context);
//-- add CustomizationVariable to the container
iteratorData->m_variableNames.push_back(fullVariablePathName);
iteratorData->m_customizationVariables.push_back(customizationVariable);
}
}
// ----------------------------------------------------------------------
@@ -39,10 +39,6 @@ if(WIN32)
set(PLATFORM_SOURCES
win32/FirstServerUtility.cpp
)
else()
set(PLATFORM_SOURCES
linux/stlhack.cpp
)
endif()
include_directories(
@@ -1,23 +0,0 @@
//#include "FirstGame.h"
//#include <hash_map> //without this we get an internal compiler error
// This resolves a problem with stlport compiling under gcc 2.91 that ships with RedHat 6.2.
// Basically, the compiler has trouble instantiating an instance of _Stl_prime<bool> without it
// being explicitly defined. So we have to instantiate one.
// We should try removing this file when either we a) upgrade the compiler or b) upgrate the OS.
//#define __stl_num_primes 28
//#define __PRIME_LIST_BODY { \
// 53ul, 97ul, 193ul, 389ul, 769ul, \
// 1543ul, 3079ul, 6151ul, 12289ul, 24593ul, \
// 49157ul, 98317ul, 196613ul, 393241ul, 786433ul, \
// 1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul, \
// 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,\
// 1610612741ul, 3221225473ul, 4294967291ul \
//}
//
//template <> const size_t std::_Stl_prime<bool>::_M_list[__stl_num_primes] = __PRIME_LIST_BODY;
//
//#undef __stl_num_primes
//#undef __PRIME_LIST_BODY
//
@@ -27,84 +27,6 @@
#include <ctime>
#ifdef _DEBUG
//#define ALWAYS_OVERWRITE // flag to always overwrite previous code
#endif
//==============================================================================
// subclass Perforce API class ClientUser in order to trap errors
//static const int SUBMIT_NO_FILE_ERR = 17; // need to add file before submitting
//
//class MyPerforceUser : public ClientUser
//{
//public:
// MyPerforceUser(void) : ClientUser(), m_errorOccurred(false) {}
// virtual ~MyPerforceUser() {}
// virtual void HandleError( Error *err )
// {
// if (err != NULL && err->Test())
// {
// m_errorOccurred = true;
// m_lastError = err->GetGeneric();
// // test for filtered errors
// for (size_t i = 0; i < m_filteredErrors.size(); ++i)
// {
// if (m_lastError == m_filteredErrors[i])
// return;
// }
// }
// ClientUser::HandleError(err);
// }
//
// bool errorOccurred(void) const
// {
// return m_errorOccurred;
// }
//
// int getLastError(void) const
// {
// return m_lastError;
// }
//
// void clearLastError(void)
// {
// m_errorOccurred = false;
// m_lastError = 0;
// }
//
// void addFilteredError(int error)
// {
// m_filteredErrors.push_back(error);
// }
//
// void clearFilteredErrors(void)
// {
// m_filteredErrors.clear();
// }
//
//private:
// bool m_errorOccurred;
// int m_lastError;
// std::vector<int> m_filteredErrors;
//};
//
//
////==============================================================================
//// subclass of the PerforceAPI StrBuf class, to workaround a bug
//// in the destructor. We can't fix the bug because it's an external library
//class StrBufFixed : public StrBuf
//{
//public:
// ~StrBufFixed()
// {
// delete buffer;
// StringInit();
// }
//};
//==============================================================================
// file variables
@@ -404,8 +404,9 @@ static bool dwarfSearch(char const *dwarfLines, unsigned int linesLength, void c
char const *srcFile = bestUnderSrcFileTable+1;
for (int i = 0; i < bestUnderSrcFileNum; ++i)
{
while (*srcFile++);
while (*srcFile++) {
srcFile += 3;
}
}
retSrcFile = SymbolCache::uniqueString(srcFile);
retSrcLine = bestUnderSrcLine;
@@ -461,7 +461,7 @@ void PixCounter::String::set(const char * format, ...)
char buffer[512];
vsnprintf(buffer, sizeof(buffer), format, va);
buffer[sizeof(buffer-1)] = '\0';
buffer[sizeof(buffer)-1] = '\0';
operator =(buffer);
va_end(va);
@@ -674,7 +674,7 @@ void RemoteDebug::send(MESSAGE_TYPE type, const char* theName)
if (explicitMessageLength != 0)
messageLength = explicitMessageLength;
else if (ms_varArgs_buffer)
else if (strlen(ms_varArgs_buffer) > 0)
{
//only grab buffer sizes if needed
messageLength = strlen(ms_varArgs_buffer)+1;
@@ -688,7 +688,7 @@ void RemoteDebug::send(MESSAGE_TYPE type, const char* theName)
uint32 packetLength = static_cast<uint32>(messageTypeLength + channelNumberLength + messageLengthLength + static_cast<int>(messageLength));
if (ms_varArgs_buffer)
if (strlen(ms_varArgs_buffer) > 0)
{
//copy data into the packet
memcpy(ms_buffer, &messageType, static_cast<uint32>(messageTypeLength));
@@ -296,7 +296,7 @@ void FileManifest::addStoredManifestEntry(const char *fileName, const char * sce
entry->size = fileSize;
entry->accesses = 0;
std::pair<ManifestMap::iterator, bool> insertReturn = s_manifest.insert(std::pair<const uint32, FileManifestEntry*>(crc, entry));
s_manifest.insert(std::pair<const uint32, FileManifestEntry*>(crc, entry));
delete entry;
}
@@ -18,6 +18,7 @@ class UdpConnectionHandlerInternal: public UdpConnectionHandler
{
public:
UdpConnectionHandlerInternal();
virtual ~UdpConnectionHandlerInternal();
void setOwner(UdpConnectionHandlerMT *owner);
void processReceive(UdpConnectionMT *conMT, unsigned char const *data, int dataLen);
@@ -43,6 +44,8 @@ UdpConnectionHandlerInternal::UdpConnectionHandlerInternal() :
{
}
UdpConnectionHandlerInternal::~UdpConnectionHandlerInternal(){}
// ----------------------------------------------------------------------
void UdpConnectionHandlerInternal::setOwner(UdpConnectionHandlerMT *owner)
@@ -247,6 +247,6 @@ const gamecode_text _gamecodeName[GAMECODE_END] =
};
static std::map<apiGamecode,const char *> GamecodeName((const std::map<apiGamecode,const char *>::value_type *)&_gamecodeName[0],(const std::map<apiGamecode,const char *>::value_type *)&_gamecodeName[GAMECODE_END]);
#endif UNIX
#endif
#endif
+4 -4
View File
@@ -59,7 +59,7 @@ namespace Base
int k = l = 0;
for(; l < i; l += 4)
{
ai[k] = achar0[l + j] & 0xff | (achar0[l + 1 + j] & 0xff) << 8 | (achar0[l + 2 + j] & 0xff) << 16 | (achar0[l + 3 + j] & 0xff) << 24;
ai[k] = (achar0[l + j] & 0xff) | (achar0[l + 1 + j] & 0xff) << 8 | (achar0[l + 2 + j] & 0xff) << 16 | (achar0[l + 3 + j] & 0xff) << 24;
k++;
}
@@ -84,7 +84,7 @@ namespace Base
int MD5::FF(int i, int j, int k, int l, int i1, int j1, int k1)
{
i = uadd(i, j & k | ~j & l, i1, k1);
i = uadd(i, (j & k) | (~j & l), i1, k1);
return uadd(rotate_left(i, j1), j);
}
@@ -106,7 +106,7 @@ namespace Base
int MD5::GG(int i, int j, int k, int l, int i1, int j1, int k1)
{
i = uadd(i, j & l | k & ~l, i1, k1);
i = uadd(i, (j & l) | (k & ~l), i1, k1);
return uadd(rotate_left(i, j1), j);
}
@@ -128,7 +128,7 @@ namespace Base
{
padding.resize(64,0);
padding[0] = -128;
}
}
finalsNull = true;
}
@@ -125,7 +125,7 @@ CSAssistGameAPIResult CSAssistGameAPITicket::setLocation(const CSAssistUnicodeCh
}
//-----------------------------------------------------------
CSAssistGameAPIResult CSAssistGameAPITicket::setCategory(unsigned index, unsigned value)
CSAssistGameAPIResult CSAssistGameAPITicket::setCategory(int index, unsigned value)
//-----------------------------------------------------------
{
if (index < 0 || index >= (short)CSASSIST_NUM_CATEGORIES)
@@ -33,7 +33,7 @@ public:
CSAssistGameAPIResult setDetails(const CSAssistUnicodeChar *string);
CSAssistGameAPIResult setLanguage(const CSAssistUnicodeChar *string);
CSAssistGameAPIResult setLocation(const CSAssistUnicodeChar *string);
CSAssistGameAPIResult setCategory(unsigned index, unsigned value);
CSAssistGameAPIResult setCategory(int index, unsigned value);
CSAssistGameAPITicketID ticketID; // unique ID
CSAssistGameAPIUID uid; // station UID
@@ -59,7 +59,7 @@ namespace Base
int k = l = 0;
for(; l < i; l += 4)
{
ai[k] = achar0[l + j] & 0xff | (achar0[l + 1 + j] & 0xff) << 8 | (achar0[l + 2 + j] & 0xff) << 16 | (achar0[l + 3 + j] & 0xff) << 24;
ai[k] = (achar0[l + j] & 0xff) | (achar0[l + 1 + j] & 0xff) << 8 | (achar0[l + 2 + j] & 0xff) << 16 | (achar0[l + 3 + j] & 0xff) << 24;
k++;
}
@@ -84,7 +84,7 @@ namespace Base
int MD5::FF(int i, int j, int k, int l, int i1, int j1, int k1)
{
i = uadd(i, j & k | ~j & l, i1, k1);
i = uadd(i, (j & k) | (~j & l), i1, k1);
return uadd(rotate_left(i, j1), j);
}
@@ -106,7 +106,7 @@ namespace Base
int MD5::GG(int i, int j, int k, int l, int i1, int j1, int k1)
{
i = uadd(i, j & l | k & ~l, i1, k1);
i = uadd(i, (j & l) | (k & ~l), i1, k1);
return uadd(rotate_left(i, j1), j);
}
@@ -46,8 +46,6 @@ ClockStamp Clock::getCurTime()
return ret;
#else
struct timeval tv;
int err;
err = gettimeofday(&tv, NULL);
return (static_cast<ClockStamp>(tv.tv_sec) * 1000 + static_cast<ClockStamp>(tv.tv_usec / 1000));
#endif
}
@@ -18,9 +18,12 @@ class CTServiceCharacter
target[0] = 0;
return;
}
int offset = 0;
while (offset < length && (target[offset++] = source[offset]));
target[length-1] = 0;
while (offset < length && (target[(offset+1)] = source[offset])) {
target[length-1] = 0;
offset++;
}
}
public:
enum { CHARACTER_SIZE=64, CHARACTER_BUFFER, REASON_SIZE=4096, REASON_BUFFER };
@@ -19,10 +19,14 @@ class CTServiceCustomer
target[0] = 0;
return;
}
int offset = 0;
while (offset < length && (target[offset++] = source[offset]));
target[length-1] = 0;
while (offset < length && (target[(offset+1)] = source[offset])){
target[length-1] = 0;
offset++;
}
}
public:
enum { SHORT_NAME_SIZE=64, SHORT_NAME_BUFFER,
PHONE_SIZE=32, PHONE_BUFFER,
@@ -22,9 +22,12 @@ class CTServiceDBOrder
target[0] = 0;
return;
}
int offset = 0;
while (offset < length && (target[offset++] = source[offset]));
target[length-1] = 0;
while (offset < length && (target[(offset+1)] = source[offset])){
target[length-1] = 0;
offset++;
}
}
public:
@@ -21,9 +21,12 @@ class CTServiceTransaction
target[0] = 0;
return;
}
int offset = 0;
while (offset < length && (target[offset++] = source[offset]));
target[length-1] = 0;
while (offset < length && (target[(offset+1)] = source[offset])){
target[length-1] = 0;
offset++;
}
}
public:
@@ -17,9 +17,12 @@ class CTServiceServer
target[0] = 0;
return;
}
int offset = 0;
while (offset < length && (target[offset++] = source[offset]));
target[length-1] = 0;
while (offset < length && (target[(offset+1)] = source[offset])) {
target[length-1] = 0;
offset++;
}
}
public:
enum { SERVER_SIZE=64, SERVER_BUFFER, REASON_SIZE=4096, REASON_BUFFER };
@@ -21,9 +21,12 @@ class CTServiceWebAPITransaction
target[0] = 0;
return;
}
int offset = 0;
while (offset < length && (target[offset++] = source[offset]));
target[length-1] = 0;
while (offset < length && (target[(offset+1)] = source[offset])) {
target[length-1] = 0;
offset++;
}
}
typedef unsigned short uchar_t;
@@ -45,10 +45,11 @@ ClockStamp Clock::getCurTime()
return ret;
#else
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wuninitialized"
struct timeval tv;
int err;
err = gettimeofday(&tv, NULL);
return (static_cast<ClockStamp>(tv.tv_sec) * 1000 + static_cast<ClockStamp>(tv.tv_usec / 1000));
#pragma clang diagnostic pop
#endif
}
@@ -28,7 +28,7 @@ ResLoginAvatar::ResLoginAvatar(void *user, int avatarLoginPriority)
void ResLoginAvatar::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
Plat_Unicode::String email;
unsigned inboxLimit = 0;
@@ -69,7 +69,7 @@ ResTemporaryAvatar::ResTemporaryAvatar(void *user)
void ResTemporaryAvatar::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -88,7 +88,7 @@ ResLogoutAvatar::ResLogoutAvatar(void *user, unsigned avatarID)
void ResLogoutAvatar::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -102,7 +102,7 @@ ResDestroyAvatar::ResDestroyAvatar(void *user, unsigned avatarID)
void ResDestroyAvatar::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -116,7 +116,7 @@ ResGetAvatar::ResGetAvatar(void *user)
void ResGetAvatar::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -150,7 +150,7 @@ ResGetAnyAvatar::ResGetAnyAvatar(void* user)
void ResGetAnyAvatar::unpack(Base::ByteStream::ReadIterator& iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -194,7 +194,7 @@ ResAvatarList::~ResAvatarList()
void ResAvatarList::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -220,7 +220,7 @@ ResSetAvatarAttributes::ResSetAvatarAttributes(void *user)
void ResSetAvatarAttributes::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -254,7 +254,7 @@ m_avatar(NULL)
void ResSetAvatarStatusMessage::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -291,7 +291,7 @@ ResSetAvatarForwardingEmail::ResSetAvatarForwardingEmail(void *user)
void ResSetAvatarForwardingEmail::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -318,7 +318,7 @@ ResSetAvatarInboxLimit::ResSetAvatarInboxLimit(void *user)
void ResSetAvatarInboxLimit::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -346,7 +346,7 @@ ResSearchAvatarKeywords::ResSearchAvatarKeywords(void *user)
void ResSearchAvatarKeywords::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -379,7 +379,7 @@ ResSetAvatarKeywords::ResSetAvatarKeywords(void *user, unsigned avatarID)
void ResSetAvatarKeywords::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -401,7 +401,7 @@ ResGetAvatarKeywords::~ResGetAvatarKeywords()
void ResGetAvatarKeywords::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -427,7 +427,7 @@ ResGetRoom::ResGetRoom(void *user)
void ResGetRoom::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -455,7 +455,7 @@ ResCreateRoom::ResCreateRoom(void *user, unsigned avatarID)
void ResCreateRoom::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -481,7 +481,7 @@ ResDestroyRoom::ResDestroyRoom(void *user, unsigned avatarID)
void ResDestroyRoom::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -498,7 +498,7 @@ ResSendInstantMessage::ResSendInstantMessage(void *user, unsigned avatarID, cons
void ResSendInstantMessage::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -513,7 +513,7 @@ ResSendRoomMessage::ResSendRoomMessage(void *user, unsigned avatarID)
void ResSendRoomMessage::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -529,7 +529,7 @@ ResSendBroadcastMessage::ResSendBroadcastMessage(void *user, unsigned avatarID,
void ResSendBroadcastMessage::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -543,7 +543,7 @@ ResFilterMessage::ResFilterMessage(void *user, unsigned version)
void ResFilterMessage::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -561,7 +561,7 @@ ResAddFriend::ResAddFriend(void *user, unsigned avatarID, const ChatUnicodeStrin
void ResAddFriend::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -578,7 +578,7 @@ m_comment(comment.string_data, comment.string_length)
void ResAddFriendReciprocate::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -596,7 +596,7 @@ ResSetFriendComment::ResSetFriendComment(void *user, unsigned avatarID, const Ch
void ResSetFriendComment::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -612,7 +612,7 @@ ResRemoveFriend::ResRemoveFriend(void *user, unsigned avatarID, const ChatUnicod
void ResRemoveFriend::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -627,7 +627,7 @@ m_address(address.string_data, address.string_length)
void ResRemoveFriendReciprocate::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -650,7 +650,7 @@ ResFriendStatus::~ResFriendStatus()
void ResFriendStatus::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -678,7 +678,7 @@ ResAddIgnore::ResAddIgnore(void *user, unsigned avatarID, const ChatUnicodeStrin
void ResAddIgnore::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -694,7 +694,7 @@ ResRemoveIgnore::ResRemoveIgnore(void *user, unsigned avatarID, const ChatUnicod
void ResRemoveIgnore::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -717,7 +717,7 @@ ResIgnoreStatus::~ResIgnoreStatus()
void ResIgnoreStatus::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -747,7 +747,7 @@ ResEnterRoom::ResEnterRoom(void *user, unsigned avatarID, const ChatUnicodeStrin
void ResEnterRoom::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -778,7 +778,7 @@ ResAllowRoomEntry::ResAllowRoomEntry(void *user, unsigned srcAvatarID, const Cha
void ResAllowRoomEntry::unpack(Base::ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -794,7 +794,7 @@ ResLeaveRoom::ResLeaveRoom(void *user, unsigned avatarID, const ChatUnicodeStrin
void ResLeaveRoom::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -810,7 +810,7 @@ ResAddModerator::ResAddModerator(void *user, unsigned srcAvatarID)
void ResAddModerator::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -826,7 +826,7 @@ ResRemoveModerator::ResRemoveModerator(void *user, unsigned srcAvatarID)
void ResRemoveModerator::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -842,7 +842,7 @@ ResAddTemporaryModerator::ResAddTemporaryModerator(void *user, unsigned srcAvata
void ResAddTemporaryModerator::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -858,7 +858,7 @@ ResRemoveTemporaryModerator::ResRemoveTemporaryModerator(void *user, unsigned sr
void ResRemoveTemporaryModerator::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -874,7 +874,7 @@ ResAddBan::ResAddBan(void *user, unsigned srcAvatarID)
void ResAddBan::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -890,7 +890,7 @@ ResRemoveBan::ResRemoveBan(void *user, unsigned srcAvatarID)
void ResRemoveBan::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -906,7 +906,7 @@ ResAddInvite::ResAddInvite(void *user, unsigned srcAvatarID)
void ResAddInvite::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -922,7 +922,7 @@ ResRemoveInvite::ResRemoveInvite(void *user, unsigned srcAvatarID)
void ResRemoveInvite::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -938,7 +938,7 @@ ResGrantVoice::ResGrantVoice(void *user, unsigned srcAvatarID)
void ResGrantVoice::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -954,7 +954,7 @@ ResRevokeVoice::ResRevokeVoice(void *user, unsigned srcAvatarID)
void ResRevokeVoice::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -970,7 +970,7 @@ ResKickAvatar::ResKickAvatar(void *user, unsigned srcAvatarID)
void ResKickAvatar::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -986,7 +986,7 @@ ResSetRoomParams::ResSetRoomParams(void *user, unsigned srcAvatarID)
void ResSetRoomParams::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1002,7 +1002,7 @@ ResChangeRoomOwner::ResChangeRoomOwner(void *user, unsigned srcAvatarID)
void ResChangeRoomOwner::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1023,7 +1023,7 @@ ResGetRoomSummaries::~ResGetRoomSummaries()
void ResGetRoomSummaries::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1062,7 +1062,7 @@ ResSendPersistentMessage::ResSendPersistentMessage(void *user, unsigned srcAvata
void ResSendPersistentMessage::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1082,7 +1082,7 @@ ResSendMultiplePersistentMessages::ResSendMultiplePersistentMessages(void *user,
void ResSendMultiplePersistentMessages::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
unsigned resultIndex;
get(iter, m_type);
@@ -1122,7 +1122,7 @@ ResAlterPersistentMessage::~ResAlterPersistentMessage()
void ResAlterPersistentMessage::unpack(Base::ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1144,7 +1144,7 @@ ResGetPersistentMessage::~ResGetPersistentMessage()
}
void ResGetPersistentMessage::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1193,7 +1193,7 @@ PersistentMessage ** const ResGetMultiplePersistentMessages::getList() const
void ResGetMultiplePersistentMessages::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1230,7 +1230,7 @@ ResGetPersistentHeaders::~ResGetPersistentHeaders()
void ResGetPersistentHeaders::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1276,7 +1276,7 @@ ResGetPartialPersistentHeaders::~ResGetPartialPersistentHeaders()
void ResGetPartialPersistentHeaders::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1315,7 +1315,7 @@ ResCountPersistentMessages::ResCountPersistentMessages(void *user, const ChatUni
void ResCountPersistentMessages::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1331,7 +1331,7 @@ ResUpdatePersistentMessage::ResUpdatePersistentMessage(void *user, unsigned srcA
void ResUpdatePersistentMessage::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1358,7 +1358,7 @@ ResClassifyPersistentMessages::ResClassifyPersistentMessages(void *user, unsigne
void ResClassifyPersistentMessages::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1374,7 +1374,7 @@ ResDeleteAllPersistentMessages::ResDeleteAllPersistentMessages(void *user, const
void ResDeleteAllPersistentMessages::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1468,7 +1468,7 @@ ResGetFanClubHandle::ResGetFanClubHandle(unsigned stationID, unsigned fanClubCod
void ResGetFanClubHandle::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1494,7 +1494,7 @@ ResFindAvatarByUID::~ResFindAvatarByUID()
void ResFindAvatarByUID::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1518,7 +1518,7 @@ ResRegistrarGetChatServer::ResRegistrarGetChatServer()
void ResRegistrarGetChatServer::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -1622,7 +1622,7 @@ ResGetSnoopList::~ResGetSnoopList()
void ResGetSnoopList::unpack(ByteStream::ReadIterator &iter)
{
unsigned numRead = 0;
get(iter, m_type);
get(iter, m_track);
get(iter, m_result);
@@ -59,7 +59,7 @@ namespace Base
int k = l = 0;
for(; l < i; l += 4)
{
ai[k] = achar0[l + j] & 0xff | (achar0[l + 1 + j] & 0xff) << 8 | (achar0[l + 2 + j] & 0xff) << 16 | (achar0[l + 3 + j] & 0xff) << 24;
ai[k] = (achar0[l + j] & 0xff) | (achar0[l + 1 + j] & 0xff) << 8 | (achar0[l + 2 + j] & 0xff) << 16 | (achar0[l + 3 + j] & 0xff) << 24;
k++;
}
@@ -84,7 +84,7 @@ namespace Base
int MD5::FF(int i, int j, int k, int l, int i1, int j1, int k1)
{
i = uadd(i, j & k | ~j & l, i1, k1);
i = uadd(i, (j & k) | (~j & l), i1, k1);
return uadd(rotate_left(i, j1), j);
}
@@ -106,7 +106,7 @@ namespace Base
int MD5::GG(int i, int j, int k, int l, int i1, int j1, int k1)
{
i = uadd(i, j & l | k & ~l, i1, k1);
i = uadd(i, (j & l) | (k & ~l), i1, k1);
return uadd(rotate_left(i, j1), j);
}
@@ -73,7 +73,6 @@ char * CSpanUtil::getDescriptionFromCardNum(const char *cardNum)
char temp[8];
memcpy(temp, cardNum, 7);
temp[7] = 0;
int value7 = atoi(temp);
temp[6] = 0;
int value6 = atoi(temp);
temp[5] = 0;
@@ -614,7 +614,7 @@ inline int UpperHashString(const char *string)
int h = 0;
while (*string != 0)
{
h = ((31 * h) + (*string >= 'a' && *string <= 'z') ? (*string - 0x20) : *string) ^ (h >> 26);
h = ((31 * h) + ((*string >= 'a' && *string <= 'z') ? (*string - 0x20) : *string)) ^ (h >> 26);
string++;
}
return(h);
@@ -83,7 +83,7 @@ template<typename T, typename P> PriorityQueue<T, P>::PriorityQueue(int queueSiz
mQueueEnd = 0;
mQueueSize = queueSize;
mQueue = new QueueEntry[mQueueSize];
memset(mQueue, 0, sizeof(mQueue));
memset(mQueue, 0, mQueueSize);
}
template<typename T, typename P> PriorityQueue<T, P>::~PriorityQueue()
@@ -315,7 +315,7 @@ namespace soe
UUEncodeTripleToQuadPtr(source + z,quad,(z + 3 < sourceLen) ? 3 : (sourceLen - z));
destLen -= strlen(quad);
if (destLen > 0) {
dest += snprintf(dest, sizeof(dest), quad);
dest += snprintf(dest, sourceLen, quad);
} else {
noErrors = false;
}
@@ -355,7 +355,7 @@ namespace soe
{
UUEncodeTripleToQuadRef(source.begin() + z,quad,(z + 3 < sourceLen) ? 3 : (sourceLen - z));
if (destLen > 0) {
dest += snprintf(dest, sizeof(dest), quad);
dest += snprintf(dest, sourceLen, quad);
} else {
noErrors = false;
}
@@ -389,7 +389,7 @@ namespace soe
for (; sourceLen > 0; sourceLen--, source++)
{
if (destLen >= 2) {
destLen -= snprintf(dest, sizeof(dest), format, *source);
destLen -= snprintf(dest, sourceLen, format, *source);
} else {
noErrors = false;
}
@@ -54,7 +54,7 @@ namespace soe
int k = l = 0;
for(; l < i; l += 4)
{
ai[k] = achar0[l + j] & 0xff | (achar0[l + 1 + j] & 0xff) << 8 | (achar0[l + 2 + j] & 0xff) << 16 | (achar0[l + 3 + j] & 0xff) << 24;
ai[k] = (achar0[l + j] & 0xff) | (achar0[l + 1 + j] & 0xff) << 8 | (achar0[l + 2 + j] & 0xff) << 16 | (achar0[l + 3 + j] & 0xff) << 24;
k++;
}
@@ -79,7 +79,7 @@ namespace soe
int MD5::FF(int i, int j, int k, int l, int i1, int j1, int k1)
{
i = uadd(i, j & k | ~j & l, i1, k1);
i = uadd(i, (j & k) | (~j & l), i1, k1);
return uadd(rotate_left(i, j1), j);
}
@@ -101,7 +101,7 @@ namespace soe
int MD5::GG(int i, int j, int k, int l, int i1, int j1, int k1)
{
i = uadd(i, j & l | k & ~l, i1, k1);
i = uadd(i, (j & l) | (k & ~l), i1, k1);
return uadd(rotate_left(i, j1), j);
}
@@ -155,7 +155,7 @@ inline int UpperHashString(char *string)
int h = 0;
while (*string != 0)
{
h = ((31 * h) + (*string >= 'a' && *string <= 'z') ? (*string - 0x20) : *string) ^ (h >> 26);
h = ((31 * h) + ((((*string >= 'a' && *string <= 'z') ? (*string - 0x20) : *string)) ^ (h >> 26)));
string++;
}
return(h);
@@ -44,13 +44,7 @@ std::string soegethostname()
char res[NAME_SIZE];
memset(res, 0, NAME_SIZE);
std::string retVal;
int error = gethostname(res, NAME_SIZE-1);
int errdetail;
if(error !=0)
{
errdetail = errno;
}
retVal = res;
return retVal;
}
@@ -77,7 +77,7 @@ template<typename T, typename P> PriorityQueue<T, P>::PriorityQueue(int queueSiz
mQueueEnd = 0;
mQueueSize = queueSize;
mQueue = new QueueEntry[mQueueSize];
memset(mQueue, 0, sizeof(mQueue));
memset(mQueue, 0, mQueueSize);
}
template<typename T, typename P> PriorityQueue<T, P>::~PriorityQueue()
@@ -719,9 +719,10 @@ namespace soe
int ClassScribe<ClassType>::Print(char * stream, unsigned size, const ClassType & data, unsigned maxDepth) const
{
int bytesTotal = 0;
int bytes = 0;
#ifdef PRINTABLE_MESSAGES
int bytes = 0;
if (maxDepth == 0) {
bytes = snprintf(stream, size, "%s{mMembers(%u)}", ClassName(), mMemberScribes.size());
return bytes;
@@ -264,7 +264,7 @@ namespace soe
{
int wchar_length=0; //number of utf-8 characters
int code_size; //number of bytes each wchar
int cur_bytes_count = 0;
unsigned cur_bytes_count = 0;
unsigned char byte;
char *pout = output;
@@ -46,8 +46,6 @@ ClockStamp Clock::getCurTime()
return ret;
#else
struct timeval tv;
int err;
err = gettimeofday(&tv, NULL);
return (static_cast<ClockStamp>(tv.tv_sec) * 1000 + static_cast<ClockStamp>(tv.tv_usec / 1000));
#endif
}
+1 -1
View File
@@ -148,7 +148,7 @@ inline int UpperHashString(char *string)
int h = 0;
while (*string != 0)
{
h = ((31 * h) + (*string >= 'a' && *string <= 'z') ? (*string - 0x20) : *string) ^ (h >> 26);
h = ((31 * h) + (((*string >= 'a' && *string <= 'z') ? (*string - 0x20) : *string) ^ (h >> 26)));
string++;
}
return(h);
+1 -1
View File
@@ -77,7 +77,7 @@ template<typename T, typename P> PriorityQueue<T, P>::PriorityQueue(int queueSiz
mQueueEnd = 0;
mQueueSize = queueSize;
mQueue = new QueueEntry[mQueueSize];
memset(mQueue, 0, sizeof(mQueue));
memset(mQueue, 0, mQueueSize);
}
template<typename T, typename P> PriorityQueue<T, P>::~PriorityQueue()
@@ -50,8 +50,10 @@ void StreamCipher::ProcessString(byte *outString, const byte *inString, unsigned
void StreamCipher::ProcessString(byte *inoutString, unsigned int length)
{
while(length--)
*inoutString++ = ProcessByte(*inoutString); //TODO: order of operations issue here, per the warning
while(length--) {
(*inoutString)++;
*inoutString = ProcessByte(*inoutString);
}
}
bool HashModule::Verify(const byte *digestIn)
@@ -82,7 +82,7 @@ unsigned int FilterWithBufferedInput::BlockQueue::GetAll(byte *outString)
void FilterWithBufferedInput::BlockQueue::Put(const byte *inString, unsigned int length)
{
assert(m_size + length <= m_buffer.size);
byte *end = (m_size < m_buffer+m_buffer.size-m_begin) ? m_begin + m_size : m_begin + m_size - m_buffer.size;
byte *end = (m_size < (unsigned)(m_buffer+m_buffer.size-m_begin)) ? m_begin + m_size : m_begin + m_size - m_buffer.size;
unsigned int len = STDMIN(length, (unsigned int)(m_buffer+m_buffer.size-end));
memcpy(end, inString, len);
if (len < length)
@@ -42,8 +42,6 @@ public:
PriorityAudioVideo
};
public:
AbstractFile(PriorityType priority);
virtual ~AbstractFile();
@@ -148,6 +146,7 @@ class AbstractFileFactory
{
public:
virtual AbstractFile* createFile(const char *filename, const char *openType) = 0;
virtual ~AbstractFileFactory() {};
};
// ======================================================================
@@ -19,7 +19,6 @@ namespace Archive
template <> void AutoDeltaPackedMap<int, Unicode::String>::pack(ByteStream & target, const std::string & buffer)
{
char temp[200];
char valueBuffer[200];
Command c;
Archive::put(target, countCharacter(buffer,':'));
@@ -31,7 +30,6 @@ namespace Archive
if (*i==':')
{
temp[tempPos]='\0';
valueBuffer[0]='\0';
sscanf(temp,"%i",&c.key);
char const * const valueStart = strchr(temp,' ');
if (valueStart)