Changed: #825 Remove all warning when compiling Ryzom

This commit is contained in:
kervala 2010-10-18 10:10:16 +02:00
parent 54961449c3
commit 5574174db4
10 changed files with 52 additions and 51 deletions

View file

@ -510,7 +510,6 @@ void checkUnderCursor()
} }
} }
} }
else else
SlotUnderCursor = CLFECOMMON::INVALID_SLOT; SlotUnderCursor = CLFECOMMON::INVALID_SLOT;
} }
@ -839,5 +838,5 @@ void contextBuildTotem(bool rightClick, bool dblClick)
return; return;
if( ClientCfg.DblClickMode && !dblClick) if( ClientCfg.DblClickMode && !dblClick)
return; return;
UserEntity->moveToTotemBuildingPhrase(SlotUnderCursor,MaxExtractionDistance, ~0, ~0, true ); UserEntity->moveToTotemBuildingPhrase(SlotUnderCursor,MaxExtractionDistance, std::numeric_limits<uint>::max(), std::numeric_limits<uint>::max(), true );
}// contextBuildTotem // }// contextBuildTotem //

View file

@ -35,6 +35,9 @@
#include "nel/misc/time_nl.h" #include "nel/misc/time_nl.h"
#include "nel/misc/vector.h" #include "nel/misc/vector.h"
#include "nel/misc/file.h" #include "nel/misc/file.h"
#include "nel/misc/aabbox.h"
// 3D
#include "nel/3d/u_instance.h"
// Std. // Std.
#include <vector> #include <vector>

View file

@ -910,6 +910,7 @@ protected:
std::string _PermanentStatutIcon; std::string _PermanentStatutIcon;
// Has reserved title? // Has reserved title?
bool _HasReservedTitle; bool _HasReservedTitle;
// Extended Name // Extended Name
ucstring _NameEx; ucstring _NameEx;
// String ID // String ID

View file

@ -445,7 +445,6 @@ void HandleSystemCursorCapture(const CEvent &event)
} }
} }
// ********************************************************************************* // *********************************************************************************
bool IsSystemCursorInClientArea() bool IsSystemCursorInClientArea()
{ {
@ -506,8 +505,6 @@ bool IsSystemCursorInClientArea()
return true; return true;
} }
sint CNiceInputAuto::_Count = 0; sint CNiceInputAuto::_Count = 0;

View file

