Changed: #825 Remove all warning when compiling Ryzom

This commit is contained in:
kervala 2010-10-30 14:20:26 +02:00
parent 4c12fbb058
commit 17d3e60360
14 changed files with 30 additions and 26 deletions

View file

@ -366,6 +366,9 @@ CCharacterCL::CCharacterCL()
_PvpEnemies[i] = false;
}
_ClanCivMaxFame = PVP_CLAN::None;
_ClanCultMaxFame = PVP_CLAN::None;
_OutpostId = 0;
_OutpostSide = OUTPOSTENUMS::UnknownPVPSide;

View file

@ -1575,6 +1575,7 @@ void CEntityManager::updateVisualProperty(const NLMISC::TGameCycle &gameCycle, c
string propName = toString("SERVER:Entities:E%d:P%d", slot, prop);
TProperty propty;
propty.GC = gameCycle;
propty.Value = 0;
// propty.Value = IngameDbMngr.getProp(propName);
@ -1849,7 +1850,7 @@ CEntityCL *CEntityManager::getEntityByName (const ucstring &name, bool caseSensi
uint i;
const uint count = (uint)_Entities.size();
uint selectedEntityId;
uint selectedEntityId = 0;
float selectedEntityDist = FLT_MAX; // No selected Entity
for (i=0; i<count; i++)

View file

@ -734,7 +734,7 @@ void CEntityCL::init()
}
_NameId = 0;
_PermanentStatutIcon = string("");
_PermanentStatutIcon.clear();
// Not a mission target by default
_MissionTarget = false;

View file

@ -724,9 +724,6 @@ void prelogInit()
setReportEmailFunction ((void*)sendEmail);
setDefaultEmailParams ("smtp.nevrax.com", "", "ryzombug@nevrax.com");
// create the data dir.
if (!CFile::isExists("data")) CFile::createDirectory("data");
// create the save dir.
if (!CFile::isExists("save")) CFile::createDirectory("save");

View file

@ -2755,7 +2755,6 @@ bool CInterfaceManager::handleEvent (const CEventDescriptor& event)
}
else if (event.getType() == CEventDescriptor::mouse && _MouseHandlingEnabled )
{
CEventDescriptorMouse &eventDesc = (CEventDescriptorMouse&)event;
// First thing to do : Capture handling
@ -6504,7 +6503,7 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
}
else if (token_param == ucstring("race"))
{
CCharacterCL *pC = (CCharacterCL*)(pTokenSubjectEntity);
CCharacterCL *pC = dynamic_cast<CCharacterCL*>(pTokenSubjectEntity);
if (pC)
{
EGSPD::CPeople::TPeople race = pC->people();
@ -6542,7 +6541,7 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
GSGENDER::EGender gender = GSGENDER::neutral;
if (pTokenSubjectEntity->isUser() || pTokenSubjectEntity->isPlayer() || pTokenSubjectEntity->isNPC())
{
CCharacterCL *pC = (CCharacterCL*)(pTokenSubjectEntity);
CCharacterCL *pC = dynamic_cast<CCharacterCL*>(pTokenSubjectEntity);
if (pC)
{
gender = pC->getGender();

View file

@ -609,12 +609,11 @@ void CLandscapePolyDrawer::computeBBoxFromPolygon(const NLMISC::CPolygon2D &poly
}
// search for min and max dimensions of polygon on x and y axes.
CVector2f rectMax, rectMin;
for(uint i=0; i<poly2D.Vertices.size(); i++)
CVector2f point = poly2D.Vertices[0];
CVector2f rectMax(point), rectMin(point);
for(uint i=1; i<poly2D.Vertices.size(); i++)
{
const CVector2f & point = poly2D.Vertices[i];
if(i==0)
rectMin = rectMax = point;
point = poly2D.Vertices[i];
rectMax.x = std::max(rectMax.x, point.x);
rectMax.y = std::max(rectMax.y, point.y);

View file

@ -2568,8 +2568,8 @@ void CPatchThread::run()
for (i = 0; i < AllFilesToPatch.size(); ++i)
{
CPatchManager::SFileToPatch &rFTP = AllFilesToPatch[i];
string ext = rFTP.FileName.substr(rFTP.FileName.rfind('.'), rFTP.FileName.size());
if (ext == ".ref")
string ext = NLMISC::CFile::getExtension(rFTP.FileName);
if (ext == "ref")
{
float oldCurrentFilePatched = CurrentFilePatched;
processFile (rFTP);
@ -2589,8 +2589,9 @@ void CPatchThread::run()
for (i = 0; i < AllFilesToPatch.size(); ++i)
{
CPatchManager::SFileToPatch &rFTP = AllFilesToPatch[i];
string ext = rFTP.FileName.substr(rFTP.FileName.rfind('.'), rFTP.FileName.size());
if (ext == ".bnp")
string ext = NLMISC::CFile::getExtension(rFTP.FileName);
if (ext == "bnp")
{
float oldCurrentFilePatched = CurrentFilePatched;
processFile (rFTP);

View file

@ -3904,7 +3904,7 @@ bool CUserEntity::canCastShadowMap() const
void CUserEntity::forceLookEntity(const NLMISC::CVectorD &dir2targIn, bool updateHeadPitch, bool /* start */)
{
CVectorD dir2targ= dir2targIn;
float frontYawBefore;
float frontYawBefore = 0.f;
float frontYawAfter;
// Third person: bkup current yaw

View file

@ -524,7 +524,7 @@ std::string CKeysHolder::getSignature(const std::string& md5, const std::string&
bool CKeysHolder::verifyKey(const std::string& md5, const std::string& signature)
{
std::string key = "";
std::string key;
if ( !signature.empty() )
{
@ -2787,7 +2787,7 @@ void CServerEditionModule::createSession(NLNET::IModuleProxy *sender, TCharId ow
TScenarioHeaderSerializer::TValueType::const_iterator first(values.begin()), last(values.end());
bool nevraxScenario = false;
bool trialAllowed = false;
std::string missionTag = "";
std::string missionTag;
for ( ; first != last; ++first)
@ -3834,7 +3834,7 @@ void CServerEditionModule::startScenario(NLNET::IModuleProxy *senderModuleProxy,
getAnimationModule()->scheduleStartSession(body);
bool trialAllowed = false;
bool nevraxScenario = false;
std::string missionTag = "";
std::string missionTag;
/*Informs EGS that the animation has started*/
if ( getLinkedSessionId(body.SessionId) == TSessionId(0) && session->getSessionType() == RSMGR::TSessionType::st_anim )

View file

@ -20,6 +20,8 @@
#include "nel/misc/smart_ptr.h"
//#include "ai_grp.h"
#include <limits>
namespace AIVM
{
@ -71,7 +73,7 @@ public:
class CByteCodeEntry {
public:
CByteCodeEntry()
: _Index(~0)
: _Index(std::numeric_limits<size_t>::max())
{
}
CByteCodeEntry(NLMISC::CSmartPtr<CByteCode const> code, size_t index)
@ -81,7 +83,7 @@ public:
}
bool isValid()const
{
return _Index!=~0;
return _Index != std::numeric_limits<size_t>::max();
}
NLMISC::CSmartPtr<CByteCode const>& code() { return _Code; }
size_t& index() { return _Index; }

View file

@ -50,6 +50,7 @@
#include <exception>
#include <utility>
#include <deque>
#include <limits>
//----------------------------------------------------------------

View file

@ -146,7 +146,8 @@ void CCDBSynchronised::read( const string& fileName )
// value
token = strtok(buffer," \t");
if( token == NULL ) continue;
sint64 value = atoi(token);
sint64 value;
NLMISC::fromString(token, value);
// property name
token = strtok(NULL," \n");

View file

@ -106,7 +106,7 @@ struct SOptions : public SExportOptions
string getStr (const string &var)
{
string ret = "";
string ret;
try
{
CConfigFile::CVar &cvString = cf.getVar (var);

View file

@ -41,7 +41,7 @@ FILTER(Money,"<min> [<max>]")
CSString s0= s.firstWord(true);
CSString s1= s.firstWord(true);
uint32 min= s0.atoi();
uint32 max= (s1.empty()? ~0u: s1.atoi());
uint32 max= (s1.empty()? std::numeric_limits<uint32>::max(): s1.atoi());
if ( (min==0 && s0!="0") || (max==0 && s1!="0") || !s.strip().empty() )
{
nlwarning("Bad arguments in filter: should be <min> [<max>]");