diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e578927..deb8cef4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DDEBUG_LEVEL=2 -DPRODUCTION=0 -g -pipe -Wall -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 "${CMAKE_CXX_FLAGS} -Wnounused-but-set-variable -Wno-write-strings -Wno-unknown-pragmas -Wnouninitialized -Wno-reorder -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() diff --git a/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp b/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp index f27df9a7..c247838b 100644 --- a/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp +++ b/engine/server/library/serverDatabase/src/shared/DatabaseProcess.cpp @@ -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)"); diff --git a/engine/server/library/serverScript/src/shared/JavaLibrary.cpp b/engine/server/library/serverScript/src/shared/JavaLibrary.cpp index f2c3ad70..2ae597df 100644 --- a/engine/server/library/serverScript/src/shared/JavaLibrary.cpp +++ b/engine/server/library/serverScript/src/shared/JavaLibrary.cpp @@ -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 diff --git a/engine/server/library/serverScript/src/shared/ScriptMethodsObjectInfo.cpp b/engine/server/library/serverScript/src/shared/ScriptMethodsObjectInfo.cpp index 9c4fb1da..8d03185d 100644 --- a/engine/server/library/serverScript/src/shared/ScriptMethodsObjectInfo.cpp +++ b/engine/server/library/serverScript/src/shared/ScriptMethodsObjectInfo.cpp @@ -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, ("<*> (customizationVariable); - if (!variable) - return; - - //-- convert context to customization variable collection - CustomizationVariableIteratorData *const iteratorData = reinterpret_cast(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(customizationVariable); - if (!variable) - return; - - //-- convert context to customization variable collection - CustomizationVariableIteratorData *const iteratorData = reinterpret_cast(context); - - //-- add CustomizationVariable to the container - iteratorData->m_variableNames.push_back(fullVariablePathName); - iteratorData->m_customizationVariables.push_back(customizationVariable); - } } // ---------------------------------------------------------------------- diff --git a/engine/shared/library/sharedFile/src/shared/FileManifest.cpp b/engine/shared/library/sharedFile/src/shared/FileManifest.cpp index b1a72a8a..a9633dc1 100644 --- a/engine/shared/library/sharedFile/src/shared/FileManifest.cpp +++ b/engine/shared/library/sharedFile/src/shared/FileManifest.cpp @@ -296,7 +296,7 @@ void FileManifest::addStoredManifestEntry(const char *fileName, const char * sce entry->size = fileSize; entry->accesses = 0; - std::pair insertReturn = s_manifest.insert(std::pair(crc, entry)); + s_manifest.insert(std::pair(crc, entry)); delete entry; } diff --git a/external/3rd/library/soePlatform/CSAssist/utils/TcpLibrary/Clock.cpp b/external/3rd/library/soePlatform/CSAssist/utils/TcpLibrary/Clock.cpp index 2f5f47b4..2b7265bc 100644 --- a/external/3rd/library/soePlatform/CSAssist/utils/TcpLibrary/Clock.cpp +++ b/external/3rd/library/soePlatform/CSAssist/utils/TcpLibrary/Clock.cpp @@ -46,8 +46,6 @@ ClockStamp Clock::getCurTime() return ret; #else struct timeval tv; - int err; - err = gettimeofday(&tv, NULL); return (static_cast(tv.tv_sec) * 1000 + static_cast(tv.tv_usec / 1000)); #endif } diff --git a/external/3rd/library/soePlatform/CTServiceGameAPI/TcpLibrary/Clock.cpp b/external/3rd/library/soePlatform/CTServiceGameAPI/TcpLibrary/Clock.cpp index 2b7265bc..9b317d05 100644 --- a/external/3rd/library/soePlatform/CTServiceGameAPI/TcpLibrary/Clock.cpp +++ b/external/3rd/library/soePlatform/CTServiceGameAPI/TcpLibrary/Clock.cpp @@ -45,8 +45,11 @@ ClockStamp Clock::getCurTime() return ret; #else +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wuninitialized" struct timeval tv; return (static_cast(tv.tv_sec) * 1000 + static_cast(tv.tv_usec / 1000)); +#pragma clang diagnostic pop #endif } diff --git a/external/3rd/library/soePlatform/ChatAPI/utils/Base/MD5.cpp b/external/3rd/library/soePlatform/ChatAPI/utils/Base/MD5.cpp index a988f46b..31d75dcb 100644 --- a/external/3rd/library/soePlatform/ChatAPI/utils/Base/MD5.cpp +++ b/external/3rd/library/soePlatform/ChatAPI/utils/Base/MD5.cpp @@ -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); } diff --git a/external/3rd/library/soePlatform/ChatAPI/utils/Base/ccspanutil.cpp b/external/3rd/library/soePlatform/ChatAPI/utils/Base/ccspanutil.cpp index 28781273..8d97c185 100644 --- a/external/3rd/library/soePlatform/ChatAPI/utils/Base/ccspanutil.cpp +++ b/external/3rd/library/soePlatform/ChatAPI/utils/Base/ccspanutil.cpp @@ -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; diff --git a/external/3rd/library/soePlatform/ChatAPI/utils/UdpLibrary/UdpPriority.h b/external/3rd/library/soePlatform/ChatAPI/utils/UdpLibrary/UdpPriority.h index 6b4f5968..c50dee62 100644 --- a/external/3rd/library/soePlatform/ChatAPI/utils/UdpLibrary/UdpPriority.h +++ b/external/3rd/library/soePlatform/ChatAPI/utils/UdpLibrary/UdpPriority.h @@ -83,7 +83,7 @@ template PriorityQueue::PriorityQueue(int queueSiz mQueueEnd = 0; mQueueSize = queueSize; mQueue = new QueueEntry[mQueueSize]; - memset(mQueue, 0, sizeof(mQueue)); + memset(mQueue, 0, mQueueSize); } template PriorityQueue::~PriorityQueue() diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/pid.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/pid.cpp index 6097fd7b..6a1d7b56 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/pid.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/pid.cpp @@ -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; } diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/priority.hpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/priority.hpp index 82751efa..19f34ab3 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/priority.hpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/priority.hpp @@ -77,7 +77,7 @@ template PriorityQueue::PriorityQueue(int queueSiz mQueueEnd = 0; mQueueSize = queueSize; mQueue = new QueueEntry[mQueueSize]; - memset(mQueue, 0, sizeof(mQueue)); + memset(mQueue, 0, mQueueSize); } template PriorityQueue::~PriorityQueue() diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/utf8.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/utf8.cpp index 9cc64b43..ce6b8f16 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/utf8.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/Base/utf8.cpp @@ -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; diff --git a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/TcpLibrary/Clock.cpp b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/TcpLibrary/Clock.cpp index 2f5f47b4..2b7265bc 100644 --- a/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/TcpLibrary/Clock.cpp +++ b/external/3rd/library/soePlatform/VChatAPI/utils2.0/utils/TcpLibrary/Clock.cpp @@ -46,8 +46,6 @@ ClockStamp Clock::getCurTime() return ret; #else struct timeval tv; - int err; - err = gettimeofday(&tv, NULL); return (static_cast(tv.tv_sec) * 1000 + static_cast(tv.tv_usec / 1000)); #endif }