From 4aa2c68151b11cd3f295159a7e3e321e69c6b8b1 Mon Sep 17 00:00:00 2001 From: kervala Date: Tue, 31 May 2011 22:16:17 +0200 Subject: [PATCH] Changed: #878 Fix typos in comments/code --- code/nel/tools/misc/bnp_make/main.cpp | 1 + code/ryzom/client/src/entity_cl.cpp | 12 ++++++--- code/ryzom/client/src/init_main_loop.cpp | 3 ++- .../src/interface_v3/action_phrase_faber.cpp | 3 ++- .../src/interface_v3/people_interraction.cpp | 9 ++++--- .../client/src/interface_v3/people_list.cpp | 9 ++++--- code/ryzom/client/src/net_manager.cpp | 22 +++++++++++----- code/ryzom/client/src/user_entity.cpp | 3 ++- code/ryzom/common/src/game_share/object.cpp | 6 +++-- code/ryzom/common/src/game_share/object.h | 5 ++-- .../ai_service/ai_entity_physical_inline.h | 3 ++- .../server/src/ai_service/ai_generic_fight.h | 7 +++-- .../ai_service/ai_generic_fight_helpers.cpp | 11 +++++--- .../server/src/ai_service/ai_grp_npc.cpp | 9 ++++--- .../src/ai_service/nf_state_instance.cpp | 3 ++- .../server/src/ai_service/path_behaviors.h | 3 ++- .../server/src/ai_service/script_compiler.cpp | 26 +++++++++++++------ .../ryzom/server/src/ai_service/script_vm.cpp | 3 ++- .../server/src/ai_share/primitive_parser.cpp | 3 ++- .../src/entities_game_service/admin.cpp | 3 ++- .../outpost_manager/outpost_squad.cpp | 3 ++- code/ryzom/tools/translation_tools/main.cpp | 3 ++- 22 files changed, 101 insertions(+), 49 deletions(-) diff --git a/code/nel/tools/misc/bnp_make/main.cpp b/code/nel/tools/misc/bnp_make/main.cpp index cf0332d2a..48588d6cc 100644 --- a/code/nel/tools/misc/bnp_make/main.cpp +++ b/code/nel/tools/misc/bnp_make/main.cpp @@ -99,6 +99,7 @@ struct BNPHeader fclose(f); return false; } + for (uint32 i = 0; i < nNbFile; ++i) { uint8 nStringSize = (uint8)Files[i].Name.size(); diff --git a/code/ryzom/client/src/entity_cl.cpp b/code/ryzom/client/src/entity_cl.cpp index bc63d9d85..fbbe0c041 100644 --- a/code/ryzom/client/src/entity_cl.cpp +++ b/code/ryzom/client/src/entity_cl.cpp @@ -3064,7 +3064,8 @@ void CEntityCL::updateVisiblePostPos(const NLMISC::TTime &/* currentTimeInMs */, } } - if (!_StateFX.empty()) { + if (!_StateFX.empty()) + { // Build a matrix for the fx NLMISC::CMatrix mat; mat.identity(); @@ -3529,8 +3530,10 @@ CVector CEntityCL::dirToTarget() const //---------------------------------------------------------------------- void CEntityCL::setStateFx(const std::string &fxName) { - if (fxName != _StateFXName) { - if (!_StateFX.empty() && Scene) { + if (fxName != _StateFXName) + { + if (!_StateFX.empty() && Scene) + { Scene->deleteInstance(_StateFX); } @@ -3556,7 +3559,8 @@ void CEntityCL::setStateFx(const std::string &fxName) //---------------------------------------------------------------------- void CEntityCL::removeStateFx() { - if (!_StateFX.empty() && Scene) { + if (!_StateFX.empty() && Scene) + { Scene->deleteInstance(_StateFX); _StateFXName = ""; } diff --git a/code/ryzom/client/src/init_main_loop.cpp b/code/ryzom/client/src/init_main_loop.cpp index 9b37a1a53..e8c888030 100644 --- a/code/ryzom/client/src/init_main_loop.cpp +++ b/code/ryzom/client/src/init_main_loop.cpp @@ -187,7 +187,8 @@ struct CStatThread : public NLMISC::IRunnable { std::string chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; std::string s; - for (int i = 0; i < 32; i++) { + for (int i = 0; i < 32; i++) + { s += chars[uint(frand(float(chars.size())))]; } return s; diff --git a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp index 76b60ade1..53a1258bc 100644 --- a/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp +++ b/code/ryzom/client/src/interface_v3/action_phrase_faber.cpp @@ -1799,7 +1799,8 @@ void CActionPhraseFaber::updateItemResult() } /* Handle change of skill -> recompute success rate */ -void CActionPhraseFaber::CSkillObserver::onSkillChange() { +void CActionPhraseFaber::CSkillObserver::onSkillChange() +{ if (ActionPhraseFaber == NULL) ActionPhraseFaber = new CActionPhraseFaber; // Dont update if the plan has not yet been selected if(ActionPhraseFaber->_ExecuteFromItemPlanBrick==NULL) diff --git a/code/ryzom/client/src/interface_v3/people_interraction.cpp b/code/ryzom/client/src/interface_v3/people_interraction.cpp index 170d20ffd..218b1fd96 100644 --- a/code/ryzom/client/src/interface_v3/people_interraction.cpp +++ b/code/ryzom/client/src/interface_v3/people_interraction.cpp @@ -2277,7 +2277,8 @@ public: CPeopleList::TSortOrder order = (CPeopleList::TSortOrder)(pIM->getDbProp("UI:SAVE:CONTACT_LIST:SORT_ORDER")->getValue32()); order = (CPeopleList::TSortOrder)(order + 1); - if (order == CPeopleList::END_SORT_ORDER) { + if (order == CPeopleList::END_SORT_ORDER) + { order = CPeopleList::START_SORT_ORDER; } @@ -2654,8 +2655,10 @@ class CHandlerChatTargetSelected : public IActionHandler } else { - for (uint i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++) { - if (nlstricmp(sParams, "dyn"+toString("%d", i)) == 0) { + for (uint i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++) + { + if (nlstricmp(sParams, "dyn"+toString("%d", i)) == 0) + { cf.setTargetGroup(CChatGroup::dyn_chat, i); } } diff --git a/code/ryzom/client/src/interface_v3/people_list.cpp b/code/ryzom/client/src/interface_v3/people_list.cpp index cd3d75067..ac4764e15 100644 --- a/code/ryzom/client/src/interface_v3/people_list.cpp +++ b/code/ryzom/client/src/interface_v3/people_list.cpp @@ -207,12 +207,14 @@ bool CPeopleList::sortExByOnline(const CPeople& a, const CPeople& b) ucstring name_b = toUpper(b.getName()); // We want order: online/alpha, offworld/alpha, offline/alpha - if (a.Online == b.Online) { + if (a.Online == b.Online) + { return (name_a < name_b); } else { // Compare online status - switch (a.Online) { + switch (a.Online) + { case ccs_online: // a is > if a is online return true; @@ -244,7 +246,8 @@ void CPeopleList::sortEx(TSortOrder order) _BaseContainer->detachContainer(_Peoples[k].Container); } - switch (order) { + switch (order) + { default: case sort_index: std::sort(_Peoples.begin(), _Peoples.end(), CPeopleList::sortExByContactId); diff --git a/code/ryzom/client/src/net_manager.cpp b/code/ryzom/client/src/net_manager.cpp index 36a0767cd..85196bb2e 100644 --- a/code/ryzom/client/src/net_manager.cpp +++ b/code/ryzom/client/src/net_manager.cpp @@ -805,27 +805,35 @@ void CInterfaceChatDisplayer::displayChat(TDataSetIndex compressedSenderIndex, c else { ucstring::size_type index = finalString.find(ucstring("")); - if (index != ucstring::npos) { + if (index != ucstring::npos) + { bubbleWanted = false; finalString = finalString.substr(index+6,finalString.size()); ucstring::size_type index2 = finalString.find(ucstring(" ")); ucstring playerName; - if (index2 < (finalString.size()-3)) { + if (index2 < (finalString.size()-3)) + { playerName = finalString.substr(0,index2); finalString = finalString.substr(index2+1,finalString.size()); } if (!senderName.empty()) { CEntityCL *senderEntity = EntitiesMngr.getEntityByName (CEntityCL::removeTitleAndShardFromName(senderName), true, true); - if (senderEntity) { - if (senderEntity->Type != CEntityCL::Player) { - if (playerName.empty()) { + if (senderEntity) + { + if (senderEntity->Type != CEntityCL::Player) + { + if (playerName.empty()) + { senderEntity->removeStateFx(); senderEntity->setStateFx(finalString.toString()); nlinfo("empty"); - } else { + } + else + { CEntityCL *destEntity = EntitiesMngr.getEntityByName (CEntityCL::removeTitleAndShardFromName(playerName), false, true); - if (destEntity) { + if (destEntity) + { destEntity->removeStateFx(); destEntity->setStateFx(finalString.toString()); nlinfo("no empty"); diff --git a/code/ryzom/client/src/user_entity.cpp b/code/ryzom/client/src/user_entity.cpp index a5c016f34..64a493d2e 100644 --- a/code/ryzom/client/src/user_entity.cpp +++ b/code/ryzom/client/src/user_entity.cpp @@ -361,7 +361,8 @@ bool CUserEntity::build(const CEntitySheet *sheet) // virtual CInterfaceManager *pIM = CInterfaceManager::getInstance(); { CCDBNodeLeaf *node = pIM->getDbProp("SERVER:USER:IS_INVISIBLE", false); - if (node) { + if (node) + { ICDBNode::CTextId textId; node->addObserver(&_InvisibleObs, textId); } diff --git a/code/ryzom/common/src/game_share/object.cpp b/code/ryzom/common/src/game_share/object.cpp index d15497ce4..908cc6e2a 100644 --- a/code/ryzom/common/src/game_share/object.cpp +++ b/code/ryzom/common/src/game_share/object.cpp @@ -1288,7 +1288,8 @@ void CObjectTable::clear() CHECK_TABLE_INTEGRITY TContainer::iterator first(_Value.begin()); TContainer::iterator last(_Value.end()); - for (; first != last ;++first) { + for (; first != last ;++first) + { delete first->second; } _Value.clear(); @@ -3044,7 +3045,8 @@ void CObjectSerializerImpl::serialImpl(NLMISC::IStream& stream, CObject*& data, -- (serializer->Level); } uint endLength = stream.getPos(); - if (serializer->Log) { + if (serializer->Log) + { if (className.empty()) { nldebug("R2NET: (%u) Table sent %u bytes",serializer->Level, endLength - initLength); diff --git a/code/ryzom/common/src/game_share/object.h b/code/ryzom/common/src/game_share/object.h index 0f74d70fa..f4b292e2e 100644 --- a/code/ryzom/common/src/game_share/object.h +++ b/code/ryzom/common/src/game_share/object.h @@ -206,9 +206,8 @@ protected: uint32 _Validation; }; -/*inline std::ostream& operator<<( std::ostream& os, - const CObject& c ) { - +/*inline std::ostream& operator<<( std::ostream& os, const CObject& c ) +{ c.serialize(os); return os; }*/ 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 d14bc5d30..1814ee0be 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 @@ -413,7 +413,8 @@ void CTargetable::removeTargeter(TTargetType type, TPtr const& targeter) } NLMISC::CDbgPtr current = _FirstTargeters[type]; - while (!current.isNULL()) { + while (!current.isNULL()) + { NLMISC::CDbgPtr next = current->_NextTargeter; if (next == targeter) { diff --git a/code/ryzom/server/src/ai_service/ai_generic_fight.h b/code/ryzom/server/src/ai_service/ai_generic_fight.h index 60e2bd006..5a34f0e3f 100644 --- a/code/ryzom/server/src/ai_service/ai_generic_fight.h +++ b/code/ryzom/server/src/ai_service/ai_generic_fight.h @@ -37,7 +37,8 @@ extern float getDistBetWeen(CAIEntityPhysical& creat1, CAIEntityPhysical& creat2 template float buildDecalage(TVectorSrc const& src, TVectorDst const& dst, CAIVector* decalage) { - if (decalage!=NULL) { + if (decalage!=NULL) + { CAIVector& vect = *decalage; vect = dst; vect -= src; @@ -52,7 +53,9 @@ float buildDecalage(TVectorSrc const& src, TVectorDst const& dst, CAIVector* dec // End of hack float normXYZ = (float)sqrt(normXY*normXY + normZ*normZ); return normXYZ; - } else { + } + else + { CAIVector vect; return buildDecalage(src, dst, &vect); } diff --git a/code/ryzom/server/src/ai_service/ai_generic_fight_helpers.cpp b/code/ryzom/server/src/ai_service/ai_generic_fight_helpers.cpp index 3e166ddaa..7c6add3a8 100644 --- a/code/ryzom/server/src/ai_service/ai_generic_fight_helpers.cpp +++ b/code/ryzom/server/src/ai_service/ai_generic_fight_helpers.cpp @@ -261,13 +261,18 @@ static void s_calcRanges( _RangeMax = CBotProfileFightHeal::fightDefaultMaxRange; if (_UseFightConfig) { - if (useFightMelee && (useFightRange || useFightNuke || useFightHeal)) { + if (useFightMelee && (useFightRange || useFightNuke || useFightHeal)) + { _RangeMin = CBotProfileFightHeal::fightMixedMinRange; _RangeMax = CBotProfileFightHeal::fightMixedMaxRange; - } else if (useFightMelee) { + } + else if (useFightMelee) + { _RangeMin = CBotProfileFightHeal::fightMeleeMinRange; _RangeMax = CBotProfileFightHeal::fightMeleeMaxRange; - } else { + } + else + { _RangeMin = CBotProfileFightHeal::fightRangeMinRange; _RangeMax = CBotProfileFightHeal::fightRangeMaxRange; } diff --git a/code/ryzom/server/src/ai_service/ai_grp_npc.cpp b/code/ryzom/server/src/ai_service/ai_grp_npc.cpp index 5b3ffc35b..8dad00290 100644 --- a/code/ryzom/server/src/ai_service/ai_grp_npc.cpp +++ b/code/ryzom/server/src/ai_service/ai_grp_npc.cpp @@ -874,7 +874,8 @@ void CGroupNpc::delNamedEntityListener(std::string const& name, std::string cons last = _namedEntityListeners.upper_bound(std::make_pair(name, prop)); while (listener!=last) { - if (listener->second==event) { + if (listener->second==event) + { _namedEntityListeners.erase(listener); CNamedEntityManager::getInstance()->get(name).delListenerGroup(prop, this); break; @@ -896,7 +897,8 @@ void CGroupNpc::delNamedEntityListener(std::string const& name, std::string cons last = _namedEntityListeners2.upper_bound(std::make_pair(name, prop)); while (listener!=last) { - if (listener->second==functionName) { + if (listener->second==functionName) + { _namedEntityListeners2.erase(listener); CNamedEntityManager::getInstance()->get(name).delListenerGroup(prop, this); break; @@ -920,7 +922,8 @@ void CGroupNpc::namedEntityListenerCb(std::string const& name, std::string const std::queue listeners; for (listener2=first2; listener2!=last2; ++listener2) listeners.push(NLMISC::CStringMapper::map(listener2->second)); - while(!listeners.empty()) { + while(!listeners.empty()) + { callScriptCallBack(this, listeners.front()); listeners.pop(); } diff --git a/code/ryzom/server/src/ai_service/nf_state_instance.cpp b/code/ryzom/server/src/ai_service/nf_state_instance.cpp index c52acc7d8..dfc29a367 100644 --- a/code/ryzom/server/src/ai_service/nf_state_instance.cpp +++ b/code/ryzom/server/src/ai_service/nf_state_instance.cpp @@ -759,7 +759,8 @@ void loadFile_s_(CStateInstance* entity, CScriptStack& stack) NLMISC::CIFile file(NLMISC::CPath::lookup(fileName)); vector lines; - while (!file.eof()) { + while (!file.eof()) + { const size_t bufferSize = 4*1024; char buffer[bufferSize]; file.getline(buffer, bufferSize); diff --git a/code/ryzom/server/src/ai_service/path_behaviors.h b/code/ryzom/server/src/ai_service/path_behaviors.h index d0f8f0394..215e5b2e6 100644 --- a/code/ryzom/server/src/ai_service/path_behaviors.h +++ b/code/ryzom/server/src/ai_service/path_behaviors.h @@ -240,7 +240,8 @@ private: public: static std::string toString(TFollowReason reason, RYAI_MAP_CRUNCH::CWorldMap::TFindInsideAStarPathReason fIASPReason = RYAI_MAP_CRUNCH::CWorldMap::FIASPR_NO_REASON) { - switch (reason) { + switch (reason) + { case FNP_NOT_INITIALIZED: return "FOLLOW_NO_PATH::NOT_INITIALIZED"; case FNP_NO_INSIDE_ASTAR_PATH: diff --git a/code/ryzom/server/src/ai_service/script_compiler.cpp b/code/ryzom/server/src/ai_service/script_compiler.cpp index 824a0bc41..5194ca30f 100644 --- a/code/ryzom/server/src/ai_service/script_compiler.cpp +++ b/code/ryzom/server/src/ai_service/script_compiler.cpp @@ -895,7 +895,8 @@ CCompiler::CCompiler() const int bufferSize = 256; char buffer[bufferSize]; - while (!file.eof()) { + while (!file.eof()) + { file.getline(buffer, bufferSize); if (buffer[0]=='#' || buffer[0]=='\0') // Skip lines begining with a # and empty lines continue; @@ -905,12 +906,15 @@ CCompiler::CCompiler() string part1, part2, part3; string::size_type pos1 = line.find(sep1); - if (pos1!=string::npos) { + if (pos1!=string::npos) + { pos1+=sep1.size(); string::size_type pos2 = line.find(sep2, pos1); - if (pos2!=string::npos) { + if (pos2!=string::npos) + { pos2+=sep2.size(); - if (pos1!=string::npos && pos2!=string::npos) { + if (pos1!=string::npos && pos2!=string::npos) + { part1 = line.substr(0, pos1-sep1.size()); // begin to sep1 part2 = line.substr(pos1, pos2-pos1-sep2.size()); // sep1 to sep2 part3 = line.substr(pos2); // sep2 to end @@ -918,13 +922,19 @@ CCompiler::CCompiler() } } - if (part1.size()!=0 && part2.size()!=0 && part3.size()!=0) { - if (part1=="token") { + if (part1.size()!=0 && part2.size()!=0 && part3.size()!=0) + { + if (part1=="token") + { addToken(part2, part3); - } else if (part1=="rule") { + } + else if (part1=="rule") + { addRule(part2, part3); } - } else { + } + else + { nlwarning("Invalid script line: \"%s\"", line.c_str()); } } diff --git a/code/ryzom/server/src/ai_service/script_vm.cpp b/code/ryzom/server/src/ai_service/script_vm.cpp index 6755ba881..bf5363c5d 100644 --- a/code/ryzom/server/src/ai_service/script_vm.cpp +++ b/code/ryzom/server/src/ai_service/script_vm.cpp @@ -73,7 +73,8 @@ void CLibrary::addLib(std::string const& name, std::vector const& c void CLibrary::addLib(std::string const& name, NLMISC::CSmartPtr const& byteCode) { - if (byteCode==NULL) { + if (byteCode==NULL) + { nlwarning("Trying to register an empty library script."); return; } diff --git a/code/ryzom/server/src/ai_share/primitive_parser.cpp b/code/ryzom/server/src/ai_share/primitive_parser.cpp index caa38e3b5..60fc6d04a 100644 --- a/code/ryzom/server/src/ai_share/primitive_parser.cpp +++ b/code/ryzom/server/src/ai_share/primitive_parser.cpp @@ -3447,7 +3447,8 @@ static void parsePrimScript(const IPrimitive *prim, const std::string &mapName, std::vector::const_iterator it = pcode->begin(), itEnd = pcode->end(); code = *it; ++it; - for(; it!=itEnd; ++it) { + for(; it!=itEnd; ++it) + { code += "\n"; code += *it; } diff --git a/code/ryzom/server/src/entities_game_service/admin.cpp b/code/ryzom/server/src/entities_game_service/admin.cpp index 2db29018a..648cfe4dd 100644 --- a/code/ryzom/server/src/entities_game_service/admin.cpp +++ b/code/ryzom/server/src/entities_game_service/admin.cpp @@ -4699,7 +4699,8 @@ NLMISC_COMMAND (webExecCommand, "Execute a web command", " sendUrl(web_app_url+"&player_eid="+c->getId().toString()+"&event=failed&desc=bad_sheet", getSalt()); return false; } - } else if (command_args[1] == "bot_name") + } + else if (command_args[1] == "bot_name") { if (target.getType() == RYZOMID::player) { diff --git a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_squad.cpp b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_squad.cpp index 6b489ba62..6deb22c43 100644 --- a/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_squad.cpp +++ b/code/ryzom/server/src/entities_game_service/outpost_manager/outpost_squad.cpp @@ -105,7 +105,8 @@ void COutpostSquadDescriptor::init(NLMISC::CSheetId sheet, TAIAlias alias, const _Alias = alias; _Form = CSheets::getOutpostSquadForm(_Sheet); nlassertex(_Form, ("Squad sheet %s not found", _Sheet.toString().c_str())); -// if (!(_Form)) { +// if (!(_Form)) +// { // NLMISC::createDebug (); // NLMISC::AssertLog->setPosition (__LINE__, __FILE__, __FUNCTION__); // NLMISC::AssertLog->displayRawNL ("Squad sheet %s not found", _Sheet.toString().c_str()); // BUG with unsetPosition() called twice diff --git a/code/ryzom/tools/translation_tools/main.cpp b/code/ryzom/tools/translation_tools/main.cpp index 7f9edf891..458e20058 100644 --- a/code/ryzom/tools/translation_tools/main.cpp +++ b/code/ryzom/tools/translation_tools/main.cpp @@ -736,7 +736,8 @@ void cleanComment(const std::string & filename) else { ucstring::size_type commentEnd = text.find(ucstring("\n"), commentBegin); - if (commentEnd != ucstring::npos) { + if (commentEnd != ucstring::npos) + { commentEnd += 1; ucstring comment = text.substr(commentBegin, commentEnd - commentBegin); if (comment.find(ucstring("// HASH_VALUE")) != ucstring::npos