Changed: #825 Remove all warnings when compiling Ryzom
This commit is contained in:
parent
5cd98b6e45
commit
4027e82360
19 changed files with 85 additions and 67 deletions
|
@ -697,6 +697,7 @@ public:
|
|||
virtual bool addLinearFloatKey(const UKeyLinearFloat &key)
|
||||
{
|
||||
CKeyFloat k;
|
||||
k.OODeltaTime= 0.f;
|
||||
k.Value= key.Value;
|
||||
addKey(k, key.Time);
|
||||
return true;
|
||||
|
|
|
@ -238,11 +238,11 @@ namespace STRING_MANAGER
|
|||
return false;
|
||||
}
|
||||
|
||||
bool findCol(ucstring colName, uint &colIndex)
|
||||
bool findCol(const ucstring &colName, uint &colIndex)
|
||||
{
|
||||
if (Data.empty())
|
||||
return false;
|
||||
TWorksheet::TRow::iterator it = std::find(Data[0].begin(), Data[0].end(), ucstring(colName));
|
||||
TWorksheet::TRow::iterator it = std::find(Data[0].begin(), Data[0].end(), colName);
|
||||
if (it == Data[0].end())
|
||||
return false;
|
||||
|
||||
|
|
|
@ -530,7 +530,7 @@ void handleReceivedPong (CClient *client, sint64 pongTime)
|
|||
// init the UDP connection
|
||||
if (client == NULL)
|
||||
{
|
||||
uint32 session;
|
||||
uint32 session = 0;
|
||||
msgin.serial (session);
|
||||
|
||||
// Find a new udp connection, find the linked
|
||||
|
@ -568,13 +568,13 @@ void handleReceivedPong (CClient *client, sint64 pongTime)
|
|||
}
|
||||
|
||||
// Read the message
|
||||
sint64 pingTime;
|
||||
sint64 pingTime = 0;
|
||||
msgin.serial(pingTime);
|
||||
|
||||
uint32 pongNumber;
|
||||
uint32 pongNumber = 0;
|
||||
msgin.serial(pongNumber);
|
||||
|
||||
uint32 blockNumber;
|
||||
uint32 blockNumber = 0;
|
||||
msgin.serial(blockNumber);
|
||||
|
||||
// nlinfo ("receive a pong from %s pongnb %d %"NL_I64"d", CurrentInMsg->AddrFrom.asString().c_str(), pongNumber, pongTime - pingTime);
|
||||
|
|
|
@ -36,7 +36,7 @@ using namespace NLMISC;
|
|||
|
||||
namespace NLSOUND {
|
||||
|
||||
CSampleBankManager::CSampleBankManager(CAudioMixerUser *audioMixer) : m_AudioMixer(audioMixer), m_LoadedSize(NULL)
|
||||
CSampleBankManager::CSampleBankManager(CAudioMixerUser *audioMixer) : m_AudioMixer(audioMixer), m_LoadedSize(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -970,7 +970,7 @@ int main(int /* argc */, char ** /* argv */)
|
|||
initViewerConfig("zviewer.cfg");
|
||||
|
||||
// Init NELU
|
||||
NL3D::CNELU::init(ViewerCfg.Width, ViewerCfg.Height, CViewport(), ViewerCfg.Depth, ViewerCfg.Windowed, NULL, false, false);
|
||||
NL3D::CNELU::init(ViewerCfg.Width, ViewerCfg.Height, CViewport(), ViewerCfg.Depth, ViewerCfg.Windowed, EmptyWindow, false, false);
|
||||
NL3D::CNELU::Driver->setWindowTitle(ucstring("NeL ZViewer"));
|
||||
NL3D::CNELU::Camera->setTransformMode(ITransformable::DirectMatrix);
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ extern const char *CDBBankNames[INVALID_CDB_BANK+1];
|
|||
// reset all static data
|
||||
void CCDBNodeBranch::reset()
|
||||
{
|
||||
for ( uint b=0; b!=INVALID_CDB_BANK; ++b )
|
||||
for ( uint b=0; b<NB_CDB_BANKS; ++b )
|
||||
_CDBBankToUnifiedIndexMapping[b].clear();
|
||||
_UnifiedIndexToBank.clear();
|
||||
_CDBLastUnifiedIndex = 0;
|
||||
|
|
|
@ -4521,6 +4521,10 @@ void CCharacterCL::applyBehaviourFlyingHPs(const CBehaviourContext &bc, const MB
|
|||
else
|
||||
deltaHPColor = ClientCfg.SystemInfoParams["dg"].Color;
|
||||
}
|
||||
else
|
||||
{
|
||||
deltaHPColor = CRGBA(127,127,127);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -8333,7 +8337,7 @@ ADD_METHOD(void CCharacterCL::displayDebug(float x, float &y, float lineStep)) /
|
|||
TextContext->printfAt(x, y, "(Walk)Run Factor: %f", runFactor());
|
||||
y += lineStep;
|
||||
// Display the current animation name(id)(offset)(nbloop) pour le channel MOVE.
|
||||
TextContext->printfAt(x, y, "Current Animation: %s(%u)(%f)(%u loops)", animId(MOVE)==-1?"[NONE]":currentAnimationName().c_str(), animId(MOVE), animOffset(MOVE), _NbLoopAnim);
|
||||
TextContext->printfAt(x, y, "Current Animation: %s(%u)(%lf)(%u loops)", animId(MOVE)==std::numeric_limits<uint>::max()?"[NONE]":currentAnimationName().c_str(), animId(MOVE), animOffset(MOVE), _NbLoopAnim);
|
||||
y += lineStep;
|
||||
// First Pos
|
||||
if(_First_Pos)
|
||||
|
|
|
@ -1811,13 +1811,13 @@ string getTarget(CCtrlBase * /* ctrl */, const string &targetName)
|
|||
if (!elem)
|
||||
{
|
||||
nlwarning("<CInterfaceExpr::getprop> : Element is NULL");
|
||||
return false;
|
||||
return "";
|
||||
}
|
||||
const CReflectedProperty *pRP = CReflectSystem ::getProperty(elem->getReflectedClassName(), rTI.PropertyName);
|
||||
|
||||
if (pRP->Type == CReflectedProperty::String)
|
||||
return ((elem->*(pRP->GetMethod.GetString))());
|
||||
return string("");
|
||||
return "";
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -106,7 +106,7 @@ public:
|
|||
void setOpened(bool opened) { Opened = opened; }
|
||||
bool getOpened() const { return Opened; }
|
||||
void setText(const ucstring &text) { Text = text; }
|
||||
ucstring getText() const { return Text; }
|
||||
const ucstring& getText() const { return Text; }
|
||||
sint32 getFontSize() const { return FontSize; }
|
||||
void setFontSize(sint32 value) { FontSize = value; }
|
||||
sint32 getYDecal() const { return YDecal; }
|
||||
|
|
|
@ -78,7 +78,7 @@ bool CInterfaceOptions::parse (xmlNodePtr cur)
|
|||
CXMLAutoPtr ptr, val;
|
||||
ptr = xmlGetProp (cur, (xmlChar*)"name");
|
||||
val = xmlGetProp (cur, (xmlChar*)"value");
|
||||
if ((ptr == NULL) || (val == NULL))
|
||||
if (!ptr || !val)
|
||||
{
|
||||
nlinfo("param with no name or no value");
|
||||
ok = false;
|
||||
|
@ -321,7 +321,7 @@ bool COptionsList::parse (xmlNodePtr cur)
|
|||
{
|
||||
CXMLAutoPtr ptr, val;
|
||||
val = xmlGetProp (cur, (xmlChar*)"value");
|
||||
if (val == NULL)
|
||||
if (!val)
|
||||
{
|
||||
nlinfo("param with no name or no value");
|
||||
ok = false;
|
||||
|
|
|
@ -78,9 +78,9 @@ void CPlayerTrade::restoreItem(CDBCtrlSheet *exchangeSlot)
|
|||
|
||||
// *** If not an AMMO, try to 'auto-stack', as server does
|
||||
bool canAutoStack= false;
|
||||
uint32 autoStackSheetId;
|
||||
sint32 autoStackQuality;
|
||||
sint32 autoStackMaxQuantity;
|
||||
uint32 autoStackSheetId = 0;
|
||||
sint32 autoStackQuality = 0;
|
||||
sint32 autoStackMaxQuantity = 0;
|
||||
const CItemSheet *itemSheet= exchangeSlot->asItemSheet();
|
||||
// NB: cannot auto stack ammo because their full props (dammage etc...) are not sent to client
|
||||
if(itemSheet)
|
||||
|
|
|
@ -442,7 +442,7 @@ bool CLightCycleManager::isInDayInterval(float startHour, float endHour, float d
|
|||
float CLightCycleManager::getLightLevel(float hour) const
|
||||
{
|
||||
H_AUTO_USE(RZ_LightCycleManager)
|
||||
float lightValue;
|
||||
float lightValue = 0.f;
|
||||
if (isInDayInterval(_Desc.NightTransitionStartHour, _Desc.NightTransitionEndHour, _Desc.NumHours, hour, lightValue))
|
||||
return lightValue;
|
||||
if (isInDayInterval(_Desc.DawnTransitionStartHour, _Desc.DawnTransitionEndHour, _Desc.NumHours, hour, lightValue))
|
||||
|
|
|
@ -1206,15 +1206,15 @@ void CStringManagerClient::initI18NSpecialWords(const std::string &languageCode)
|
|||
continue;
|
||||
|
||||
// Get the women name index if possible.
|
||||
uint womenNameColIndex;
|
||||
uint womenNameColIndex = std::numeric_limits<uint>::max();
|
||||
if( !ws.findCol(womenNameColIdent, womenNameColIndex) )
|
||||
womenNameColIndex= std::numeric_limits<uint>::max();
|
||||
|
||||
// Get the description index if possible.
|
||||
uint descColIndex;
|
||||
uint descColIndex = std::numeric_limits<uint>::max();
|
||||
if( !ws.findCol(descColIdent, descColIndex) )
|
||||
descColIndex= std::numeric_limits<uint>::max();
|
||||
uint descColIndex2;
|
||||
uint descColIndex2 = std::numeric_limits<uint>::max();
|
||||
if( !ws.findCol(descColIdent2, descColIndex2) )
|
||||
descColIndex2= std::numeric_limits<uint>::max();
|
||||
|
||||
|
|
|
@ -1137,12 +1137,12 @@ namespace CHARSYNC
|
|||
|
||||
}
|
||||
//
|
||||
ucstring getFullName() const
|
||||
const ucstring& getFullName() const
|
||||
{
|
||||
return _FullName;
|
||||
}
|
||||
|
||||
void setFullName(ucstring value)
|
||||
void setFullName(const ucstring &value)
|
||||
{
|
||||
|
||||
_FullName = value;
|
||||
|
|
|
@ -218,24 +218,27 @@ private:
|
|||
|
||||
void CDirectionLayer::serial(NLMISC::IStream& f)
|
||||
{
|
||||
uint i;
|
||||
for (i=0; i<9; ++i)
|
||||
uint i, j;
|
||||
for (i=0; i<3; ++i)
|
||||
{
|
||||
for (j=0; j<3; ++j)
|
||||
{
|
||||
if (f.isReading())
|
||||
{
|
||||
delete Grid[0][i];
|
||||
Grid[0][i] = NULL;
|
||||
delete Grid[i][j];
|
||||
Grid[i][j] = NULL;
|
||||
}
|
||||
|
||||
bool present = (Grid[0][i] != NULL);
|
||||
bool present = (Grid[i][j] != NULL);
|
||||
f.serial(present);
|
||||
|
||||
if (present)
|
||||
{
|
||||
if (f.isReading())
|
||||
Grid[0][i] = I16x16Layer::load(f);
|
||||
Grid[i][j] = I16x16Layer::load(f);
|
||||
else
|
||||
I16x16Layer::save(f, Grid[0][i]);
|
||||
I16x16Layer::save(f, Grid[i][j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1360,7 +1363,7 @@ void CWorldMap::countCells(uint &compute, uint &white, uint &simple, uint &multi
|
|||
const uint32 startMasterTopo=startTopoNode.getMasterTopo(possibleFlag);
|
||||
const uint32 endMasterTopo=endTopoNode.getMasterTopo(possibleFlag);
|
||||
if ( (startMasterTopo^endMasterTopo)!=0
|
||||
|| startMasterTopo==~0) // if not same masterTopo or invalid masterTopo then bypass ..
|
||||
|| startMasterTopo == std::numeric_limits<uint32>::max()) // if not same masterTopo or invalid masterTopo then bypass ..
|
||||
continue;
|
||||
|
||||
res.set(possibleFlag, startMasterTopo);
|
||||
|
@ -1489,14 +1492,14 @@ bool CWorldMap::findAStarPath(CWorldPosition const& start, CWorldPosition const&
|
|||
++nbHeapSteps;
|
||||
|
||||
// Get best node (popping it)
|
||||
father = ~0; // :TODO: Remove that useless statement (since do while first loop ALWAYS overwrite it)
|
||||
father = std::numeric_limits<uint>::max(); // :TODO: Remove that useless statement (since do while first loop ALWAYS overwrite it)
|
||||
do
|
||||
{
|
||||
father = heap.pop();
|
||||
}
|
||||
while (!nodes[father].isOpened() && !heap.empty());
|
||||
|
||||
if (father==~0)
|
||||
if (father == std::numeric_limits<uint>::max())
|
||||
break;
|
||||
|
||||
// Mark current node as closed
|
||||
|
@ -2238,7 +2241,7 @@ bool CWorldMap::setWorldPosition(sint32 z, CWorldPosition &wpos, const CAIVector
|
|||
|
||||
sint32 minDistZ = INT_MAX;
|
||||
CSlot bestSlot;
|
||||
sint32 bestZ;
|
||||
sint32 bestZ = 0;
|
||||
// Find best slot
|
||||
for (uint32 s=0; s<3; ++s)
|
||||
{
|
||||
|
|
|
@ -1173,9 +1173,10 @@ private:
|
|||
inline
|
||||
CDirectionLayer::CDirectionLayer()
|
||||
{
|
||||
uint i;
|
||||
for (i=0; i<9; ++i)
|
||||
Grid[0][i] = NULL;
|
||||
uint i, j;
|
||||
for (i=0; i<3; ++i)
|
||||
for (j=0; j<3; ++j)
|
||||
Grid[i][j] = NULL;
|
||||
}
|
||||
|
||||
inline
|
||||
|
@ -1205,39 +1206,42 @@ void CDirectionLayer::dump()
|
|||
if (gridDirectionLayer)
|
||||
motion = gridDirectionLayer->getDirection(y,x);
|
||||
|
||||
char c = ' ';
|
||||
|
||||
switch (motion.getVal())
|
||||
{
|
||||
case CDirection::N:
|
||||
output[y+i*16][x+j*16] = '^';
|
||||
c = '^';
|
||||
break;
|
||||
case CDirection::S:
|
||||
output[y+i*16][x+j*16] = 'v';
|
||||
c = 'v';
|
||||
break;
|
||||
case CDirection::E:
|
||||
output[y+i*16][x+j*16] = '>';
|
||||
c = '>';
|
||||
break;
|
||||
case CDirection::W:
|
||||
output[y+i*16][x+j*16] = '<';
|
||||
c = '<';
|
||||
break;
|
||||
case CDirection::NE:
|
||||
output[y+i*16][x+j*16] = '7';
|
||||
c = '7';
|
||||
break;
|
||||
case CDirection::SW:
|
||||
output[y+i*16][x+j*16] = 'L';
|
||||
c = 'L';
|
||||
break;
|
||||
case CDirection::NW:
|
||||
output[y+i*16][x+j*16] = 'r';
|
||||
c = 'r';
|
||||
break;
|
||||
case CDirection::SE:
|
||||
output[y+i*16][x+j*16] = '\\';
|
||||
break;
|
||||
case 255:
|
||||
output[y+i*16][x+j*16] = ' ';
|
||||
c = '\\';
|
||||
break;
|
||||
// case 255:
|
||||
// c = ' ';
|
||||
// break;
|
||||
default:
|
||||
output[y+i*16][x+j*16] = 'o';
|
||||
c = 'o';
|
||||
break;
|
||||
}
|
||||
output[y+i*16][x+j*16] = c;
|
||||
}
|
||||
|
||||
char op[256];
|
||||
|
|
|
@ -2694,7 +2694,7 @@ void CGameItem::addHp( double hpGain )
|
|||
//-----------------------------------------------
|
||||
// changes the custom text of an item
|
||||
//-----------------------------------------------
|
||||
void CGameItem::setCustomText(ucstring val)
|
||||
void CGameItem::setCustomText(const ucstring &val)
|
||||
{
|
||||
_CustomText = val;
|
||||
// getInventory()->onItemChanged(getInventorySlot(), INVENTORIES::TItemChangeFlags(INVENTORIES::itc_custom_text));
|
||||
|
|
|
@ -702,9 +702,9 @@ public :
|
|||
const CItemCraftParameters * getCraftParameters() const { return _CraftParameters; }
|
||||
|
||||
/// get custom string (for scroll-like items)
|
||||
ucstring getCustomText() const { return _CustomText; }
|
||||
const ucstring& getCustomText() const { return _CustomText; }
|
||||
/// set custom string (for scroll-like items)
|
||||
void setCustomText(ucstring val);
|
||||
void setCustomText(const ucstring &val);
|
||||
|
||||
protected:
|
||||
friend class CFaberPhrase;
|
||||
|
|
|
@ -44,37 +44,43 @@ void normalisePackageDescriptionFileName(std::string& fileName)
|
|||
|
||||
void GeneratePatch(const std::string& srcFileName,const std::string& destFileName,const std::string& patchFileName)
|
||||
{
|
||||
std::string cmd="xdelta.exe delta";
|
||||
std::string cmd="xdelta delta";
|
||||
cmd+=" "+srcFileName+" "+destFileName+" "+patchFileName;
|
||||
nlinfo("executing system command: %s",cmd.c_str());
|
||||
#ifdef NL_OS_WINDOWS
|
||||
_spawnlp(_P_WAIT, "xdelta.exe","xdelta.exe","delta",srcFileName.c_str(),destFileName.c_str(),patchFileName.c_str(),NULL);
|
||||
#else // NL_OS_WINDOWS
|
||||
system (cmd.c_str());
|
||||
sint error = system (cmd.c_str());
|
||||
if (error)
|
||||
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
|
||||
#endif // NL_OS_WINDOWS
|
||||
}
|
||||
|
||||
void ApplyPatch(const std::string& srcFileName,const std::string& destFileName,const std::string& patchFileName=std::string())
|
||||
{
|
||||
std::string cmd="xdelta.exe patch";
|
||||
std::string cmd="xdelta patch";
|
||||
cmd+=" "+patchFileName+" "+srcFileName+" "+destFileName;
|
||||
nlinfo("executing system command: %s",cmd.c_str());
|
||||
#ifdef NL_OS_WINDOWS
|
||||
_spawnlp(_P_WAIT, "xdelta.exe","xdelta.exe","patch",patchFileName.c_str(),srcFileName.c_str(),destFileName.c_str(),NULL);
|
||||
#else // NL_OS_WINDOWS
|
||||
system (cmd.c_str());
|
||||
sint error = system (cmd.c_str());
|
||||
if (error)
|
||||
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
|
||||
#endif // NL_OS_WINDOWS
|
||||
}
|
||||
|
||||
void GenerateLZMA(const std::string sourceFile, const std::string &outputFile)
|
||||
{
|
||||
std::string cmd="lzma.exe e ";
|
||||
std::string cmd="lzma e ";
|
||||
cmd+=" "+sourceFile+" "+outputFile;
|
||||
nlinfo("executing system command: %s",cmd.c_str());
|
||||
#ifdef NL_OS_WINDOWS
|
||||
_spawnlp(_P_WAIT, "lzma.exe","lzma.exe", "e", sourceFile.c_str(), outputFile.c_str(), NULL);
|
||||
#else // NL_OS_WINDOWS
|
||||
system (cmd.c_str());
|
||||
sint error = system (cmd.c_str());
|
||||
if (error)
|
||||
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
|
||||
#endif // NL_OS_WINDOWS
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue