mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-28 22:15:49 -04:00
most of the serious unused vars are removed, so i'll silence those now... and maaaaaany other fixes
This commit is contained in:
+2
-2
@@ -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()
|
||||
|
||||
@@ -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)");
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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<ClockStamp>(tv.tv_sec) * 1000 + static_cast<ClockStamp>(tv.tv_usec / 1000));
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user