This commit is contained in:
Matt Raykowski 2010-09-24 08:51:18 -05:00
commit 85d2b3a159
66 changed files with 238 additions and 182 deletions

View file

@ -70,7 +70,6 @@ ENDMACRO(FIND_WWW_LIBRARY MYLIBRARY)
# we need to link them all manually
FIND_WWW_LIBRARY(LIBWWWAPP_LIBRARY wwwapp)
FIND_WWW_LIBRARY(LIBWWWCACHE_LIBRARY wwwcache)
FIND_WWW_LIBRARY(LIBWWWCORE_LIBRARY wwwcore)
FIND_WWW_LIBRARY(LIBWWWDIR_LIBRARY wwwdir)
FIND_WWW_LIBRARY(LIBWWWFILE_LIBRARY wwwfile)
@ -80,6 +79,7 @@ FIND_WWW_LIBRARY(LIBWWWHTML_LIBRARY wwwhtml)
FIND_WWW_LIBRARY(LIBWWWHTTP_LIBRARY wwwhttp)
FIND_WWW_LIBRARY(LIBWWWINIT_LIBRARY wwwinit)
FIND_WWW_LIBRARY(LIBWWWMIME_LIBRARY wwwmime)
FIND_WWW_LIBRARY(LIBWWWCACHE_LIBRARY wwwcache)
FIND_WWW_LIBRARY(LIBWWWMUX_LIBRARY wwwmux)
FIND_WWW_LIBRARY(LIBWWWNEWS_LIBRARY wwwnews)
FIND_WWW_LIBRARY(LIBWWWSTREAM_LIBRARY wwwstream)

View file

@ -226,6 +226,7 @@ public:
/// Returns the type of the atom. NULL otherwise.
virtual const class UType *getType () = 0;
/// Return true if the element is an atom
virtual bool isAtom () const = 0;

View file

@ -25,6 +25,7 @@
#include "nel/misc/o_xml.h"
#include "nel/misc/file.h"
#include "nel/misc/path.h"
#include <limits>
#include <vector>
#include <string>
@ -151,7 +152,7 @@ public:
_CurrentPrim(startPrim)
{
// mark the root node as non checked
_IndexStack.push_back(~0);
_IndexStack.push_back(std::numeric_limits<uint>::max());
}
/** Each call to this method will return a primitive pointer that match
@ -162,7 +163,7 @@ public:
{
while (!_IndexStack.empty())
{
if (_IndexStack.back() == ~0)
if (_IndexStack.back() == std::numeric_limits<uint>::max())
{
_IndexStack.back() = 0;
// we need to check the current node.
@ -178,7 +179,7 @@ public:
if (_CurrentPrim->getChild(child, _IndexStack.back()++))
{
// go down into this node
_IndexStack.push_back(~0);
_IndexStack.push_back(std::numeric_limits<uint>::max());
_CurrentPrim = child;
}
}

View file

@ -28,9 +28,6 @@
#include <queue>
#include <string>
using namespace std;
namespace NLNET {
@ -41,10 +38,10 @@ enum TNetworkEvent { Sending, Receiving, Connecting, ConnFailing, Accepting, Dis
/// TNetworkEvent -> string
string EventToString( TNetworkEvent e );
std::string EventToString( TNetworkEvent e );
/// string -> TNetworkEvent
TNetworkEvent StringToEvent( string& s );
TNetworkEvent StringToEvent( std::string& s );
/*
@ -65,7 +62,7 @@ struct TMessageRecord
nlassert( stream.stringMode() );
uint32 len;
string s_event;
std::string s_event;
stream.serial( UpdateCounter );
if ( stream.isReading() )
{

View file

@ -66,7 +66,6 @@ template <class T> bool check (T value)
void checkInts ()
{
checkInt (uint8, 0, 255, 1);
checkInt (sint8, -128, 127, 1);

View file

@ -48,7 +48,15 @@ NL_ADD_LIB_SUFFIX(nelmisc)
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
IF(WITH_PCH)
IF(WITH_STATIC)
# acemtp: it's because my gcc is too old and cannot optimize this file
# on old gcc used to compile static ryzom, if you compile rgba with full optim, there's a visual bug (blue people)
SET_SOURCE_FILES_PROPERTIES(rgba.cpp PROPERTIES COMPILE_FLAGS "-O0")
ENDIF(WITH_STATIC)
IF(WITH_PCH AND NOT WITH_STATIC)
# acemtp: it's because my gcc is too old and cannot optimize this file
# removed the pch or we cannot define -O0 for the rgba specificaly
ADD_NATIVE_PRECOMPILED_HEADER(nelmisc ${CMAKE_CURRENT_SOURCE_DIR}/stdmisc.h ${CMAKE_CURRENT_SOURCE_DIR}/stdmisc.cpp)
ENDIF(WITH_PCH)

View file

@ -3,18 +3,19 @@ FILE(GLOB HEADERS ../../../include/nel/sound/driver/*.h)
NL_TARGET_LIB(nelsnd_lowlevel ${HEADERS} ${SRC})
INCLUDE_DIRECTORIES(${OGG_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(nelsnd_lowlevel nelmisc ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY})
IF(WITH_STATIC)
# Add libogg dependency only if target is static because to libvorbisfile
TARGET_LINK_LIBRARIES(nelsnd_lowlevel ${OGG_LIBRARY})
ENDIF(WITH_STATIC)
INCLUDE_DIRECTORIES(${OGG_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(nelsnd_lowlevel nelmisc ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
SET_TARGET_PROPERTIES(nelsnd_lowlevel PROPERTIES LINK_INTERFACE_LIBRARIES "")
NL_DEFAULT_PROPS(nelsnd_lowlevel "NeL, Library: Sound Lowlevel")
NL_ADD_RUNTIME_FLAGS(nelsnd_lowlevel)
NL_ADD_STATIC_VID_DRIVERS(nelsnd_lowlevel)
NL_ADD_STATIC_SND_DRIVERS(nelsnd_lowlevel)
NL_ADD_LIB_SUFFIX(nelsnd_lowlevel)

View file

@ -66,6 +66,7 @@ void alExtInitDevice(ALCdevice *device)
}
}
#ifndef NL_STATIC
// EFX
if ((AlExtEfx = (alcIsExtensionPresent(device, "ALC_EXT_EFX") == ALC_TRUE)) == true)
{
@ -111,6 +112,7 @@ void alExtInitDevice(ALCdevice *device)
AlExtEfx = false;
}
}
#endif
}
#if EAX_AVAILABLE
@ -134,6 +136,7 @@ EAXGetBufferMode eaxGetBufferMode = NULL;
// ALC_EXT_EFX
bool AlExtEfx = false;
// effect objects
#ifndef NL_STATIC
LPALGENEFXOBJECTS alGenEffects = NULL;
LPALDELETEEFXOBJECTS alDeleteEffects = NULL;
LPALISEFXOBJECT alIsEffect = NULL;
@ -169,7 +172,7 @@ LPALGETEFXOBJECTI alGetAuxiliaryEffectSloti = NULL;
LPALGETEFXOBJECTIV alGetAuxiliaryEffectSlotiv = NULL;
LPALGETEFXOBJECTF alGetAuxiliaryEffectSlotf = NULL;
LPALGETEFXOBJECTFV alGetAuxiliaryEffectSlotfv = NULL;
#endif
}
/* end of file */

View file

@ -41,7 +41,11 @@ using namespace NLMISC;
# define NL_DSOUND_AVAILABLE 0
# define NL_XAUDIO2_AVAILABLE 0
#elif defined( NL_OS_UNIX )
#ifdef NL_STATIC
# define NL_FMOD_AVAILABLE 0
#else
# define NL_FMOD_AVAILABLE 1
#endif
# define NL_OPENAL_AVAILABLE 1
# define NL_DSOUND_AVAILABLE 0
# define NL_XAUDIO2_AVAILABLE 0

View file

@ -8,7 +8,6 @@ ELSE(WITH_LUA51)
ENDIF(WITH_LUA51)
FIND_PACKAGE(Luabind REQUIRED)
FIND_PACKAGE(CURL REQUIRED)
FIND_PACKAGE(OpenSSL REQUIRED)
FIND_PACKAGE(Libwww)
FIND_PACKAGE(ZLIB)
IF(NOT WIN32 AND NOT APPLE)
@ -26,7 +25,10 @@ IF(NOT WIN32)
ENDIF(NOT WIN32)
IF(WITH_STATIC)
FIND_PACKAGE(OpenSSL QUIET)
IF(OPENSSL_FOUND)
SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES})
ENDIF(OPENSSL_FOUND)
SET(CURL_DEFINITIONS -DCURL_STATICLIB)
ENDIF(WITH_STATIC)

View file

@ -78,7 +78,8 @@ TARGET_LINK_LIBRARIES(ryzom_client ${PLATFORM_LINKFLAGS}
${LUABIND_LIBRARIES}
${CURL_LIBRARIES}
${LIBWWW_LIBRARIES}
${SEVENZIP_LIBRARY})
${SEVENZIP_LIBRARY}
)
IF(NOT APPLE AND NOT WIN32)
TARGET_LINK_LIBRARIES(ryzom_client ${X11_LIBRARIES})

View file

