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

View file

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

View file

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

View file

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

View file

@ -327,10 +327,10 @@ uint32 CBotChatPageTrade::getCurrItemQuantity() const
// TODO: edit box in faction points?
CGroupEditBox *ed = dynamic_cast<CGroupEditBox *>(ig->getGroup("header_opened:standard_price:quantity:edit:eb"));
if (!ed) return ~0;
int intQuantity;
uint32 intQuantity;
if (fromString(ed->getInputString().toString(), intQuantity))
{
return (uint32) intQuantity;
return intQuantity;
}
else
{
@ -375,7 +375,7 @@ uint32 CBotChatPageTrade::getCurrItemPriceResale() 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 (_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;
return std::numeric_limits<uint64>::max();
}
@ -809,11 +809,11 @@ void CBotChatPageTrade::updateTradeModal()
if (cantTradeButton) cantTradeButton->setText(CI18N::get("uiWontBuyThis"));
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"));
}
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->setDefaultContextHelp(CI18N::get("uittBadQuantity"));
@ -1100,7 +1100,7 @@ bool CBotChatPageTrade::isTradeValid( bool enableResale ) const
getCurrItemFactionTypePoints(fpType, fpCost);
// 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)
{
// valid if at least one price type is not 0
@ -1179,7 +1179,7 @@ void CBotChatPageTrade::confirmTrade( bool enableResale )
{
uint32 quantity = getCurrItemQuantity();
sint32 resalePrice = resaleEnabled ? getCurrItemPriceResale() : 0; // getCurrItemPriceResale() returns 0 is !_ResaleEdit
if (quantity != ~0)
if (quantity != std::numeric_limits<uint32>::max())
{
uint16 u16Quantity = (uint16) quantity;
// The Item bought is a SPhrase ?
@ -2120,7 +2120,7 @@ void CBotChatPageTrade::startDestroyItemDialog()
// setup the quantity to destroy (if edited correctly)
uint32 quantity= getCurrItemQuantity();
if(quantity==0 || quantity==~0)
if(quantity==0 || quantity==std::numeric_limits<uint32>::max())
return;
// if quantity check, maximize with it (if user entered to big value...)
if(_QuantityCheck)
@ -2144,7 +2144,7 @@ void CBotChatPageTrade::confirmDestroyItemDialog()
// get the quantity destroyed
uint32 quantity= getCurrItemQuantity();
// 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(_QuantityCheck)
@ -2190,7 +2190,7 @@ void CBotChatPageTrade::confirmDestroyItemDialog()
pIM->disableModalWindow();
// 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
endTradeModal();

View file

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

View file

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

View file

@ -2675,7 +2675,7 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
CInterfaceGroup *tw= getTopWindow();
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)
{
bool result = _CaptureKeyboard->handleEvent(event);
@ -5494,8 +5494,6 @@ class CHandlerEmote : public IActionHandler
public:
void execute (CCtrlBase * /* pCaller */, const std::string &sParams)
{
// An emote is 2 things : a phrase and an animation
// Phrase is the phrase that server returns in chat system
// Behav is the animation played

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
// string SourceNameXDFull;
// 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(PatchName);
if (j > 0)
{
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) );
// try to download
try {
try
{
pPM->getServerFile(patchFullname, false, patchName);
} catch ( const std::exception& e)
}
catch ( const std::exception& e)
{
nlwarning("%s", e.what());
pPM->setState(true, ucstring(e.what()) );
@ -3468,12 +3466,14 @@ void CDownloadThread::run()
// create directory tree
NLMISC::CFile::createDirectoryTree(path);
// Try to download, rename, applyDate and send error msg to gui in case of error
try {
try
{
pPM->getServerFile(patchName, false, tmpFile);
NLMISC::CFile::moveFile(finalFile.c_str(), tmpFile.c_str());
pPM->applyDate(finalFile, _Entries[first].Timestamp);
} catch ( const std::exception& e)
}
catch ( const std::exception& e)
{
nlwarning("%s", e.what());
pPM->setState(true, ucstring(e.what()) );

View file

@ -1329,7 +1329,7 @@ void CUserEntity::resetAnyMoveTo()
if(_MoveToAction==CUserEntity::CombatPhrase || _MoveToAction==CUserEntity::ExtractRM)
{
// 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)
{
CSPhraseManager *pPM= CSPhraseManager::getInstance();
@ -3758,7 +3758,7 @@ void CUserEntity::extractRM()
CSPhraseManager *pm = CSPhraseManager::getInstance();
uint index;
uint memoryLine;
bool autoFindPhrase = (_MoveToPhraseMemoryLine == (uint)~0);
bool autoFindPhrase = (_MoveToPhraseMemoryLine == std::numeric_limits<uint>::max());
if ( ! autoFindPhrase )
{
// Use clicked phrase
@ -3773,7 +3773,7 @@ void CUserEntity::extractRM()
if ( ! findExtractionActionInMemory( pm, bm, memoryLine, index ) )
{
// 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();
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.
uint32 phraseId = pm->getMemorizedPhrase( memoryLine, index );