@ -327,10 +327,10 @@ uint32 CBotChatPageTrade::getCurrItemQuantity() const
// TODO: edit box in faction points? // TODO: edit box in faction points?
CGroupEditBox *ed = dynamic_cast<CGroupEditBox *>(ig->getGroup("header_opened:standard_price:quantity:edit:eb")); CGroupEditBox *ed = dynamic_cast<CGroupEditBox *>(ig->getGroup("header_opened:standard_price:quantity:edit:eb"));
if (!ed) return ~0; if (!ed) return ~0;
int intQuantity; uint32 intQuantity;
if (fromString(ed->getInputString().toString(), intQuantity)) if (fromString(ed->getInputString().toString(), intQuantity))
{ {
return (uint32) intQuantity; return intQuantity;
} }
else else
{ {
@ -375,7 +375,7 @@ uint32 CBotChatPageTrade::getCurrItemPriceResale() const
// *************************************************************************************** // ***************************************************************************************
uint64 CBotChatPageTrade::getCurrItemPrice(bool mulByFame) const uint64 CBotChatPageTrade::getCurrItemPrice(bool mulByFame) const
{ {
if (!_CurrItemSheet) return ~0; if (!_CurrItemSheet) return std::numeric_limits<uint64>::max();
if (_BuyDlgOn && (_BuyMean == MoneyGuildXP || _BuyMean == GuildMoneyGuildXP || _BuyMean == GuildMoney) ) if (_BuyDlgOn && (_BuyMean == MoneyGuildXP || _BuyMean == GuildMoneyGuildXP || _BuyMean == GuildMoney) )
{ {
if (_BuyMean == MoneyGuildXP) if (_BuyMean == MoneyGuildXP)
@ -419,7 +419,7 @@ uint64 CBotChatPageTrade::getCurrItemPrice(bool mulByFame) const
} }
} }
} }
return ~0; return std::numeric_limits<uint64>::max();
} }
// *************************************************************************************** // ***************************************************************************************
@ -440,7 +440,7 @@ uint64 CBotChatPageTrade::getCurrItemXP() const
return 0; // By now no need for XP even if xp guild required return 0; // By now no need for XP even if xp guild required
} }
return ~0; return std::numeric_limits<uint64>::max();
} }
@ -809,11 +809,11 @@ void CBotChatPageTrade::updateTradeModal()
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiWontBuyThis")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiWontBuyThis"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittWontBuyThis")); if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittWontBuyThis"));
} }
else if (_SellDlgOn && priceWithoutFame == ~0) else if (_SellDlgOn && priceWithoutFame == std::numeric_limits<uint64>::max())
{ {
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiPriceNotReceived")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiPriceNotReceived"));
} }
else if (quantity == 0 || quantity == ~0) else if (quantity == 0 || quantity == std::numeric_limits<uint32>::max())
{ {
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBadQuantity")); if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiBadQuantity"));
if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadQuantity")); if (cantTradeButton) cantTradeButton->setDefaultContextHelp(CI18N::get("uittBadQuantity"));
@ -1100,7 +1100,7 @@ bool CBotChatPageTrade::isTradeValid( bool enableResale ) const
getCurrItemFactionTypePoints(fpType, fpCost); getCurrItemFactionTypePoints(fpType, fpCost);
// if price/quantity is valid // if price/quantity is valid
bool validSetup= priceWithoutFame != ~0 && quantity != ~0 && quantity != 0; bool validSetup= priceWithoutFame != std::numeric_limits<uint64>::max() && quantity != std::numeric_limits<uint32>::max() && quantity != 0;
if(validSetup && _BuyMean==MoneyFactionPoints) if(validSetup && _BuyMean==MoneyFactionPoints)
{ {
// valid if at least one price type is not 0 // valid if at least one price type is not 0
@ -1179,7 +1179,7 @@ void CBotChatPageTrade::confirmTrade( bool enableResale )
{ {
uint32 quantity = getCurrItemQuantity(); uint32 quantity = getCurrItemQuantity();
sint32 resalePrice = resaleEnabled ? getCurrItemPriceResale() : 0; // getCurrItemPriceResale() returns 0 is !_ResaleEdit sint32 resalePrice = resaleEnabled ? getCurrItemPriceResale() : 0; // getCurrItemPriceResale() returns 0 is !_ResaleEdit
if (quantity != ~0) if (quantity != std::numeric_limits<uint32>::max())
{ {
uint16 u16Quantity = (uint16) quantity; uint16 u16Quantity = (uint16) quantity;
// The Item bought is a SPhrase ? // The Item bought is a SPhrase ?
@ -2120,7 +2120,7 @@ void CBotChatPageTrade::startDestroyItemDialog()
// setup the quantity to destroy (if edited correctly) // setup the quantity to destroy (if edited correctly)
uint32 quantity= getCurrItemQuantity(); uint32 quantity= getCurrItemQuantity();
if(quantity==0 || quantity==~0) if(quantity==0 || quantity==std::numeric_limits<uint32>::max())
return; return;
// if quantity check, maximize with it (if user entered to big value...) // if quantity check, maximize with it (if user entered to big value...)
if(_QuantityCheck) if(_QuantityCheck)
@ -2144,7 +2144,7 @@ void CBotChatPageTrade::confirmDestroyItemDialog()
// get the quantity destroyed // get the quantity destroyed
uint32 quantity= getCurrItemQuantity(); uint32 quantity= getCurrItemQuantity();
// if correct quantity // if correct quantity
if(quantity!=0 && quantity!=~0) if(quantity!=0 && quantity!=std::numeric_limits<uint32>::max())
{ {
// if quantity check, maximize with it (if user entered too big value...) // if quantity check, maximize with it (if user entered too big value...)
if(_QuantityCheck) if(_QuantityCheck)
@ -2190,7 +2190,7 @@ void CBotChatPageTrade::confirmDestroyItemDialog()
pIM->disableModalWindow(); pIM->disableModalWindow();
// if the quantity entered was correct // if the quantity entered was correct
if(quantity!=0 && quantity!=~0) if(quantity!=0 && quantity!=std::numeric_limits<uint32>::max())
{ {
// close also the container modal // close also the container modal
endTradeModal(); endTradeModal();

View file

@ -20,6 +20,7 @@
#define RZ_CTRL_EDITBOX_H #define RZ_CTRL_EDITBOX_H
#include "interface_group.h" #include "interface_group.h"
#include "nel/3d/u_texture.h"
class CEventDescriptor; class CEventDescriptor;

View file

@ -41,6 +41,8 @@
#include "game_share/lift_icons.h" #include "game_share/lift_icons.h"
#include "../r2/editor.h" #include "../r2/editor.h"
#include "chat_window.h"
#include "people_interraction.h"
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;

View file

@ -459,7 +459,7 @@ void CInterfaceManager::initLogin()
} }
nldebug("Textures Login Interface"); nldebug("Textures Login Interface");
for (vector<string>::iterator it = ClientCfg.TexturesLoginInterface.begin(), end = ClientCfg.TexturesLoginInterface.end(); it != end; ++it) for (vector<string>::iterator it = ClientCfg.TexturesLoginInterface.begin(), end = ClientCfg.TexturesLoginInterface.end(); it != end; ++it)
{ {
nldebug("Textures Login Interface: %s", (*it).c_str()); nldebug("Textures Login Interface: %s", (*it).c_str());
@ -549,13 +549,13 @@ void CInterfaceManager::initOutGame()
} }
nldebug("Textures OutGame Interface"); nldebug("Textures OutGame Interface");
for (vector<string>::iterator it = ClientCfg.TexturesOutGameInterface.begin(), end = ClientCfg.TexturesOutGameInterface.end(); it != end; ++it) for (vector<string>::iterator it = ClientCfg.TexturesOutGameInterface.begin(), end = ClientCfg.TexturesOutGameInterface.end(); it != end; ++it)
{ {
nldebug("Textures OutGame Interface: %s", (*it).c_str()); nldebug("Textures OutGame Interface: %s", (*it).c_str());
loadTextures(*it + ".tga", *it + ".txt", false); loadTextures(*it + ".tga", *it + ".txt", false);
} }
for (vector<string>::iterator it = ClientCfg.TexturesOutGameInterfaceDXTC.begin(), end = ClientCfg.TexturesOutGameInterfaceDXTC.end(); it != end; ++it) for (vector<string>::iterator it = ClientCfg.TexturesOutGameInterfaceDXTC.begin(), end = ClientCfg.TexturesOutGameInterfaceDXTC.end(); it != end; ++it)
{ {
nldebug("Textures OutGame Interface DXTC: %s", (*it).c_str()); nldebug("Textures OutGame Interface DXTC: %s", (*it).c_str());
@ -1667,7 +1667,7 @@ bool CInterfaceManager::loadConfig (const string &filename)
// *** Apply the NPC icon display mode // *** Apply the NPC icon display mode
CNPCIconCache::getInstance().init(!ClientCfg.R2EDEnabled && getDbProp("UI:SAVE:INSCENE:FRIEND:MISSION_ICON")->getValueBool()); CNPCIconCache::getInstance().init(!ClientCfg.R2EDEnabled && getDbProp("UI:SAVE:INSCENE:FRIEND:MISSION_ICON")->getValueBool());
return true; return true;
} }
@ -2189,7 +2189,7 @@ CInterfaceGroup *CInterfaceManager::getWindowForActiveMasterGroup(const std::str
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void CInterfaceManager::updateTooltipCoords() void CInterfaceManager::updateTooltipCoords()
{ {
updateTooltipCoords(_CurCtrlContextHelp); updateTooltipCoords(_CurCtrlContextHelp);
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -2239,7 +2239,7 @@ void CInterfaceManager::updateTooltipCoords(CCtrlBase *newCtrl)
yParent = newCtrl->getYReal(); yParent = newCtrl->getYReal();
wParent = newCtrl->getWReal(); wParent = newCtrl->getWReal();
hParent = newCtrl->getHReal(); hParent = newCtrl->getHReal();
// Additionaly, must clip this ctrl with its parent // Additionaly, must clip this ctrl with its parent
// (else animals are buggy for instance) // (else animals are buggy for instance)
CInterfaceGroup *parent= newCtrl->getParent(); CInterfaceGroup *parent= newCtrl->getParent();
if(parent) if(parent)
@ -2258,7 +2258,7 @@ void CInterfaceManager::updateTooltipCoords(CCtrlBase *newCtrl)
} }
// **** resolve auto posref // **** resolve auto posref
uint clampCount = adjustTooltipPosition(newCtrl, win, newCtrl->getToolTipParentPosRef(), newCtrl->getToolTipPosRef(), xParent, yParent, wParent, hParent); uint clampCount = adjustTooltipPosition(newCtrl, win, newCtrl->getToolTipParentPosRef(), newCtrl->getToolTipPosRef(), xParent, yParent, wParent, hParent);
if (clampCount != 0) if (clampCount != 0)
{ {
@ -2270,7 +2270,7 @@ void CInterfaceManager::updateTooltipCoords(CCtrlBase *newCtrl)
adjustTooltipPosition(newCtrl, win, newCtrl->getToolTipParentPosRef(), newCtrl->getToolTipPosRef(), xParent, yParent, wParent, hParent); adjustTooltipPosition(newCtrl, win, newCtrl->getToolTipParentPosRef(), newCtrl->getToolTipPosRef(), xParent, yParent, wParent, hParent);
} }
} }
} }
} }
} }
@ -2364,7 +2364,7 @@ void CInterfaceManager::drawContextHelp ()
{ {
// enable // enable
_CurCtrlContextHelp = newCtrl->getId(); _CurCtrlContextHelp = newCtrl->getId();
newCtrl->invalidateCoords(); newCtrl->invalidateCoords();
} }
} }
} }
@ -2376,7 +2376,7 @@ void CInterfaceManager::drawContextHelp ()
// **** display // **** display
// *************** // ***************
if(_CurCtrlContextHelp) if(_CurCtrlContextHelp)
{ {
CInterfaceGroup *groupContextHelp = getWindowForActiveMasterGroup(_CurCtrlContextHelp->getContextHelpWindowName()); CInterfaceGroup *groupContextHelp = getWindowForActiveMasterGroup(_CurCtrlContextHelp->getContextHelpWindowName());
if(groupContextHelp) if(groupContextHelp)
{ {
@ -2384,12 +2384,12 @@ void CInterfaceManager::drawContextHelp ()
* If this is the case, we just disable it, unless the tooltip was generated by the current modal window * If this is the case, we just disable it, unless the tooltip was generated by the current modal window
*/ */
if (!_ModalStack.empty()) if (!_ModalStack.empty())
{ {
CInterfaceGroup *mw = _ModalStack.back().ModalWindow; CInterfaceGroup *mw = _ModalStack.back().ModalWindow;
if (mw && mw->isIn(*groupContextHelp)) if (mw && mw->isIn(*groupContextHelp))
{ {
if (_CurCtrlContextHelp->isSonOf(mw)) if (_CurCtrlContextHelp->isSonOf(mw))
{ {
groupContextHelp->executeLuaScriptOnDraw(); groupContextHelp->executeLuaScriptOnDraw();
groupContextHelp->draw (); groupContextHelp->draw ();
// flush layers // flush layers
@ -2397,7 +2397,7 @@ void CInterfaceManager::drawContextHelp ()
} }
} }
else else
{ {
groupContextHelp->executeLuaScriptOnDraw(); groupContextHelp->executeLuaScriptOnDraw();
groupContextHelp->draw (); groupContextHelp->draw ();
// flush layers // flush layers
@ -2405,7 +2405,7 @@ void CInterfaceManager::drawContextHelp ()
} }
} }
else else
{ {
groupContextHelp->executeLuaScriptOnDraw(); groupContextHelp->executeLuaScriptOnDraw();
groupContextHelp->draw (); groupContextHelp->draw ();
// flush layers // flush layers
@ -2420,11 +2420,11 @@ void CInterfaceManager::drawContextHelp ()
} }
void CInterfaceManager::setContextHelpActive(bool active) void CInterfaceManager::setContextHelpActive(bool active)
{ {
if (!active) if (!active)
{ {
disableContextHelp(); disableContextHelp();
} }
_ContextHelpActive = active; _ContextHelpActive = active;
} }
@ -2675,7 +2675,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
CInterfaceGroup *tw= getTopWindow(); CInterfaceGroup *tw= getTopWindow();
if(tw && !tw->getAHOnEnter().empty()) if(tw && !tw->getAHOnEnter().empty())
{ {
// if the captured keypborad is in this Modal window, then must handle him in priority // if the captured keyboard is in this Modal window, then must handle him in priority
if(_CaptureKeyboard && _CaptureKeyboard->getRootWindow()==tw) if(_CaptureKeyboard && _CaptureKeyboard->getRootWindow()==tw)
{ {
bool result = _CaptureKeyboard->handleEvent(event); bool result = _CaptureKeyboard->handleEvent(event);
@ -5494,8 +5494,6 @@ class CHandlerEmote : public IActionHandler
public: public:
void execute (CCtrlBase * /* pCaller */, const std::string &sParams) void execute (CCtrlBase * /* pCaller */, const std::string &sParams)
{ {
// An emote is 2 things : a phrase and an animation // An emote is 2 things : a phrase and an animation
// Phrase is the phrase that server returns in chat system // Phrase is the phrase that server returns in chat system
// Behav is the animation played // Behav is the animation played
@ -5524,7 +5522,7 @@ public:
behavToSend = MBEHAV::IDLE; behavToSend = MBEHAV::IDLE;
} }
/* Emotes forbidden when dead, emotes with behav forbidden when /* Emotes forbidden when dead, emotes with behav forbidden when
* stunned or swimming */ * stunned or swimming */
if ( ( behavToSend != MBEHAV::IDLE && (isSwimming() || isStunned() || isDead() ) ) ) if ( ( behavToSend != MBEHAV::IDLE && (isSwimming() || isStunned() || isDead() ) ) )
{ {

View file

@ -2872,7 +2872,6 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP)
} }
} }
// following lines added by Sadge to ensure that the correct file gets patched // following lines added by Sadge to ensure that the correct file gets patched
// string SourceNameXDFull; // string SourceNameXDFull;
// if (NLMISC::CFile::fileExists(pPM->ClientDataPath + SourceNameXD)) SourceNameXDFull = pPM->ClientDataPath + SourceNameXD; // if (NLMISC::CFile::fileExists(pPM->ClientDataPath + SourceNameXD)) SourceNameXDFull = pPM->ClientDataPath + SourceNameXD;
@ -2898,9 +2897,6 @@ void CPatchThread::processFile (CPatchManager::SFileToPatch &rFTP)
pPM->deleteFile(SourceName); pPM->deleteFile(SourceName);
pPM->deleteFile(PatchName); pPM->deleteFile(PatchName);
if (j > 0) if (j > 0)
{ {
pPM->deleteFile(SourceNameXD, false, false); // File can exists if bad BNP loading pPM->deleteFile(SourceNameXD, false, false); // File can exists if bad BNP loading
@ -3210,9 +3206,11 @@ bool CPatchManager::download(const std::string& patchFullname, const std::string
NLMISC::CFile::createDirectoryTree( NLMISC::CFile::getPath(sourceFullname) ); NLMISC::CFile::createDirectoryTree( NLMISC::CFile::getPath(sourceFullname) );
// try to download // try to download
try { try
{
pPM->getServerFile(patchFullname, false, patchName); pPM->getServerFile(patchFullname, false, patchName);
} catch ( const std::exception& e) }
catch ( const std::exception& e)
{ {
nlwarning("%s", e.what()); nlwarning("%s", e.what());
pPM->setState(true, ucstring(e.what()) ); pPM->setState(true, ucstring(e.what()) );
@ -3468,12 +3466,14 @@ void CDownloadThread::run()
// create directory tree // create directory tree
NLMISC::CFile::createDirectoryTree(path); NLMISC::CFile::createDirectoryTree(path);
// Try to download, rename, applyDate and send error msg to gui in case of error // Try to download, rename, applyDate and send error msg to gui in case of error
try { try
{
pPM->getServerFile(patchName, false, tmpFile); pPM->getServerFile(patchName, false, tmpFile);
NLMISC::CFile::moveFile(finalFile.c_str(), tmpFile.c_str()); NLMISC::CFile::moveFile(finalFile.c_str(), tmpFile.c_str());
pPM->applyDate(finalFile, _Entries[first].Timestamp); pPM->applyDate(finalFile, _Entries[first].Timestamp);
} catch ( const std::exception& e) }
catch ( const std::exception& e)
{ {
nlwarning("%s", e.what()); nlwarning("%s", e.what());
pPM->setState(true, ucstring(e.what()) ); pPM->setState(true, ucstring(e.what()) );

View file

@ -1329,7 +1329,7 @@ void CUserEntity::resetAnyMoveTo()
if(_MoveToAction==CUserEntity::CombatPhrase || _MoveToAction==CUserEntity::ExtractRM) if(_MoveToAction==CUserEntity::CombatPhrase || _MoveToAction==CUserEntity::ExtractRM)
{ {
// the clientExecute has not been called in case of "ExtractRM autoFind" // the clientExecute has not been called in case of "ExtractRM autoFind"
bool autoFindExtractRM= _MoveToAction==CUserEntity::ExtractRM && _MoveToPhraseMemoryLine == (uint)~0; bool autoFindExtractRM= _MoveToAction==CUserEntity::ExtractRM && _MoveToPhraseMemoryLine == std::numeric_limits<uint>::max();
if(!autoFindExtractRM) if(!autoFindExtractRM)
{ {
CSPhraseManager *pPM= CSPhraseManager::getInstance(); CSPhraseManager *pPM= CSPhraseManager::getInstance();
@ -3758,7 +3758,7 @@ void CUserEntity::extractRM()
CSPhraseManager *pm = CSPhraseManager::getInstance(); CSPhraseManager *pm = CSPhraseManager::getInstance();
uint index; uint index;
uint memoryLine; uint memoryLine;
bool autoFindPhrase = (_MoveToPhraseMemoryLine == (uint)~0); bool autoFindPhrase = (_MoveToPhraseMemoryLine == std::numeric_limits<uint>::max());
if ( ! autoFindPhrase ) if ( ! autoFindPhrase )
{ {
// Use clicked phrase // Use clicked phrase
@ -3773,7 +3773,7 @@ void CUserEntity::extractRM()
if ( ! findExtractionActionInMemory( pm, bm, memoryLine, index ) ) if ( ! findExtractionActionInMemory( pm, bm, memoryLine, index ) )
{ {
// Search in other memory bar lines (because the auto-equip does not set the current line at once) // Search in other memory bar lines (because the auto-equip does not set the current line at once)
memoryLine = ~0; memoryLine = std::numeric_limits<uint>::max();
uint nbLines = pm->getNbMemoryLines(); uint nbLines = pm->getNbMemoryLines();
for ( uint j=0; j!=nbLines; ++j ) for ( uint j=0; j!=nbLines; ++j )
{ {
@ -3788,7 +3788,7 @@ void CUserEntity::extractRM()
} }
} }
if ( memoryLine != (uint)~0 ) if ( memoryLine != std::numeric_limits<uint>::max() )
{ {
// Open the forage (but not for care actions). Necessary for the case of redoing an extraction after a Drop All on the same source. // Open the forage (but not for care actions). Necessary for the case of redoing an extraction after a Drop All on the same source.
uint32 phraseId = pm->getMemorizedPhrase( memoryLine, index ); uint32 phraseId = pm->getMemorizedPhrase( memoryLine, index );