@ -194,7 +194,7 @@ bool buildLMConts(const std::string &worldSheet, const std::string &primitivesPa
// get alias and region name
uint32 alias;
uint32 alias = 0;
string primName, primAlias;
vGenRes[i]->getPropertyByName("name", primName);

View file

@ -25,9 +25,6 @@
#include "nel/misc/mutex.h"
using namespace std;
using namespace NLMISC;
/**
* class used to display console text commands in the chat window
* \author Nicolas Brigand
@ -57,8 +54,8 @@ public:
/// Display the string to the chat window
virtual void doDisplay ( const NLMISC::CLog::TDisplayInfo& args, const char *message )
{
string temp = message;
string str;
std::string temp = message;
std::string str;
CInterfaceManager::TSystemInfoMode mode;
if (args.LogType == NLMISC::CLog::LOG_ERROR)
{

View file

@ -553,7 +553,7 @@ void CViewRenderer::drawQuad(sint layerId, const NLMISC::CQuadUV &quadUV, sint32
{
// Partially clipped (slowest case)
// Must do the clip manually
const uint maxNumCorners = 8;
static const uint maxNumCorners = 8;
//
static CVector outPos0[maxNumCorners];
static CUV outUV0[maxNumCorners];

View file

@ -9,7 +9,7 @@ LIST(REMOVE_ITEM PRIV_H ${CMAKE_CURRENT_SOURCE_DIR}/enum_template.h)
NL_TARGET_LIB(ryzom_gameshare ${SRC})
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${NEL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
TARGET_LINK_LIBRARIES(ryzom_gameshare nelmisc nelnet nelligo nelgeorges ${LIBXML2_LIBRARIES} ${ZLIB_LIBRARIES})
NL_DEFAULT_PROPS(ryzom_gameshare "Ryzom, Library: Game Share")
NL_ADD_RUNTIME_FLAGS(ryzom_gameshare)

View file

@ -2130,8 +2130,8 @@ public:
{
uint8 *linePtr = lineBuffer;
uint8 *linePtrHM = lineBufferHM;
uint8 pointBuffer;
uint8 pointBufferHM;
uint8 pointBuffer = 0;
uint8 pointBufferHM = 0;
CMapPosition pos(scanpos);

View file

@ -241,12 +241,12 @@ public:
{
public:
inline CCellTblIteratorLinear():
_matrix(NULL), _tbl(NULL), _x(0), _y(0), _runLengthRemaining(0)
_x(0), _y(0), _matrix(NULL), _tbl(NULL), _runLengthRemaining(0)
{
}
inline CCellTblIteratorLinear(const CAIEntityMatrix<T> *matrix,const CAIEntityMatrixIteratorTblLinear *tbl,const CAIVector &pos):
_matrix(matrix), _tbl(tbl), _x((uint16)pos.x().asInt16Meters()), _y((uint16)pos.y().asInt16Meters())
_x((uint16)pos.x().asInt16Meters()), _y((uint16)pos.y().asInt16Meters()), _matrix(matrix), _tbl(tbl)
{
#ifdef NL_DEBUG
nlassert(_tbl!=NULL);

View file

@ -41,15 +41,15 @@
inline
CAIEntityPhysical::CAIEntityPhysical(CPersistentOfPhysical& owner, TDataSetRow const& entityIndex, NLMISC::CEntityId const& id, float radius, uint32 level, RYAI_MAP_CRUNCH::TAStarFlag const& AStarFlags)
: CAIEntity()
, _dataSetRow(entityIndex)
, _pos(entityIndex)
, CSpawnable<CPersistentOfPhysical >(owner)
, _id(id)
, _pos(entityIndex)
, _dataSetRow(entityIndex)
, _Stuned(0)
, _Rooted(0)
, _Blinded(0)
, _Feared(0)
//, _UnreachableTarget((CAIEntityPhysical*)NULL)
, _id(id)
, _radius(radius)
, _food(_radius)
, _Level(level)

View file

@ -67,12 +67,12 @@ void CBotProfileFight::resumeProfile()
CBotProfileFight::CBotProfileFight(CProfileOwner* owner, CAIEntityPhysical* ennemy)
: CBotProfileFightHeal()
, _Ennemy(ennemy)
, _Bot(NLMISC::safe_cast<CSpawnBot*>(owner))
, _Ennemy(ennemy)
, _PathPos(NLMISC::safe_cast<CSpawnBot*>(owner)->theta())
, _PathCont(NLMISC::safe_cast<CSpawnBot*>(owner)->getAStarFlag())
, _RangeCalculated(false)
, _SearchAlternativePath(false)
, _PathCont(NLMISC::safe_cast<CSpawnBot*>(owner)->getAStarFlag())
{
#ifdef NL_DEBUG_PTR
_Bot.setData(this);
@ -226,12 +226,12 @@ void CBotProfileHeal::resumeProfile()
CBotProfileHeal::CBotProfileHeal(const TDataSetRow &row, CProfileOwner *owner)
: CBotProfileFightHeal()
, _Row(row)
, _Bot(NLMISC::safe_cast<CSpawnBot*>(owner))
, _PathPos(NLMISC::safe_cast<CSpawnBot*>(owner)->theta())
, _PathCont(NLMISC::safe_cast<CSpawnBot*>(owner)->getAStarFlag())
, _Row(row)
, _RangeCalculated(false)
, _SearchAlternativePath(false)
, _PathCont(NLMISC::safe_cast<CSpawnBot*>(owner)->getAStarFlag())
{
}
@ -252,10 +252,10 @@ CBotProfileHeal::~CBotProfileHeal()
CBotProfileFlee::CBotProfileFlee(CProfileOwner *owner)
: CAIBaseProfile()
, _Bot(NLMISC::safe_cast<CSpawnBot*>(owner))
, _PathPos(NLMISC::safe_cast<CSpawnBot*>(owner)->theta())
, _DenyFlags(NLMISC::safe_cast<CSpawnBot*>(owner)->getAStarFlag())
, _PathPos(NLMISC::safe_cast<CSpawnBot*>(owner)->theta())
, _fightFleePathContainer(NLMISC::safe_cast<CSpawnBot*>(owner)->getAStarFlag())
, _Bot(NLMISC::safe_cast<CSpawnBot*>(owner))
{
}
@ -521,14 +521,20 @@ bool CFightOrganizer::reorganizeIteration(CBot* bot)
if (!entity->isAlive())
{
if (ai_profile_npc_VerboseLog)
{
nldebug("<FIGHT>Entity %s have aggro for dead entity %s, forgetting it.", spawnBot->getEntityId().toString().c_str(), entity->getEntityId().toString().c_str());
}
spawnBot->forgetAggroFor(entity->dataSetRow());
continue;
}
if (!entity->isBotAttackable())
{
if (ai_profile_npc_VerboseLog)
{
nldebug("<FIGHT>Entity %s have aggro for non bot attackable entity %s, forgetting it.", spawnBot->getEntityId().toString().c_str(), entity->getEntityId().toString().c_str());
}
spawnBot->forgetAggroFor(entity->dataSetRow());
continue;
}

View file

@ -676,7 +676,8 @@ void CGrpProfileBandit::beginProfile()
else
{
// look for aggro range parameter or set a default value
float aggroRangeFloat;
float aggroRangeFloat = 0.f;
if (!_Grp->getProfileParameter("aggro range", aggroRangeFloat))
_AggroRange =static_cast<uint32>( CGrpProfileBanditFactory::getDefaultBanditAggroRange() );
else
@ -991,7 +992,7 @@ void CGrpProfileGuard::updateProfile(uint ticksSinceLastUpdate)
}
string s;
float f;
float f = 0.f;
if (_Grp->getProfileParameter("faction", s) && !s.empty())
{
factionIndex = CStaticFames::getInstance().getFactionIndex(s);
@ -1703,10 +1704,10 @@ CGrpProfileFollowRoute::CGrpProfileFollowRoute(CProfileOwner *owner)
CGrpProfileFollowRoute::CGrpProfileFollowRoute(CProfileOwner *owner,const std::vector<CShape::TPosition> &geometry,const TVerticalPos &verticalPos, bool dontSendEvent)
: CMoveProfile(owner)
, _Geometry(&geometry)
, _GeometryComeFromState(false)
, _VerticalPos(verticalPos)
, _PathCont(NLMISC::safe_cast<CSpawnGroup*>(owner)->getPersistent().getAStarFlag())
, _GeometryComeFromState(false)
, _Geometry(&geometry)
, _VerticalPos(verticalPos)
, _DontSendEvent(dontSendEvent)
{
PROFILE_LOG("group", "follow_route", "ctor2", "");
@ -2402,8 +2403,8 @@ std::string CGrpProfileIdle::getOneLineInfoString() const
CGrpProfileWander::CGrpProfileWander(CProfileOwner* owner, CNpcZone const* npcZone)
: CMoveProfile(owner)
, _NpcZone(npcZone)
, _Social(false)
, _NpcZone(npcZone)
{
PROFILE_LOG("group", "wander", "ctor", "");
_BotStandProfileType = BOT_STAND_AT_POS;
@ -2748,8 +2749,8 @@ std::string CGrpProfileWander::getOneLineInfoString() const
CGrpProfileWanderNoPrim::CGrpProfileWanderNoPrim(CProfileOwner* owner, NLMISC::CSmartPtr<CNpcZonePlaceNoPrim> const& npcZone)
: CMoveProfile(owner)
, _NpcZone(npcZone)
, _Social(false)
, _NpcZone(npcZone)
{
PROFILE_LOG("group", "wander", "ctor", "");
_BotStandProfileType = BOT_STAND_AT_POS;
@ -3043,10 +3044,10 @@ CGrpProfileStandAtStartPoint::CBotPositionner::CBotPositionner(RYAI_MAP_CRUNCH::
}
CGrpProfileStandAtStartPoint::CBotPositionner::CBotPositionner(TVerticalPos verticalPos, CAIPos position, RYAI_MAP_CRUNCH::TAStarFlag flag)
: _BotAtDest(false)
: _PathCont(flag)
, _Position(position)
, _VerticalPos(verticalPos)
, _PathCont(flag)
, _BotAtDest(false)
{
_PathCont.setDestination(verticalPos, position);
}
@ -4019,9 +4020,9 @@ CBotProfileMoveTo::CBotProfileMoveTo(AITYPES::TVerticalPos verticalPos, RYAI_MAP
: CAIBaseProfile()
, _VerticalPos(verticalPos)
, _Dest(dest)
, _Bot(NLMISC::safe_cast<CSpawnBotNpc*>(owner))
, _PathPos(NLMISC::safe_cast<CSpawnBotNpc*>(owner)->theta())
, _PathCont(NLMISC::safe_cast<CSpawnBotNpc*>(owner)->getAStarFlag())
, _PathPos(NLMISC::safe_cast<CSpawnBotNpc*>(owner)->theta())
, _Bot(NLMISC::safe_cast<CSpawnBotNpc*>(owner))
{
PROFILE_LOG("bot", "move_to", "ctor", "");
#ifdef NL_DEBUG_PTR
@ -4095,11 +4096,11 @@ std::string CBotProfileMoveTo::getOneLineInfoString() const
CBotProfileFollowPos::CBotProfileFollowPos(CBotProfileFollowPos const& other)
: CAIBaseProfile()
, _PathCont(const_cast<CBotProfileFollowPos&>(other)._PathCont)
, _PathPos(const_cast<CBotProfileFollowPos&>(other)._PathPos._Angle) // Just to debug...
, _Bot(const_cast<CBotProfileFollowPos&>(other)._Bot)
, _PathCont(const_cast<CBotProfileFollowPos&>(other)._PathCont)
, _MaxWalkSpeed(FLT_MAX)
, _MaxRunSpeed(FLT_MAX)
, _PathPos(const_cast<CBotProfileFollowPos&>(other)._PathPos._Angle) // Just to debug...
, _Stop(false)
{
PROFILE_LOG("bot", "follow_pos", "ctor", "");
@ -4110,11 +4111,11 @@ CBotProfileFollowPos::CBotProfileFollowPos(CBotProfileFollowPos const& other)
CBotProfileFollowPos::CBotProfileFollowPos(CPathCont* pathCont, CProfileOwner* owner)
: CAIBaseProfile()
, _PathCont(pathCont)
, _PathPos(NLMISC::safe_cast<CSpawnBotNpc*>(owner)->theta())
, _Bot(NLMISC::safe_cast<CSpawnBotNpc*>(owner))
, _PathCont(pathCont)
, _MaxWalkSpeed(FLT_MAX)
, _MaxRunSpeed(FLT_MAX)
, _PathPos(NLMISC::safe_cast<CSpawnBotNpc*>(owner)->theta())
, _Stop(false)
{
PROFILE_LOG("bot", "follow_pos", "ctor", "");
@ -4530,9 +4531,9 @@ CGrpProfileStandOnVertices::CBotPositionner::CBotPositionner(RYAI_MAP_CRUNCH::TA
}
CGrpProfileStandOnVertices::CBotPositionner::CBotPositionner(uint32 geomIndex, RYAI_MAP_CRUNCH::TAStarFlag flags)
: _BotAtDest(false)
: _PathCont(flags)
, _GeomIndex(geomIndex)
, _PathCont(flags)
, _BotAtDest(false)
{
}

View file

@ -143,9 +143,9 @@ bool CAliasTreeOwner::CAliasDiff::operator()(CAliasTreeOwner const* other) const
inline
CAliasTreeOwner::CAliasTreeOwner(CAIAliasDescriptionNode* aliasTree)
: _AliasTree(aliasTree)
, _Alias(0)
: _Alias(0)
, _Name(std::string())
, _AliasTree(aliasTree)
{
if (aliasTree)
{
@ -159,9 +159,9 @@ CAliasTreeOwner::CAliasTreeOwner(CAIAliasDescriptionNode* aliasTree)
inline
CAliasTreeOwner::CAliasTreeOwner(uint32 alias, std::string const& name)
: _AliasTree(NULL)
, _Alias(alias)
: _Alias(alias)
, _Name(name)
, _AliasTree(NULL)
{
CAliasTreeOwnerLocator::getInstance()->addEntity(_Alias, _Name, this);
}

View file

@ -126,8 +126,8 @@ bool CAICircle::isInside(V const& pos)
inline
CAabb::CAabb()
: _VMax(INT_MIN/CAICoord::UNITS_PER_METER, INT_MIN/CAICoord::UNITS_PER_METER)
, _VMin(INT_MAX/CAICoord::UNITS_PER_METER, INT_MAX/CAICoord::UNITS_PER_METER)
: _VMin(INT_MAX/CAICoord::UNITS_PER_METER, INT_MAX/CAICoord::UNITS_PER_METER)
, _VMax(INT_MIN/CAICoord::UNITS_PER_METER, INT_MIN/CAICoord::UNITS_PER_METER)
{
}
/*

View file

@ -494,7 +494,7 @@ TDataSetRow CMirrors::getDataSetRow( const NLMISC::CEntityId& entityId )
return DataSet->getDataSetRow( entityId );
}
const uint16 CMirrors::getTeamId(const TDataSetRow& entityIndex)
uint16 CMirrors::getTeamId(const TDataSetRow& entityIndex)
{
CMirrorPropValueRO<TYPE_TEAM_ID> value( *DataSet, entityIndex, DSPropertyTEAM_ID );
// if ( value()==0 )

View file

@ -50,7 +50,7 @@ public:
static bool exists( const TDataSetRow& entityIndex );
static const NLMISC::CEntityId& getEntityId( const TDataSetRow& entityIndex );
static TDataSetRow getDataSetRow( const NLMISC::CEntityId& entityId );
static const uint16 getTeamId(const TDataSetRow& entityIndex);
static uint16 getTeamId(const TDataSetRow& entityIndex);
static CAICoord x( const TDataSetRow& entityIndex );
static CAICoord y( const TDataSetRow& entityIndex );

View file

@ -344,14 +344,14 @@ CTokenTestResult::CTokenTestResult()
}
inline
CTokenTestResult::CTokenTestResult(const NLMISC::CSmartPtr<CCodeNode> &codeNode)
: _codeNode(codeNode)
, _res(BRULE_VALID)
: _res(BRULE_VALID)
, _codeNode(codeNode)
{
}
inline
CTokenTestResult::CTokenTestResult(const NLMISC::CSmartPtr<CCodeNode> &codeNode, TBasicTokenTestRes res)
: _codeNode(codeNode)
, _res(res)
: _res(BRULE_VALID)
, _codeNode(codeNode)
{
}
inline

View file

@ -556,10 +556,10 @@ inline
CStringSeparator::CStringSeparator(const std::string &str, const std::string &motif)
:_Index(0)
,_NewIndex(0)
,_Str(str)
,_Motif(motif)
,_Delta(0)
,_StartIndex(0)
,_Str(str)
,_Motif(motif)
{
}
inline

View file

@ -583,9 +583,9 @@ void CStateInstance::setNextPunctualState(CAIState* state)
inline
CPersistentStateInstance::CPersistentStateInstance(CStateMachine& reactionContainer)
: CKeyWordOwner()
, CStateInstance(NULL)
, _StartState()
, _Container(reactionContainer)
, CStateInstance(NULL)
{
}

View file

@ -100,6 +100,7 @@ public:
case TypeFloat: return NLMISC::toString(_f);
// case TypeAliasTree: return _a->treeToString();
// case TypeEventTree: return _e->toString();
default: break;
}
return "<Invalid Argument Type>";
}
@ -115,6 +116,7 @@ public:
case TypeFloat: f.serial(_f); break;
// case TypeAliasTree: f.serial(_a); break;
// case TypeEventTree: f.serial(_e); break;
default: break;
}
}

View file

@ -1313,7 +1313,7 @@ static void parsePrimGrpFaunaSpawn(const CAIAliasDescriptionNode *treeNode,const
// deal with the weight
std::string s;
uint32 weight;
uint32 weight = 0;
if (prim->getPropertyByName("weight",s))
{
weight=atoi(s.c_str());
@ -2409,7 +2409,9 @@ static void parsePrimDynNpcZoneShape(const CAIAliasDescriptionNode *aliasNode, c
static void parsePrimRoadTrigger(const CAIAliasDescriptionNode *aliasNode, const IPrimitive *prim)
{
CPrimVector t1, t2, sp;
float t1r, t2r, spr;
float t1r = 0.f;
float t2r = 0.f;
float spr = 0.f;
string s;
for (uint i=0; i<prim->getNumChildren(); ++i)
@ -2494,6 +2496,8 @@ static void parsePrimDynRoad(const CAIAliasDescriptionNode *aliasNode, const IPr
case AITypeRoadTrigger:
parsePrimRoadTrigger(nextTreeNode(aliasNode,child),child);
break;
default:
break;
}
}
}
@ -2527,6 +2531,8 @@ static void parsePrimGeomItems(const CAIAliasDescriptionNode *aliasNode, const I
case AITypeDynRoad:
parsePrimDynRoad(nextTreeNode(aliasNode,child),child);
break;
default:
break;
}
}
}
@ -2643,6 +2649,8 @@ static void parsePrimCellZones(const CAIAliasDescriptionNode *aliasNode, const I
case AITypeCellZone:
parsePrimCellZone(nextTreeNode(aliasNode,child),child);
break;
default:
break;
}
}
}
@ -2847,6 +2855,8 @@ static void parsePrimGroupTemplate(const CAIAliasDescriptionNode *aliasNode, con
}
break;
default:
break;
}
}
@ -2895,6 +2905,8 @@ static void parsePrimGroupFamilyProfileFaunaContent(const CAIAliasDescriptionNod
case AITypeGroupTemplateFauna:
parsePrimGroupTemplate(nextTreeNode(aliasNode,child),child,"C");
break;
default:
break;
}
}
@ -2942,6 +2954,8 @@ static void parsePrimGroupFamilyProfileTribeContent(const CAIAliasDescriptionNod
case AITypeGroupTemplateMultiLevel:
parsePrimGroupTemplate(nextTreeNode(aliasNode,child),child,"C");
break;
default:
break;
}
}
@ -2980,6 +2994,8 @@ static void parsePrimGroupFamilyProfileNpcContent(const CAIAliasDescriptionNode
case AITypeGroupTemplateMultiLevel:
parsePrimGroupTemplate(nextTreeNode(aliasNode,child),child,"C");
break;
default:
break;
}
}
@ -3047,6 +3063,8 @@ static void parsePrimGroupDescriptions(const CAIAliasDescriptionNode *aliasNode,
// case AITypeGroupFamilyProfileGeneric:
// parsePrimGroupFamilyProfileGeneric(nextTreeNode(aliasNode,child),child, GroupFamilyTribe);
// break;
default:
break;
}
}
}
@ -3354,6 +3372,8 @@ static void parsePrimDynSystem(const IPrimitive *prim, const std::string &mapNam
case AITypeOutpost:
parsePrimOutpost(child, mapName, filename);
break;
default:
break;
}
}
}
@ -3388,6 +3408,8 @@ static void parsePrimNogoPointList(const IPrimitive *prim, const std::string &ma
CAIActions::exec("SETNOGO", x, y);
}
break;
default:
break;
}
}
@ -4049,7 +4071,7 @@ NLMISC_COMMAND(loadMapsFromCommon,"load all primitive defined in usedPrimitives
const vector<string> &basePrim = CPrimitiveCfg::getMap(args[0]);
set<string> filter(basePrim.begin(), basePrim.end());
for ( uint i = 0; (sint)i<usedPrimitives.size(); ++i)
for ( uint i = 0; i < usedPrimitives.size(); ++i)
{
const vector<string> &prims = CPrimitiveCfg::getMap(usedPrimitives.asString(i));
for (uint j=0; j<prims.size(); ++j)

View file

@ -125,8 +125,8 @@ private:
inline
CAStarHeapNode::CAStarHeapNode(CTopology::TTopologyRef Ref, uint Father, float Distance, bool Open)
: _Ref(Ref)
, CABaseStarNode(Father, Distance, Open)
: CABaseStarNode(Father, Distance, Open)
, _Ref(Ref)
{
}
@ -197,7 +197,7 @@ class CInsideAStarHeapNode : public CABaseStarNode
public:
friend class CAStarNode;
explicit CInsideAStarHeapNode(const CAStarNode &node, uint Father, CDirection Direction, float Distance, bool Open) : _Node(node), _Direction(Direction), CABaseStarNode(Father,Distance,Open)
explicit CInsideAStarHeapNode(const CAStarNode &node, uint Father, CDirection Direction, float Distance, bool Open) : CABaseStarNode(Father,Distance,Open), _Direction(Direction), _Node(node)
{
}
@ -924,6 +924,9 @@ void CWorldMap::countCells(uint &compute, uint &white, uint &simple, uint &multi
}
return true;
}
break;
default:
break;
}
return false;
@ -1126,6 +1129,8 @@ void CWorldMap::countCells(uint &compute, uint &white, uint &simple, uint &multi
}
return false;
}
default:
break;
}
return false;
@ -1205,7 +1210,8 @@ void CWorldMap::countCells(uint &compute, uint &white, uint &simple, uint &multi
}
break;
}
default:
break;
}
return false;
}
@ -1319,7 +1325,8 @@ void CWorldMap::countCells(uint &compute, uint &white, uint &simple, uint &multi
temp.setPosS(pos);
return true;
}
default:
break;
}
return false;
}

View file

@ -1487,8 +1487,8 @@ uint32 CTopology::TTopologyId::getVal() const
inline
CTopology::TTopologyRef::TTopologyRef()
: _RootCell(NULL)
, TTopologyId()
: TTopologyId()
, _RootCell(NULL)
{
}
@ -2238,7 +2238,7 @@ private:
inline
CWhiteCell::CWhiteCell(CWorldMap const& worldMapPtr)
: _HeightMap(NULL), CRootCell(worldMapPtr)
: CRootCell(worldMapPtr), _HeightMap(NULL)
{
}
@ -3236,13 +3236,13 @@ public:
};
inline
CWorldPosition::CWorldPosition(const CRootCell *cell, const CMapPosition &pos, const CSlot &slot) : _RootCell(cell), CMapPosition(pos), CSlot(slot)
CWorldPosition::CWorldPosition(const CRootCell *cell, const CMapPosition &pos, const CSlot &slot) : CMapPosition(pos), CSlot(slot), _RootCell(cell)
{
_cellLinkage=_RootCell->getCellLink(*this);
}
inline
CWorldPosition::CWorldPosition(const CRootCell *cell, const CMapPosition &pos, const CSlot &slot,bool generationOnly) : _RootCell(cell), CMapPosition(pos), CSlot(slot)
CWorldPosition::CWorldPosition(const CRootCell *cell, const CMapPosition &pos, const CSlot &slot,bool generationOnly) : CMapPosition(pos), CSlot(slot), _RootCell(cell)
{
}

View file

@ -30,7 +30,7 @@
#include "phrase_manager/phrase_utilities_functions.h"
//#include "creature_manager/creature_manager.h"
using namespace std;
using namespace EFFECT_FAMILIES;
using namespace NLLIGO;
using namespace NLMISC;
@ -66,7 +66,7 @@ CPVPFactionRewardManager::CPVPFactionRewardManager()
//----------------------------------------------------------------------------
void CPVPFactionRewardManager::_BuildTotemBasesRec( const IPrimitive* prim,
map<CTotemBase*, set<string> >& neighboursNames,
std::map<CTotemBase*, set<string> >& neighboursNames,
map<std::string, CTotemBase*>& totemBasesPerName )
{
if ( !prim )

View file

@ -22,9 +22,6 @@
#include "nel/ligo/primitive.h"
#include "game_share/effect_families.h"
using namespace std;
using namespace EFFECT_FAMILIES;
class CCharacter;
class CSEffect;
class CTotemBase;
@ -52,7 +49,7 @@ class CPVPFactionRewardManager
{
DECLARE_PERSISTENCE_METHODS
public :
typedef vector<int> TPossessionsPerEffect;
typedef std::vector<int> TPossessionsPerEffect;
/// Totems levels with the number of totems needed to reach them
enum TotemLevel
@ -65,7 +62,7 @@ public :
};
/// Values of each effects
static sint32 EffectValues[ EndTotemEffects+1 ];
static sint32 EffectValues[ EFFECT_FAMILIES::EndTotemEffects+1 ];
/// Returns the totem base for a given region using its ID
const CTotemBase* getTotemBaseFromId( uint16 regionId ) { return _GetTotemBaseFromId( regionId ); }
@ -91,12 +88,12 @@ private :
/// Get the effects a character would get on a totem
void _GetTotemsEffectsRec( CCharacter* user, CTotemBase* pTotem,
vector<CSEffect*>& outEffects, vector<CTotemBase*>& processed );
std::vector<CSEffect*>& outEffects, std::vector<CTotemBase*>& processed );
/// Remove all totem effects from a given player
void _removeTotemsEffects( CCharacter* user );
/// Totem bases sorted by region
map<TAIAlias, CTotemBase*> _TotemBasesPerRegion;
std::map<TAIAlias, CTotemBase*> _TotemBasesPerRegion;
/// Number of totems
uint32 _NbTotems;
@ -106,8 +103,8 @@ private :
/// Build the totem bases using the a LIGO primitive
void _BuildTotemBasesRec( const NLLIGO::IPrimitive* prim,
map<CTotemBase*, std::set<std::string> >& neighboursNames,
map<std::string, CTotemBase*>& totemBasesPerName );
std::map<CTotemBase*, std::set<std::string> >& neighboursNames,
std::map<std::string, CTotemBase*>& totemBasesPerName );
/// Have the totem bases been setup ?
bool _InitDone;
@ -146,7 +143,7 @@ public :
bool destroyTotem( uint16 regionIndex, TDataSetRow killerRowId );
/// Get the list of reward effects for a character depending on its coordinates
vector<CSEffect*> getTotemsEffects( CCharacter* user, std::vector<CTotemBase*>& processed );
std::vector<CSEffect*> getTotemsEffects( CCharacter* user, std::vector<CTotemBase*>& processed );
/// Give totem rewards to a player
void giveTotemsEffects( CCharacter* user );
@ -176,7 +173,7 @@ public :
PVP_CLAN::TPVPClan getRegionOwner( uint16 regionId );
/// send event message to ai
void sendEventToAI( const CTotemBase * totem, const string& event );
void sendEventToAI( const CTotemBase * totem, const std::string& event );
/// send message when spire is attacked
void spireAttacked( CCharacter * actor, CCreature * spire );

View file

@ -26,6 +26,7 @@
#include "id_impulsions.h"
#include "uid_impulsions.h"
using namespace std;
using namespace NLMISC;
using namespace CLFECOMMON;

View file

@ -317,7 +317,7 @@ public:
/// Return the current maximum number of bits that can fit in the outbox
sint32 getCurrentThrottle() const
{
return min( (sint32)(_MaxOutboxSizeInBit*2-_BitBandwidthUsageAvg), (sint32)(_MaxOutboxSizeInBit*3/2) );
return std::min( (sint32)(_MaxOutboxSizeInBit*2-_BitBandwidthUsageAvg), (sint32)(_MaxOutboxSizeInBit*3/2) );
}
/// Update the average bits filled that determine the throttle
@ -364,7 +364,7 @@ public:
if ( _BitImpulsionUsageAvg < nominalBitSize )
availBitsize = nominalBitSize;
else
availBitsize = max( (sint32)0, nominalBitSize*2 - _BitImpulsionUsageAvg );
availBitsize = std::max( (sint32)0, nominalBitSize*2 - _BitImpulsionUsageAvg );
CMirrorPropValue<uint16> availableImpulseBitsize( TheDataset, _EntityIndex, DSFirstPropertyAvailableImpulseBitSize );
#ifdef NL_DEBUG
@ -402,16 +402,16 @@ public:
TUid Uid;
/// User name (put on the NeL Launcher, transmitted by the login system)
string UserName;
std::string UserName;
/// User privilege (put on the NeL Launcher, transmitted by the login system)
string UserPriv;
std::string UserPriv;
/// User extended data (put on the NeL Launcher, transmitted by the login system)
string UserExtended;
std::string UserExtended;
/// Language Id
string LanguageId;
std::string LanguageId;
/// Login cookie
NLNET::CLoginCookie LoginCookie;

View file

@ -32,6 +32,7 @@
#include <nel/misc/variable.h>
#endif
using namespace std;
using namespace CLFECOMMON;
using namespace NLMISC;
using namespace NLNET;

View file

@ -30,7 +30,6 @@
#include "client_id_lookup.h"
#include <list>
using namespace std;
extern bool verbosePacketLost;
@ -55,7 +54,7 @@ typedef std::list< std::pair<TClientId,uint8> > TClientsToRemove;
enum TBadMessageFormatType { InsufficientSize=1, NotSystemLoginCode=2, BadCookie=4, BadSystemCode=8, HackedSizeInBuffer=16, AccessClosed=32, IrrelevantSystemMessage=64, MalformedAction=128, UnknownExceptionType=256, UnknownFormatType=512, UnauthorizedCharacterSlot=1024 };
/// Return the string for the message invalidity reasons
string getBadMessageString( uint32 reasons );
std::string getBadMessageString( uint32 reasons );
/// Hacking description
struct THackingDesc
@ -121,7 +120,7 @@ public:
void release();
/// Add client
CClientHost *addClient( const NLNET::CInetAddress& addrfrom, TUid userId, const string &userName, const string &userPriv, const std::string & userExtended, const std::string & languageId, const NLNET::CLoginCookie &cookie, uint32 instanceId, uint8 authorisedCharSlot, bool sendCLConnect=true );
CClientHost *addClient( const NLNET::CInetAddress& addrfrom, TUid userId, const std::string &userName, const std::string &userPriv, const std::string & userExtended, const std::string & languageId, const NLNET::CLoginCookie &cookie, uint32 instanceId, uint8 authorisedCharSlot, bool sendCLConnect=true );
/// Add to the list of clients which will be removed by addr at the three cycles later (leaving the time to send an impulsion to the client)
void addToRemoveList( TClientId clientid ) { _ClientsToRemove.push_back( std::make_pair(clientid,3) ); }

View file

@ -30,7 +30,6 @@
#include "nel/net/udp_sock.h"
#include <vector>
using namespace std;
const uint32 MsgHeaderSize = 1;
@ -72,12 +71,12 @@ struct TReceivedMessage
uint32 userSize() { return (uint32)_Data.size() - MsgHeaderSize; }
/// Return the data vector (event type header byte + user data)
vector<uint8>& data() { return _Data; }
std::vector<uint8>& data() { return _Data; }
private:
/// One byte for event type (header), followed by user data
vector<uint8> _Data;
std::vector<uint8> _Data;
public:
@ -85,7 +84,7 @@ public:
NLNET::CInetAddress AddrFrom;
/// Placeholder vector for address info
vector<uint8> VAddrFrom;
std::vector<uint8> VAddrFrom;
};

View file

@ -61,6 +61,7 @@
# include <windows.h>
#endif // NL_OS_WINDOWS
using namespace std;
using namespace NLNET;
using namespace NLMISC;
using namespace CLFECOMMON;

View file

@ -83,7 +83,7 @@ void CProcessingSpreader::getProcessingBounds( THostMap::iterator& firstit, sint
}
sint maxNbClientsProcessedPerTick = MaxNbClients / ExecutionPeriod;
outerboundindex = firstindex + min( maxNbClientsProcessedPerTick, nbClients - firstindex );
outerboundindex = firstindex + std::min( maxNbClientsProcessedPerTick, nbClients - firstindex );
_ClientMapIndex = outerboundindex;
}

View file

@ -23,8 +23,8 @@
#include "module_core.h"
#include "module_utils.h"
class ::IModuleCore;
class ::IModule;
class IModuleCore;
class IModule;
/**
* A module parent is a class encapsulating the modules contained in a module core

View file

@ -418,6 +418,8 @@ bool CDBDescriptionParser::loadAttribute(xmlNodePtr node, CTableNode& table)
return false;
}
break;
default:
break;
}
return true;
@ -727,6 +729,8 @@ bool CDBDescriptionParser::buildColumns(uint tableIndex)
table.Columns.push_back(column);
}
break;
default:
break;
}
}

View file

@ -104,6 +104,8 @@ std::string CDbMessage::buildLogString(const CDBDescriptionParser& description)
else if (typenode.ByteSize == 4) result += NLMISC::toString(*(uint32*)dataptr);
}
break;
default:
break;
}
}
}
@ -166,6 +168,8 @@ void CDbMessage::getHRContent(const CDBDescriptionParser& description, std::stri
else if (column.ByteSize == 4) strValue = NLMISC::toString(asUint32());
}
break;
default:
break;
}
result = NLMISC::toString("%-12s: ", "UpdateValue");

View file

@ -1016,7 +1016,7 @@ class CUpdateLog
{
public:
CUpdateLog() : UpdateId(0xffffffff), _Updates(NULL), _OwnUpdates(false) { }
CUpdateLog() : UpdateId(0xffffffff), _OwnUpdates(false), _Updates(NULL) { }
~CUpdateLog();
@ -1373,12 +1373,6 @@ inline uint32 CDbMessage::getMessageHeaderSize()
size += sizeof(_Value3[0]);
break;
case AddString:
break;
case UnmapString:
break;
case ReleaseRow:
size += sizeof(_ObjectIndex.Table)+sizeof(_ObjectIndex.Row);
break;
@ -1388,10 +1382,7 @@ inline uint32 CDbMessage::getMessageHeaderSize()
size += 2;
break;
case PushContext:
break;
case PopContext:
default:
break;
}

View file

@ -267,7 +267,7 @@ class CMixedStreamFile : public NLMISC::IStream
public:
/// Constructor
CMixedStreamFile() : _File(NULL), NLMISC::IStream(false)
CMixedStreamFile() : NLMISC::IStream(false), _File(NULL)
{
}

View file

@ -157,7 +157,7 @@ class CObjectIndex
public:
/// Constructor of invalid index
explicit CObjectIndex(bool validateChecksum = false) : _Table(INVALID_TABLE_INDEX), _Row(INVALID_ROW_INDEX), _Checksum((TIndexChecksum)~VALID_INDEX_CHECKSUM)
explicit CObjectIndex(bool validateChecksum = false) : _Row(INVALID_ROW_INDEX), _Table(INVALID_TABLE_INDEX), _Checksum((TIndexChecksum)~VALID_INDEX_CHECKSUM)
{
if (validateChecksum)
validate();
@ -166,7 +166,7 @@ public:
}
/// Constructor
CObjectIndex(TTableIndex table, TRowIndex row) : _Table(table), _Row(row) { validate(); }
CObjectIndex(TTableIndex table, TRowIndex row) : _Row(row), _Table(table) { validate(); }
/// Constructor
CObjectIndex(const CObjectIndex &index) { *this = index; }
@ -397,13 +397,13 @@ public:
/// Constructor
explicit CColumnIndex(TTableIndex table = INVALID_TABLE_INDEX, TRowIndex row = INVALID_ROW_INDEX, TColumnIndex column = INVALID_COLUMN_INDEX)
: _Table(table), _Row(row), _Column(column)
: _Table(table), _Column(column), _Row(row)
{
}
/// Constructor
explicit CColumnIndex(const CObjectIndex& object, TColumnIndex column)
: _Table(INVALID_TABLE_INDEX), _Row(INVALID_ROW_INDEX), _Column(INVALID_COLUMN_INDEX)
: _Table(INVALID_TABLE_INDEX), _Column(INVALID_COLUMN_INDEX), _Row(INVALID_ROW_INDEX)
{
if (!object.isValid())
return;

View file

@ -81,7 +81,7 @@ public:
TRowData data() { return (*_MapIt).second + (_Mapped ? sizeof(CMappedHeader) : sizeof(CHeader)); }
/// Get row data
const TRowData data() const { return (*_MapIt).second + (_Mapped ? sizeof(CMappedHeader) : sizeof(CHeader)); }
TRowData data() const { return (*_MapIt).second + (_Mapped ? sizeof(CMappedHeader) : sizeof(CHeader)); }
/// Default Constructor, should never be used
explicit CAccessor() { }
@ -104,7 +104,7 @@ public:
uint64 key() const { return mapped() ? ((CMappedHeader*)fullRow())->getKey() : 0; }
/// Get Full Row Data
const TRowData fullRow() const { return (*_MapIt).second; }
TRowData fullRow() const { return (*_MapIt).second; }
/// Equals

View file

@ -35,13 +35,13 @@ class CBasicEffect
public:
/// Constructor
CBasicEffect(EFFECT_FAMILIES::TEffectFamily family, const TDataSetRow & creatorId, const TDataSetRow & targetRowId)
: _Family(family), _CreatorRowId(creatorId), _TargetRowId(targetRowId)
: _CreatorRowId(creatorId), _TargetRowId(targetRowId), _Family(family), _EffectId(0)
{
_EffectId = ++_EffectCounter;
}
CBasicEffect( EFFECT_FAMILIES::TEffectFamily family, const TDataSetRow & creatorId, const TDataSetRow & targetRowId, uint32 effectId )
: _Family(family), _CreatorRowId(creatorId), _TargetRowId(targetRowId), _EffectId(effectId)
: _CreatorRowId(creatorId), _TargetRowId(targetRowId), _Family(family), _EffectId(effectId)
{
}

View file

@ -119,7 +119,7 @@ public:
uint8 Index; // index of the phrase in the player memorized phrase interface if != 0xff
CEGSExecuteMsg() : Index(0xff), Cyclic(false)
CEGSExecuteMsg() : Cyclic(false), Index(0xff)
{}
virtual void description ()

View file

@ -121,9 +121,9 @@ namespace MSW
CResultBase(MYSQL_RES *result)
: _Result(result),
_CurrentRow(NULL),
_FieldLength(NULL)
: _CurrentRow(NULL),
_FieldLength(NULL),
_Result(result)
{
}

View file

@ -26,7 +26,7 @@ CBrain::CBrain(CMood &personality) : CMood(personality)
_UpdateEvery = 0;
}
CBrain::CBrain(const CBrain &c)
CBrain::CBrain(const CBrain &c) : CMood()
{
_Personality = c._Personality;
_RealTime = c._RealTime;

View file

@ -95,7 +95,7 @@ private:
enum { DEFAULT, PARA, HEADER, FOOTER, FILE_HEADER, FILE_FOOTER, TBL, TABTBL, TEXT } mode;
public:
CCruncher(): mode(DEFAULT), firstTblLine(true)
CCruncher(): firstTblLine(true), readColumnName(false), mode(DEFAULT)
{
}

View file

@ -220,7 +220,7 @@ void ProcessDirectory( const CSString& dir, const StringVector& extensions )
sixieme = (int)files.size() / 6;
printf( "%d files are processed", files.size() );
printf( "%u files are processed", (uint) files.size() );
for (uint32 i=0; i<files.size(); ++i)
{

View file

@ -77,7 +77,7 @@ using namespace NLLIGO;
#define BAR_LENGTH 21
char *progressbar[BAR_LENGTH]=
const char *progressbar[BAR_LENGTH]=
{
"[ ]",
"[. ]",

View file

@ -126,6 +126,8 @@ int main(int argc, char *argv[])
fclose(fp);
}
break;
default:
break;
}
}

View file

@ -32,14 +32,16 @@ int main(int argc, char **argv)
uint arg;
for (arg=1; (sint)arg<argc; ++arg)
{
if (argv[arg] == "-hauto")
if (strcmp(argv[arg], "-hauto") == 0)
{
GenerateHAuto = true;
else if (argv[arg] == "-dbgmsg")
}
else if (strcmp(argv[arg], "-dbgmsg") == 0)
{
VerboseMode = true;
GenerateDebugMessages = true;
}
else if (argv[arg] == "-onlylogs")
else if (strcmp(argv[arg], "-onlylogs") == 0)
{
GenerateOnlyLogs = true;
}

View file

@ -689,9 +689,9 @@ public:
IsRef(false),
IsType(false),
IsKey(false),
Id(0),
Column(-1),
Columns(-1),
Id(0)
Columns(-1)
{
}

View file

@ -149,7 +149,7 @@ int main(int argc, char *argv[])
CSheetId::init(false);
for(int f = 0; f < filenames.size(); f++)
for(uint f = 0; f < filenames.size(); f++)
{
fileName = filenames[f];
@ -278,6 +278,8 @@ int main(int argc, char *argv[])
if (!pdr.writeToTxtFile(outputFileName.c_str(), CPersistentDataRecord::LINES_STRING))
goto failureWrite;
break;
default:
break;
}
// return 0;

View file

@ -45,24 +45,21 @@ sint main(sint argc, char **argv)
var = cf.getVarPtr("Paths");
if (var != NULL)
{
uint i;
for (i=0; (sint)i<var->size(); ++i)
for (uint i=0; i < var->size(); ++i)
LookupPath.push_back(var->asString(i));
}
var = cf.getVarPtr("NoRecursePaths");
if (var != NULL)
{
uint i;
for (i=0; (sint)i<var->size(); ++i)
for (uint i=0; i < var->size(); ++i)
LookupNoRecursePath.push_back(var->asString(i));
}
var = cf.getVarPtr("PacsPrimPaths");
if (var != NULL)
{
uint i;
for (i=0; (sint)i<var->size(); ++i)
for (uint i=0; i < var->size(); ++i)
PacsPrimPath.push_back(var->asString(i));
}
@ -77,14 +74,12 @@ sint main(sint argc, char **argv)
var = cf.getVarPtr("Commands");
if (var != NULL)
{
uint i;
for (i=0; (sint)i<var->size(); ++i)
for (uint i=0; i < var->size(); ++i)
commands.push_back(var->asString(i));
}
uint i;
string cmd;
for (i=1; (sint)i<argc; ++i)
for (sint i=1; i < argc; ++i)
{
if (string(argv[i]) == string("-"))
{
@ -108,7 +103,7 @@ sint main(sint argc, char **argv)
NLMISC::createDebug ();
nlinfo("Running commands:");
for (i=0; i<commands.size(); ++i)
for (uint i=0; i<commands.size(); ++i)
ICommand::execute(commands[i], *InfoLog);
return 0;

View file

@ -101,8 +101,10 @@ void CPackedWorldBuilder::build(const std::vector<std::string> &zoneNames, const
{
std::vector<CSmartPtr<CZoneRefCount> > zones;
zones.reserve(zoneNames.size());
sint zoneMinX, zoneMaxX;
sint zoneMinY, zoneMaxY;
sint zoneMinX = 0;
sint zoneMaxX = 0;
sint zoneMinY = 0;
sint zoneMaxY = 0;
bool firstZoneCorner = true;
for(uint k = 0; k < zoneNames.size(); ++k)
{
@ -252,7 +254,7 @@ void CPackedWorldBuilder::build(const std::vector<std::string> &zoneNames, const
CIFile f;
if (f.open(cacheFilename))
{
CPackedZoneBase *pb;
CPackedZoneBase *pb = NULL;
f.serialPolyPtr(pb);
packedZoneGrid(x, y) = pb;
mustRebuild = false;

View file

@ -14,7 +14,8 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
/*#include "std_header.h"
#if 0
#include "std_header.h"
//
#include "village.h"
#include "zone_util.h"
@ -300,6 +301,4 @@ void CIGInfo::load(TShapeCache &shapeCache)
}
}
*/
#endif

View file

@ -272,8 +272,9 @@ int extractBotNames(int argc, char *argv[])
//-------------------------------------------------------------------
// init the sheets
CSheetId::init(false);
char *PACKED_SHEETS_NAME = "bin/translation_tools_creature.packed_sheets";
const string PACKED_SHEETS_NAME = "bin/translation_tools_creature.packed_sheets";
loadForm("creature", PACKED_SHEETS_NAME, Creatures, false, false);
if (Creatures.empty())
{
for (uint i=0;i<georgesPaths.size();++i)

View file

@ -198,7 +198,8 @@ void extractNewWords(string workSheetFileName, string columnId, IWordListBuilder
return;
}
// get the key column index
uint keyColIndex;
uint keyColIndex = 0;
if(!workSheet.findCol(columnId, keyColIndex))
{
nlwarning("Error: Don't find the column '%s'. '%s' Aborted", columnId.c_str(), workSheetFileName.c_str());

View file

@ -313,7 +313,8 @@ int readLanguages()
LOG("Error : the file languages.txt is empty !\n");
return 1;
}
LOG("Found %u language code\n", Languages.size());
LOG("Found %u language code\n", (uint) Languages.size());
return 0;
}
@ -1378,7 +1379,7 @@ bool mergeWorksheetDiff(const std::string filename, TWorksheet &sheet, bool only
return false;
makeHashCode(diff, false);
uint cmdCol;
uint cmdCol = 0;
if (!diff.findCol(ucstring("DIFF_CMD"), cmdCol))
{
LOG("Can't find DIFF_CMD column in %s ! Invalid diff file.\n", CFile::getFilename(fileList[i]).c_str());
@ -1490,7 +1491,7 @@ public:
TWorksheet::TRow row(context.Reference.ColCount+1);
for (uint j=0; j<context.Addition.ColCount; ++j)
{
uint colIndex;
uint colIndex = 0;
if (context.Reference.findCol(context.Addition.Data[0][j], colIndex))
{
row[colIndex+1] = context.Addition.Data[addIndex][j];
@ -1508,7 +1509,7 @@ public:
TWorksheet::TRow row(context.Reference.ColCount+1);
for (uint j=0; j<context.Reference.ColCount; ++j)
{
uint colIndex;
uint colIndex = 0;
if (context.Reference.findCol(context.Reference.Data[0][j], colIndex))
{
row[colIndex+1] = context.Reference.Data[refIndex][j];
@ -1527,15 +1528,17 @@ public:
// copy the old content (this fill data in column that don't exist in addition worksheet)
row = context.Reference.Data[refIndex];
row.insert(row.begin(), ucstring());
// changed element
for (uint j=0; j<context.Addition.ColCount; ++j)
{
uint colIndex;
uint colIndex = 0;
if (context.Reference.findCol(context.Addition.Data[0][j], colIndex))
{
row[colIndex+1] = context.Addition.Data[addIndex][j];
}
}
char temp[1024];
sprintf(temp, "DIFF CHANGED %u ", addIndex);
row[0] = temp;
@ -3144,7 +3147,7 @@ int main(int argc, char *argv[])
// create the diff version.
char temp[1024];
sprintf(temp, "%8.8X", ::time(NULL));
sprintf(temp, "%8.8X", (uint) ::time(NULL));
diffVersion = temp;
if (strcmp(argv[1], "make_work") == 0)