From c0c147af4e4f0aa0068de006ca838fcc03ac535b Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 23 Sep 2010 15:08:52 +0200 Subject: [PATCH] Changed: #825 Remove all warnings when compiling Ryzom (patch provided by abelgar) --- .../client/src/continent_manager_build.cpp | 2 +- .../server/src/ai_data_service/pacs_scan.cpp | 4 +-- .../server/src/ai_service/ai_entity_matrix.h | 4 +-- .../ai_service/ai_entity_physical_inline.h | 6 ++-- .../src/ai_service/ai_generic_fight.cpp | 18 ++++++---- .../server/src/ai_service/ai_profile_npc.cpp | 35 ++++++++++--------- .../server/src/ai_service/alias_tree_owner.h | 8 ++--- .../server/src/ai_service/continent_inline.h | 4 +-- code/ryzom/server/src/ai_service/mirrors.h | 2 +- .../server/src/ai_service/script_compiler.h | 8 ++--- code/ryzom/server/src/ai_service/script_vm.h | 4 +-- .../server/src/ai_service/state_instance.h | 2 +- code/ryzom/server/src/ai_share/ai_actions.h | 2 ++ .../server/src/ai_share/primitive_parser.cpp | 28 +++++++++++++-- code/ryzom/server/src/ai_share/world_map.cpp | 17 ++++++--- code/ryzom/server/src/ai_share/world_map.h | 10 +++--- .../src/gameplay_module_lib/module_parent.h | 4 +-- .../src/pd_lib/db_description_parser.cpp | 4 +++ code/ryzom/server/src/pd_lib/pd_messages.cpp | 4 +++ code/ryzom/server/src/pd_lib/pd_messages.h | 13 ++----- .../ryzom/server/src/pd_lib/pd_server_utils.h | 2 +- code/ryzom/server/src/pd_lib/pd_utils.h | 8 ++--- .../server/src/pd_lib/pds_table_buffer.h | 4 +-- .../server/src/server_share/basic_effect.h | 4 +-- .../src/server_share/msg_brick_service.h | 2 +- .../server/src/server_share/mysql_wrapper.h | 6 ++-- code/ryzom/tools/assoc_mem/brain.cpp | 4 +-- .../csv_transform/csv_transform.cpp | 2 +- .../leveldesign/icon_search/icon_search.cpp | 2 +- .../tools/leveldesign/uni_conv/uni_conv.cpp | 2 ++ code/ryzom/tools/pdr_util/pdr_util.cpp | 4 ++- .../ryzom/tools/server/ai_build_wmap/main.cpp | 19 ++++------ .../packed_world_builder.cpp | 8 +++-- 33 files changed, 142 insertions(+), 104 deletions(-) diff --git a/code/ryzom/client/src/continent_manager_build.cpp b/code/ryzom/client/src/continent_manager_build.cpp index 8d83de984..f1ba08f6e 100644 --- a/code/ryzom/client/src/continent_manager_build.cpp +++ b/code/ryzom/client/src/continent_manager_build.cpp @@ -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); diff --git a/code/ryzom/server/src/ai_data_service/pacs_scan.cpp b/code/ryzom/server/src/ai_data_service/pacs_scan.cpp index 6c3d2d79f..e03bd24ec 100644 --- a/code/ryzom/server/src/ai_data_service/pacs_scan.cpp +++ b/code/ryzom/server/src/ai_data_service/pacs_scan.cpp @@ -2130,8 +2130,8 @@ public: { uint8 *linePtr = lineBuffer; uint8 *linePtrHM = lineBufferHM; - uint8 pointBuffer; - uint8 pointBufferHM; + uint8 pointBuffer = 0; + uint8 pointBufferHM = 0; CMapPosition pos(scanpos); diff --git a/code/ryzom/server/src/ai_service/ai_entity_matrix.h b/code/ryzom/server/src/ai_service/ai_entity_matrix.h index 484cfcef7..723f31fd6 100644 --- a/code/ryzom/server/src/ai_service/ai_entity_matrix.h +++ b/code/ryzom/server/src/ai_service/ai_entity_matrix.h @@ -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 *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); diff --git a/code/ryzom/server/src/ai_service/ai_entity_physical_inline.h b/code/ryzom/server/src/ai_service/ai_entity_physical_inline.h index fbfbe2439..d14bc5d30 100644 --- a/code/ryzom/server/src/ai_service/ai_entity_physical_inline.h +++ b/code/ryzom/server/src/ai_service/ai_entity_physical_inline.h @@ -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(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) diff --git a/code/ryzom/server/src/ai_service/ai_generic_fight.cpp b/code/ryzom/server/src/ai_service/ai_generic_fight.cpp index 36559f8ad..9b0f94516 100644 --- a/code/ryzom/server/src/ai_service/ai_generic_fight.cpp +++ b/code/ryzom/server/src/ai_service/ai_generic_fight.cpp @@ -67,12 +67,12 @@ void CBotProfileFight::resumeProfile() CBotProfileFight::CBotProfileFight(CProfileOwner* owner, CAIEntityPhysical* ennemy) : CBotProfileFightHeal() -, _Ennemy(ennemy) , _Bot(NLMISC::safe_cast(owner)) +, _Ennemy(ennemy) , _PathPos(NLMISC::safe_cast(owner)->theta()) +, _PathCont(NLMISC::safe_cast(owner)->getAStarFlag()) , _RangeCalculated(false) , _SearchAlternativePath(false) -, _PathCont(NLMISC::safe_cast(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(owner)) , _PathPos(NLMISC::safe_cast(owner)->theta()) +, _PathCont(NLMISC::safe_cast(owner)->getAStarFlag()) +, _Row(row) , _RangeCalculated(false) , _SearchAlternativePath(false) -, _PathCont(NLMISC::safe_cast(owner)->getAStarFlag()) { } @@ -252,10 +252,10 @@ CBotProfileHeal::~CBotProfileHeal() CBotProfileFlee::CBotProfileFlee(CProfileOwner *owner) : CAIBaseProfile() -, _Bot(NLMISC::safe_cast(owner)) -, _PathPos(NLMISC::safe_cast(owner)->theta()) , _DenyFlags(NLMISC::safe_cast(owner)->getAStarFlag()) +, _PathPos(NLMISC::safe_cast(owner)->theta()) , _fightFleePathContainer(NLMISC::safe_cast(owner)->getAStarFlag()) +, _Bot(NLMISC::safe_cast(owner)) { } @@ -521,14 +521,20 @@ bool CFightOrganizer::reorganizeIteration(CBot* bot) if (!entity->isAlive()) { if (ai_profile_npc_VerboseLog) + { nldebug("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("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; } diff --git a/code/ryzom/server/src/ai_service/ai_profile_npc.cpp b/code/ryzom/server/src/ai_service/ai_profile_npc.cpp index 6ead1f837..a97beb24f 100644 --- a/code/ryzom/server/src/ai_service/ai_profile_npc.cpp +++ b/code/ryzom/server/src/ai_service/ai_profile_npc.cpp @@ -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( 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 &geometry,const TVerticalPos &verticalPos, bool dontSendEvent) : CMoveProfile(owner) -, _Geometry(&geometry) -, _GeometryComeFromState(false) -, _VerticalPos(verticalPos) , _PathCont(NLMISC::safe_cast(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 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(owner)) -, _PathPos(NLMISC::safe_cast(owner)->theta()) , _PathCont(NLMISC::safe_cast(owner)->getAStarFlag()) +, _PathPos(NLMISC::safe_cast(owner)->theta()) +, _Bot(NLMISC::safe_cast(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(other)._PathCont) +, _PathPos(const_cast(other)._PathPos._Angle) // Just to debug... , _Bot(const_cast(other)._Bot) +, _PathCont(const_cast(other)._PathCont) , _MaxWalkSpeed(FLT_MAX) , _MaxRunSpeed(FLT_MAX) -, _PathPos(const_cast(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(owner)->theta()) , _Bot(NLMISC::safe_cast(owner)) +, _PathCont(pathCont) , _MaxWalkSpeed(FLT_MAX) , _MaxRunSpeed(FLT_MAX) -, _PathPos(NLMISC::safe_cast(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) { } diff --git a/code/ryzom/server/src/ai_service/alias_tree_owner.h b/code/ryzom/server/src/ai_service/alias_tree_owner.h index 5ff125667..493b2ac18 100644 --- a/code/ryzom/server/src/ai_service/alias_tree_owner.h +++ b/code/ryzom/server/src/ai_service/alias_tree_owner.h @@ -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); } diff --git a/code/ryzom/server/src/ai_service/continent_inline.h b/code/ryzom/server/src/ai_service/continent_inline.h index e38493b23..13c31bca4 100644 --- a/code/ryzom/server/src/ai_service/continent_inline.h +++ b/code/ryzom/server/src/ai_service/continent_inline.h @@ -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) { } /* diff --git a/code/ryzom/server/src/ai_service/mirrors.h b/code/ryzom/server/src/ai_service/mirrors.h index 821be189c..3923146ac 100644 --- a/code/ryzom/server/src/ai_service/mirrors.h +++ b/code/ryzom/server/src/ai_service/mirrors.h @@ -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 ); diff --git a/code/ryzom/server/src/ai_service/script_compiler.h b/code/ryzom/server/src/ai_service/script_compiler.h index 763820da8..4cbf25124 100644 --- a/code/ryzom/server/src/ai_service/script_compiler.h +++ b/code/ryzom/server/src/ai_service/script_compiler.h @@ -344,14 +344,14 @@ CTokenTestResult::CTokenTestResult() } inline CTokenTestResult::CTokenTestResult(const NLMISC::CSmartPtr &codeNode) -: _codeNode(codeNode) -, _res(BRULE_VALID) +: _res(BRULE_VALID) +, _codeNode(codeNode) { } inline CTokenTestResult::CTokenTestResult(const NLMISC::CSmartPtr &codeNode, TBasicTokenTestRes res) -: _codeNode(codeNode) -, _res(res) +: _res(BRULE_VALID) +, _codeNode(codeNode) { } inline diff --git a/code/ryzom/server/src/ai_service/script_vm.h b/code/ryzom/server/src/ai_service/script_vm.h index 17020410c..6fc8a01f1 100644 --- a/code/ryzom/server/src/ai_service/script_vm.h +++ b/code/ryzom/server/src/ai_service/script_vm.h @@ -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 diff --git a/code/ryzom/server/src/ai_service/state_instance.h b/code/ryzom/server/src/ai_service/state_instance.h index 054d894c8..2310580e7 100644 --- a/code/ryzom/server/src/ai_service/state_instance.h +++ b/code/ryzom/server/src/ai_service/state_instance.h @@ -583,9 +583,9 @@ void CStateInstance::setNextPunctualState(CAIState* state) inline CPersistentStateInstance::CPersistentStateInstance(CStateMachine& reactionContainer) : CKeyWordOwner() +, CStateInstance(NULL) , _StartState() , _Container(reactionContainer) -, CStateInstance(NULL) { } diff --git a/code/ryzom/server/src/ai_share/ai_actions.h b/code/ryzom/server/src/ai_share/ai_actions.h index 6fb9f0a1d..08fac7b85 100644 --- a/code/ryzom/server/src/ai_share/ai_actions.h +++ b/code/ryzom/server/src/ai_share/ai_actions.h @@ -100,6 +100,7 @@ public: case TypeFloat: return NLMISC::toString(_f); // case TypeAliasTree: return _a->treeToString(); // case TypeEventTree: return _e->toString(); + default: break; } return ""; } @@ -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; } } diff --git a/code/ryzom/server/src/ai_share/primitive_parser.cpp b/code/ryzom/server/src/ai_share/primitive_parser.cpp index e6ce31008..1ca550ce0 100644 --- a/code/ryzom/server/src/ai_share/primitive_parser.cpp +++ b/code/ryzom/server/src/ai_share/primitive_parser.cpp @@ -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; igetNumChildren(); ++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 &basePrim = CPrimitiveCfg::getMap(args[0]); set filter(basePrim.begin(), basePrim.end()); - for ( uint i = 0; (sint)i &prims = CPrimitiveCfg::getMap(usedPrimitives.asString(i)); for (uint j=0; jgetCellLink(*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) { } diff --git a/code/ryzom/server/src/gameplay_module_lib/module_parent.h b/code/ryzom/server/src/gameplay_module_lib/module_parent.h index 0f6bac511..54f3eeaaf 100644 --- a/code/ryzom/server/src/gameplay_module_lib/module_parent.h +++ b/code/ryzom/server/src/gameplay_module_lib/module_parent.h @@ -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 diff --git a/code/ryzom/server/src/pd_lib/db_description_parser.cpp b/code/ryzom/server/src/pd_lib/db_description_parser.cpp index df3fae778..cc816bcf1 100644 --- a/code/ryzom/server/src/pd_lib/db_description_parser.cpp +++ b/code/ryzom/server/src/pd_lib/db_description_parser.cpp @@ -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; } } diff --git a/code/ryzom/server/src/pd_lib/pd_messages.cpp b/code/ryzom/server/src/pd_lib/pd_messages.cpp index df12f3018..db076950e 100644 --- a/code/ryzom/server/src/pd_lib/pd_messages.cpp +++ b/code/ryzom/server/src/pd_lib/pd_messages.cpp @@ -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"); diff --git a/code/ryzom/server/src/pd_lib/pd_messages.h b/code/ryzom/server/src/pd_lib/pd_messages.h index 30e469d8c..a923809d9 100644 --- a/code/ryzom/server/src/pd_lib/pd_messages.h +++ b/code/ryzom/server/src/pd_lib/pd_messages.h @@ -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; } diff --git a/code/ryzom/server/src/pd_lib/pd_server_utils.h b/code/ryzom/server/src/pd_lib/pd_server_utils.h index ec1df021a..f1dd71f0e 100644 --- a/code/ryzom/server/src/pd_lib/pd_server_utils.h +++ b/code/ryzom/server/src/pd_lib/pd_server_utils.h @@ -267,7 +267,7 @@ class CMixedStreamFile : public NLMISC::IStream public: /// Constructor - CMixedStreamFile() : _File(NULL), NLMISC::IStream(false) + CMixedStreamFile() : NLMISC::IStream(false), _File(NULL) { } diff --git a/code/ryzom/server/src/pd_lib/pd_utils.h b/code/ryzom/server/src/pd_lib/pd_utils.h index fbb869de6..886d367e5 100644 --- a/code/ryzom/server/src/pd_lib/pd_utils.h +++ b/code/ryzom/server/src/pd_lib/pd_utils.h @@ -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; diff --git a/code/ryzom/server/src/pd_lib/pds_table_buffer.h b/code/ryzom/server/src/pd_lib/pds_table_buffer.h index e74c1e91b..150ac73db 100644 --- a/code/ryzom/server/src/pd_lib/pds_table_buffer.h +++ b/code/ryzom/server/src/pd_lib/pds_table_buffer.h @@ -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 diff --git a/code/ryzom/server/src/server_share/basic_effect.h b/code/ryzom/server/src/server_share/basic_effect.h index b7b59c62d..75e6a4803 100644 --- a/code/ryzom/server/src/server_share/basic_effect.h +++ b/code/ryzom/server/src/server_share/basic_effect.h @@ -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 = ++_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) { } diff --git a/code/ryzom/server/src/server_share/msg_brick_service.h b/code/ryzom/server/src/server_share/msg_brick_service.h index 59ce7411c..098598647 100644 --- a/code/ryzom/server/src/server_share/msg_brick_service.h +++ b/code/ryzom/server/src/server_share/msg_brick_service.h @@ -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 () diff --git a/code/ryzom/server/src/server_share/mysql_wrapper.h b/code/ryzom/server/src/server_share/mysql_wrapper.h index 81fd9cc71..26fbc924b 100644 --- a/code/ryzom/server/src/server_share/mysql_wrapper.h +++ b/code/ryzom/server/src/server_share/mysql_wrapper.h @@ -121,9 +121,9 @@ namespace MSW CResultBase(MYSQL_RES *result) - : _Result(result), - _CurrentRow(NULL), - _FieldLength(NULL) + : _CurrentRow(NULL), + _FieldLength(NULL), + _Result(result) { } diff --git a/code/ryzom/tools/assoc_mem/brain.cpp b/code/ryzom/tools/assoc_mem/brain.cpp index 74b8a8953..711366043 100644 --- a/code/ryzom/tools/assoc_mem/brain.cpp +++ b/code/ryzom/tools/assoc_mem/brain.cpp @@ -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; @@ -152,4 +152,4 @@ void CBrain::addRecord(CRecord *record) _LastUpdate++; if ( _LastUpdate > _UpdateEvery ) build(); -} \ No newline at end of file +} diff --git a/code/ryzom/tools/leveldesign/csv_transform/csv_transform.cpp b/code/ryzom/tools/leveldesign/csv_transform/csv_transform.cpp index 220356c40..41dbc6b28 100644 --- a/code/ryzom/tools/leveldesign/csv_transform/csv_transform.cpp +++ b/code/ryzom/tools/leveldesign/csv_transform/csv_transform.cpp @@ -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) { } diff --git a/code/ryzom/tools/leveldesign/icon_search/icon_search.cpp b/code/ryzom/tools/leveldesign/icon_search/icon_search.cpp index 110f9b7c6..2e95ad694 100644 --- a/code/ryzom/tools/leveldesign/icon_search/icon_search.cpp +++ b/code/ryzom/tools/leveldesign/icon_search/icon_search.cpp @@ -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; isize(); ++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)isize(); ++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)isize(); ++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)isize(); ++i) + for (uint i=0; i < var->size(); ++i) commands.push_back(var->asString(i)); } - uint i; string cmd; - for (i=1; (sint)i &zoneNames, const { std::vector > 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 &zoneNames, const CIFile f; if (f.open(cacheFilename)) { - CPackedZoneBase *pb; + CPackedZoneBase *pb = NULL; f.serialPolyPtr(pb); packedZoneGrid(x, y) = pb; mustRebuild = false;