diff --git a/CMakeLists.txt b/CMakeLists.txt index b837fbd0..b77091e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,7 @@ elseif(UNIX) 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-unused-but-set-variable -Wno-write-strings -Wno-unknown-pragmas -Wno-uninitialized -Wno-reorder -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-format -Wno-unused-but-set-variable -Wno-write-strings -Wno-unknown-pragmas -Wno-uninitialized -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/application/ChatServer/src/shared/ConnectionServerConnection.cpp b/engine/server/application/ChatServer/src/shared/ConnectionServerConnection.cpp index 6dbad80b..2ce8ddbd 100644 --- a/engine/server/application/ChatServer/src/shared/ConnectionServerConnection.cpp +++ b/engine/server/application/ChatServer/src/shared/ConnectionServerConnection.cpp @@ -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()); } diff --git a/engine/server/library/serverGame/src/shared/core/GameServer.cpp b/engine/server/library/serverGame/src/shared/core/GameServer.cpp index 75a6ea36..d7bf0c21 100644 --- a/engine/server/library/serverGame/src/shared/core/GameServer.cpp +++ b/engine/server/library/serverGame/src/shared/core/GameServer.cpp @@ -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); diff --git a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp index 68393fc1..0fe535e5 100644 --- a/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/CreatureObject.cpp @@ -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 Payload; - MessageQueueGenericValueType * const msg = new MessageQueueGenericValueType(results); creatureController->appendMessage(static_cast(CM_characterMatchRetrieved), 0.0f, msg, GameControllerMessageFlags::SEND | GameControllerMessageFlags::RELIABLE | GameControllerMessageFlags::DEST_AUTH_CLIENT); diff --git a/engine/server/library/serverGame/src/shared/object/ServerObject.cpp b/engine/server/library/serverGame/src/shared/object/ServerObject.cpp index c830ff31..0ffc1842 100644 --- a/engine/server/library/serverGame/src/shared/object/ServerObject.cpp +++ b/engine/server/library/serverGame/src/shared/object/ServerObject.cpp @@ -4156,11 +4156,13 @@ void ServerObject::performCombatSpam (const MessageQueueCombatSpam & spamMsg, bo if (sendToTarget && !sendToBystanders) { ServerObject * const target = safe_cast(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) diff --git a/engine/server/library/serverUtility/src/CMakeLists.txt b/engine/server/library/serverUtility/src/CMakeLists.txt index 1b979319..b522f2c1 100644 --- a/engine/server/library/serverUtility/src/CMakeLists.txt +++ b/engine/server/library/serverUtility/src/CMakeLists.txt @@ -39,10 +39,6 @@ if(WIN32) set(PLATFORM_SOURCES win32/FirstServerUtility.cpp ) -else() - set(PLATFORM_SOURCES - linux/stlhack.cpp - ) endif() include_directories( diff --git a/engine/server/library/serverUtility/src/linux/stlhack.cpp b/engine/server/library/serverUtility/src/linux/stlhack.cpp deleted file mode 100644 index 5b63831a..00000000 --- a/engine/server/library/serverUtility/src/linux/stlhack.cpp +++ /dev/null @@ -1,23 +0,0 @@ -//#include "FirstGame.h" -//#include //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 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::_M_list[__stl_num_primes] = __PRIME_LIST_BODY; -// -//#undef __stl_num_primes -//#undef __PRIME_LIST_BODY -// \ No newline at end of file diff --git a/engine/shared/application/TemplateDefinitionCompiler/src/shared/core/TemplateDefinitionCompiler.cpp b/engine/shared/application/TemplateDefinitionCompiler/src/shared/core/TemplateDefinitionCompiler.cpp index 61e85ce8..f95e5c6c 100644 --- a/engine/shared/application/TemplateDefinitionCompiler/src/shared/core/TemplateDefinitionCompiler.cpp +++ b/engine/shared/application/TemplateDefinitionCompiler/src/shared/core/TemplateDefinitionCompiler.cpp @@ -27,84 +27,6 @@ #include -#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 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 diff --git a/engine/shared/library/sharedNetwork/src/shared/UdpLibraryMT/UdpConnectionMT.cpp b/engine/shared/library/sharedNetwork/src/shared/UdpLibraryMT/UdpConnectionMT.cpp index ce7159f2..9b7b7282 100644 --- a/engine/shared/library/sharedNetwork/src/shared/UdpLibraryMT/UdpConnectionMT.cpp +++ b/engine/shared/library/sharedNetwork/src/shared/UdpLibraryMT/UdpConnectionMT.cpp @@ -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) diff --git a/external/3rd/library/platform/projects/Session/CommonAPI/CommonAPIStrings.h b/external/3rd/library/platform/projects/Session/CommonAPI/CommonAPIStrings.h index 5ddbe62e..df836c96 100644 --- a/external/3rd/library/platform/projects/Session/CommonAPI/CommonAPIStrings.h +++ b/external/3rd/library/platform/projects/Session/CommonAPI/CommonAPIStrings.h @@ -247,6 +247,6 @@ const gamecode_text _gamecodeName[GAMECODE_END] = }; static std::map GamecodeName((const std::map::value_type *)&_gamecodeName[0],(const std::map::value_type *)&_gamecodeName[GAMECODE_END]); -#endif UNIX +#endif #endif