From 93a03b5db0b3560ded33ac7c5aa995e940d926e7 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 6 Nov 2015 15:24:19 +0100 Subject: [PATCH] Fixed: clang warnings --HG-- branch : develop --- code/nel/include/nel/gui/group_html.h | 2 +- code/nel/src/logic/logic_state_machine.cpp | 2 +- code/nel/src/misc/displayer.cpp | 3 +++ code/nel/src/pacs/global_retriever.cpp | 2 +- code/ryzom/client/src/sky_object.cpp | 2 +- code/ryzom/common/src/game_share/utils.h | 9 ++++----- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index bafa63348..675d2c20e 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -366,7 +366,7 @@ namespace NLGUI bool _Connecting; double _TimeoutValue; // the timeout in seconds double _ConnectingTimeout; - uint32 _RedirectsRemaining; + sint _RedirectsRemaining; // minimal embeded lua script support // Note : any embeded script is executed immediately after the closing diff --git a/code/nel/src/logic/logic_state_machine.cpp b/code/nel/src/logic/logic_state_machine.cpp index 0edc7bd14..94a8c6587 100644 --- a/code/nel/src/logic/logic_state_machine.cpp +++ b/code/nel/src/logic/logic_state_machine.cpp @@ -49,7 +49,7 @@ void xmlCheckNodeName (xmlNodePtr &node, const char *nodeName) // Make an error message char tmp[512]; smprintf (tmp, 512, "LogicStateMachine STATE_MACHINE XML Syntax error in block line %d, node %s should be %s", - (int)node->line, node->name, nodeName); + node ? (int)node->line:-1, node->name, nodeName); nlinfo (tmp); nlstop; diff --git a/code/nel/src/misc/displayer.cpp b/code/nel/src/misc/displayer.cpp index 57b3e09d4..e1738592c 100644 --- a/code/nel/src/misc/displayer.cpp +++ b/code/nel/src/misc/displayer.cpp @@ -700,6 +700,9 @@ void CMsgBoxDisplayer::doDisplay ( const CLog::TDisplayInfo& args, const char *m # endif abort(); break; + + default: + break; } // no more sent mail for crash diff --git a/code/nel/src/pacs/global_retriever.cpp b/code/nel/src/pacs/global_retriever.cpp index 115fac0e6..0b8d355df 100644 --- a/code/nel/src/pacs/global_retriever.cpp +++ b/code/nel/src/pacs/global_retriever.cpp @@ -784,7 +784,7 @@ bool NLPACS::CGlobalRetriever::buildInstance(const string &id, const NLMISC::C const CRetrieverInstance &instance = makeInstance(retrieverId, 0, CVector(position)); // check make instance success - if (&instance == NULL || instance.getInstanceId() == -1 || instance.getRetrieverId() != retrieverId) + if (instance.getInstanceId() == -1 || instance.getRetrieverId() != retrieverId) return false; // links new instance to its neighbors diff --git a/code/ryzom/client/src/sky_object.cpp b/code/ryzom/client/src/sky_object.cpp index 9d4ada303..ad6b7615f 100644 --- a/code/ryzom/client/src/sky_object.cpp +++ b/code/ryzom/client/src/sky_object.cpp @@ -396,7 +396,7 @@ bool CSkyObject::setup(const CClientDate &date, const CClientDate &animationDate for(uint k = 0; k < SKY_MAX_NUM_STAGE; ++k) { if (TexPanner[k].U != 0.f || TexPanner[k].V != 0.f || - OffsetUBitmap != NULL || OffsetVBitmap != NULL ) + OffsetUBitmap[k] != NULL || OffsetVBitmap[k] != NULL ) { //nlinfo("global date = %f", animTime); // there's tex panning for that stage diff --git a/code/ryzom/common/src/game_share/utils.h b/code/ryzom/common/src/game_share/utils.h index 56ac05e0f..a93c68a4d 100644 --- a/code/ryzom/common/src/game_share/utils.h +++ b/code/ryzom/common/src/game_share/utils.h @@ -425,7 +425,8 @@ inline void CCallStackSingleton::setTopStackEntry(ICallStackEntry* newEntry) inline void CCallStackSingleton::display(NLMISC::CLog *log) { nlassert(log!=NULL); - getTopStackEntry()->displayStack(*log); + ICallStackEntry *entry = getTopStackEntry(); + if (entry) entry->displayStack(*log); log->displayNL(""); } @@ -468,15 +469,13 @@ inline ICallStackEntry::~ICallStackEntry() inline void ICallStackEntry::displayStack(NLMISC::CLog& log) const { // stop recursing when we reach a NULL object - // (this is implemented in this way in order to ximplify call code) - if (this==NULL) - return; + // (this is implemented in this way in order to simplify call code) // display this entry displayEntry(log); // recurse through call stack - _Next->displayStack(log); + if (_Next) _Next->displayStack(log); }