From af1962ee0c01d50eacac8fa0491dc5e94f6fec27 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 13 Dec 2015 15:25:28 +0100 Subject: [PATCH] Fixed: Clang warnings --- .../include/nel/gui/group_container_base.h | 12 +++---- code/nel/include/nel/gui/interface_element.h | 6 ++-- code/nel/include/nel/misc/types_nl.h | 2 +- code/nel/src/misc/bitmap_gif.cpp | 6 ++-- code/ryzom/client/src/r2/auto_group.cpp | 8 ++--- .../r2/displayer_visual_activity_sequence.cpp | 4 +-- .../client/src/r2/displayer_visual_entity.cpp | 2 +- .../client/src/r2/displayer_visual_group.cpp | 2 +- .../client/src/r2/dmc/com_lua_module.cpp | 4 +-- code/ryzom/client/src/r2/editor.cpp | 20 ++++++------ code/ryzom/client/src/r2/instance.cpp | 4 +-- .../client/src/r2/object_factory_client.cpp | 10 +++--- .../common/src/game_share/crypt_sha512.cpp | 27 +++++++++++++--- .../common/src/game_share/mirror_prop_value.h | 10 +++--- code/ryzom/common/src/game_share/object.cpp | 32 +++++++++---------- code/ryzom/common/src/game_share/object.h | 4 +-- .../common/src/game_share/ring_access.cpp | 6 ++-- code/ryzom/common/src/game_share/scenario.cpp | 6 ++-- .../game_share/server_animation_module.cpp | 28 ++++++++-------- .../src/game_share/server_edition_module.cpp | 8 ++--- .../src/game_share/small_string_manager.cpp | 4 +-- .../src/game_share/string_mgr_module.cpp | 2 +- 22 files changed, 113 insertions(+), 94 deletions(-) diff --git a/code/nel/include/nel/gui/group_container_base.h b/code/nel/include/nel/gui/group_container_base.h index 3e9d1c8bf..6aa7425b7 100644 --- a/code/nel/include/nel/gui/group_container_base.h +++ b/code/nel/include/nel/gui/group_container_base.h @@ -82,13 +82,13 @@ namespace NLGUI // Get the header color draw. NB: depends if grayed, and if active. virtual NLMISC::CRGBA getDrawnHeaderColor () const{ return NLMISC::CRGBA(); }; - uint8 getCurrentContainerAlpha() const{ return _CurrentContainerAlpha; } - uint8 getCurrentContentAlpha() const{ return _CurrentContentAlpha; } + uint8 getCurrentContainerAlpha() const { return _CurrentContainerAlpha; } + uint8 getCurrentContentAlpha() const { return _CurrentContentAlpha; } - virtual bool isGrayed() const{ return false; } - virtual bool getTouchFlag(bool clearFlag) const{ return false; } - virtual void backupPosition(){} - virtual void restorePosition(){} + virtual bool isGrayed() const { return false; } + virtual bool getTouchFlag(bool /* clearFlag */) const { return false; } + virtual void backupPosition() {} + virtual void restorePosition() {} protected: void triggerAlphaSettingsChangedAH(); diff --git a/code/nel/include/nel/gui/interface_element.h b/code/nel/include/nel/gui/interface_element.h index e2f9ffc87..65a0fcaff 100644 --- a/code/nel/include/nel/gui/interface_element.h +++ b/code/nel/include/nel/gui/interface_element.h @@ -74,9 +74,9 @@ namespace NLGUI class IDeletionWatcher { public: - IDeletionWatcher(){} - virtual ~IDeletionWatcher(){} - virtual void onDeleted( const std::string &name ){} + IDeletionWatcher() {} + virtual ~IDeletionWatcher() {} + virtual void onDeleted( const std::string &/* name */) {} }; enum EStrech diff --git a/code/nel/include/nel/misc/types_nl.h b/code/nel/include/nel/misc/types_nl.h index e12b7aaca..46dd00cba 100644 --- a/code/nel/include/nel/misc/types_nl.h +++ b/code/nel/include/nel/misc/types_nl.h @@ -370,7 +370,7 @@ inline void aligned_free(void *ptr) { _aligned_free(ptr); } #elif defined(NL_OS_MAC) #include // under Mac OS X, malloc is already aligned for SSE and Altivec (16 bytes alignment) -inline void *aligned_malloc(size_t size, size_t alignment) { return malloc(size); } +inline void *aligned_malloc(size_t size, size_t /* alignment */) { return malloc(size); } inline void aligned_free(void *ptr) { free(ptr); } #else #include diff --git a/code/nel/src/misc/bitmap_gif.cpp b/code/nel/src/misc/bitmap_gif.cpp index 355e2a2bf..74f75a968 100644 --- a/code/nel/src/misc/bitmap_gif.cpp +++ b/code/nel/src/misc/bitmap_gif.cpp @@ -154,10 +154,12 @@ uint8 CBitmap::readGIF( NLMISC::IStream &f ) if (curFrame->ExtensionBlockCount > 0) { - for(uint e=0; eExtensionBlockCount; e++){ + for(sint e = 0; e < curFrame->ExtensionBlockCount; e++) + { ExtensionBlock *ext = &curFrame->ExtensionBlocks[e]; - if (ext->Function == GRAPHICS_EXT_FUNC_CODE) { + if (ext->Function == GRAPHICS_EXT_FUNC_CODE) + { uint8 flag = ext->Bytes[0]; //delay = (ext.Bytes[1] << 8) | ext.Bytes[2]; transparency = (flag & GIF_TRANSPARENT_MASK) ? ext->Bytes[3] : GIF_NOT_TRANSPARENT; diff --git a/code/ryzom/client/src/r2/auto_group.cpp b/code/ryzom/client/src/r2/auto_group.cpp index 7ec0456b6..5a69511d3 100644 --- a/code/ryzom/client/src/r2/auto_group.cpp +++ b/code/ryzom/client/src/r2/auto_group.cpp @@ -120,9 +120,9 @@ CInstance *CAutoGroup::getGroupingCandidate() { CObject *obj = NULL; if(kgetSize()) - obj = components->getValue(k); + obj = components->getValueAtPos(k); else - obj = baseComponents->getValue(k - components->getSize()); + obj = baseComponents->getValueAtPos(k - components->getSize()); CInstance *inst = getEditor().getInstanceFromObject(obj); if (!inst) { @@ -148,9 +148,9 @@ CInstance *CAutoGroup::getGroupingCandidate() { CObject *obj = NULL; if(kgetSize()) - obj = features->getValue(k); + obj = features->getValueAtPos(k); else - obj = baseFeatures->getValue(k - features->getSize()); + obj = baseFeatures->getValueAtPos(k - features->getSize()); CInstance *inst = getEditor().getInstanceFromObject(obj); CDisplayerVisual *dv = inst->getDisplayerVisual(); if (!dv) continue; diff --git a/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp b/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp index cb00080dc..1d24b266c 100644 --- a/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_activity_sequence.cpp @@ -124,7 +124,7 @@ void CDisplayerVisualActivitySequence::update() for(uint k = 0; k < activities->getSize(); ++k) { // search next zone of activity - CObjectTable *activity = activities->getValue(k)->toTable(); + CObjectTable *activity = activities->getValueAtPos(k)->toTable(); if (!activity) continue; std::string activityStr = getString(activity, "Activity"); if (activityStr == "Stand Still" || activityStr == "Inactive") continue; @@ -369,7 +369,7 @@ void CDisplayerVisualActivitySequence::onPostRender() for(uint k = 0; k < activities->getSize(); ++k) { // search next zone of activity - CObjectTable *activity = activities->getValue(k)->toTable(); + CObjectTable *activity = activities->getValueAtPos(k)->toTable(); if (!activity) continue; std::string zoneId = getString(activity, "ActivityZoneId"); if (zoneId.empty()) continue; diff --git a/code/ryzom/client/src/r2/displayer_visual_entity.cpp b/code/ryzom/client/src/r2/displayer_visual_entity.cpp index 2e9eeef7a..6b5e091e2 100644 --- a/code/ryzom/client/src/r2/displayer_visual_entity.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_entity.cpp @@ -978,7 +978,7 @@ void CDisplayerVisualEntity::updateName() sint actNb = -1; for(uint i=0; igetSize(); i++) { - if(acts->getValue(i)->equal(act)) + if(acts->getValueAtPos(i)->equal(act)) { actNb = i; break; diff --git a/code/ryzom/client/src/r2/displayer_visual_group.cpp b/code/ryzom/client/src/r2/displayer_visual_group.cpp index 6d80530a4..da0ac31c5 100644 --- a/code/ryzom/client/src/r2/displayer_visual_group.cpp +++ b/code/ryzom/client/src/r2/displayer_visual_group.cpp @@ -755,7 +755,7 @@ void CDisplayerVisualGroup::updateInstanceList() const _Instances.resize(sons->getSize()); for(uint k = 0; k < sons->getSize(); ++k) { - CInstance *inst = getEditor().getInstanceFromObject(sons->getValue(k)); + CInstance *inst = getEditor().getInstanceFromObject(sons->getValueAtPos(k)); if (inst) { _Instances[k] = inst->getDisplayerVisual(); diff --git a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp index 439265734..d3f5b1a65 100644 --- a/code/ryzom/client/src/r2/dmc/com_lua_module.cpp +++ b/code/ryzom/client/src/r2/dmc/com_lua_module.cpp @@ -1114,7 +1114,7 @@ void CComLuaModule::setObjectToLua(lua_State* state, CObject* object) for (first=0 ; first != last; ++first) { std::string key = object->getKey(first); - CObject *value = object->getValue(first); + CObject *value = object->getValueAtPos(first); if (!key.empty()) { lua_pushstring(state, key.c_str()); @@ -2246,7 +2246,7 @@ sint CComLuaModule::luaUpdateScenarioAck(lua_State* state) for(uint i = 0; i < size; ++i) { std::string key = object->getKey(i); - CObject* value = object->getValue(i); + CObject* value = object->getValueAtPos(i); if (value->isInteger()) { diff --git a/code/ryzom/client/src/r2/editor.cpp b/code/ryzom/client/src/r2/editor.cpp index f3a949fcd..2cc6c1812 100644 --- a/code/ryzom/client/src/r2/editor.cpp +++ b/code/ryzom/client/src/r2/editor.cpp @@ -3224,7 +3224,7 @@ void CEditor::initObjectProjectionMetatable() if (ls.isInteger(2)) { // index is an integer - const CObject *other = obj->getValue((uint32) ls.toInteger(2)); + const CObject *other = obj->getValueAtPos((uint32) ls.toInteger(2)); if (other) { pushValue(ls, other); @@ -3569,7 +3569,7 @@ void CEditor::initObjectProjectionMetatable() } ls.pop(2); pushKey(ls, obj, 0); - pushValue(ls, obj->getValue(0)); + pushValue(ls, obj->getValueAtPos(0)); return 2; } } @@ -3618,7 +3618,7 @@ void CEditor::initObjectProjectionMetatable() { ls.pop(2); pushKey(ls, obj, newIndex); - pushValue(ls, obj->getValue(newIndex)); + pushValue(ls, obj->getValueAtPos(newIndex)); return 2; } } @@ -3751,7 +3751,7 @@ void CEditor::setCurrentActFromTitle(const std::string &wantedTitle) { for(uint k = 0; k < actTable->getSize(); ++k) { - R2::CObject *act = actTable->getValue(k); + R2::CObject *act = actTable->getValueAtPos(k); nlassert(act); std::string actTitle; if (act->isString("Name")) @@ -4560,7 +4560,7 @@ void CEditor::updatePrimitiveContextualVisibility() for(uint k = 0; k < activities->getSize(); ++k) { // search next zone of activity - CObjectTable *activity = activities->getValue(k)->toTable(); + CObjectTable *activity = activities->getValueAtPos(k)->toTable(); if (!activity) continue; std::string zoneId = getString(activity, "ActivityZoneId"); CInstance *primitive = getInstanceFromId(zoneId); @@ -5031,7 +5031,7 @@ void CEditor::onErase(CObject *root, bool &foundInBase, std::string &nameInParen { for(uint k = 0; k < root->getSize(); ++k) { - CObject *obj = root->getValue(k); + CObject *obj = root->getValueAtPos(k); if (obj->isTable()) { onErase(obj); @@ -5122,7 +5122,7 @@ void CEditor::onErase(CObject *root, bool &foundInBase, std::string &nameInParen CObjectTable *rootTable = root->toTable(); for (uint32 k = 0; k < rootTable->getSize(); ++k) { - CObject *obj = rootTable->getValue(k); + CObject *obj = rootTable->getValueAtPos(k); CObjectRefIdClient *objRefId = dynamic_cast(obj); if (objRefId) { @@ -5547,7 +5547,7 @@ void CEditor::createNewInstanceForObjectTableInternal(const CObject *obj) // do the same on sons for(uint k = 0; k < table->getSize(); ++k) { - createNewInstanceForObjectTableInternal(table->getValue(k)); + createNewInstanceForObjectTableInternal(table->getValueAtPos(k)); } } @@ -5754,7 +5754,7 @@ void CEditor::scenarioUpdated(CObject* highLevel, bool willTP, uint32 initialAct CObject *acts = _Scenario->getAttr("Acts"); if (acts) { - CObject *baseAct = acts->getValue(0); + CObject *baseAct = acts->getValueAtPos(0); if (baseAct) { _BaseAct = getInstanceFromId(baseAct->toString("InstanceId")); @@ -5871,7 +5871,7 @@ CInstance *CEditor::getDefaultFeature(CInstance *act) if (!act) return NULL; CObject *defaultFeature = act->getObjectTable()->getAttr("Features"); if (!defaultFeature) return NULL; - defaultFeature = defaultFeature->getValue(0); + defaultFeature = defaultFeature->getValueAtPos(0); if (!defaultFeature) return NULL; // 0 should be the default feature CInstance *result = getInstanceFromId(defaultFeature->toString("InstanceId")); if (!result) return NULL; diff --git a/code/ryzom/client/src/r2/instance.cpp b/code/ryzom/client/src/r2/instance.cpp index 2baec8431..597e58d5d 100644 --- a/code/ryzom/client/src/r2/instance.cpp +++ b/code/ryzom/client/src/r2/instance.cpp @@ -754,7 +754,7 @@ const CInstance *CInstance::getParentGroupLeader() const { return NULL; } - return getEditor().getInstanceFromObject(components->getValue(0)); + return getEditor().getInstanceFromObject(components->getValueAtPos(0)); } // ********************************************************************************************************* @@ -776,7 +776,7 @@ CObject *CInstance::getGroupSelectedSequence() const { if (selectedSequence >= 0 && selectedSequence < (sint) activities->getSize()) { - return activities->getValue((sint32) selectedSequence); + return activities->getValueAtPos((sint32) selectedSequence); } } } diff --git a/code/ryzom/client/src/r2/object_factory_client.cpp b/code/ryzom/client/src/r2/object_factory_client.cpp index 2b267dd78..688ec3fcb 100644 --- a/code/ryzom/client/src/r2/object_factory_client.cpp +++ b/code/ryzom/client/src/r2/object_factory_client.cpp @@ -221,7 +221,7 @@ void CObjectRefIdClient::getNameInParent(std::string &name, sint32 &indexInArray { if (_IndexInParentArray == -1) { - if (parentInstanceTable->getValue(_IndexInParent) == static_cast(this)) + if (parentInstanceTable->getValueAtPos(_IndexInParent) == static_cast(this)) { name = parentInstanceTable->getKey(_IndexInParent); indexInArray = -1; @@ -230,13 +230,13 @@ void CObjectRefIdClient::getNameInParent(std::string &name, sint32 &indexInArray } else { - CObject *subObject = parentInstanceTable->getValue(_IndexInParent); + CObject *subObject = parentInstanceTable->getValueAtPos(_IndexInParent); if (subObject->isTable()) { CObjectTable *subTable = (CObjectTable *) subObject; if (_IndexInParentArray < (sint32) subTable->getSize()) { - if (subTable->getValue(_IndexInParentArray) == static_cast(this)) + if (subTable->getValueAtPos(_IndexInParentArray) == static_cast(this)) { name = parentInstanceTable->getKey(_IndexInParent); indexInArray = _IndexInParentArray; @@ -261,7 +261,7 @@ void CObjectRefIdClient::getNameInParent(std::string &name, sint32 &indexInArray // if instance is the direct parent (e.g object is not in an array of the parent) for (uint k = 0; k < parentInstanceTable->getSize(); ++k) { - if (parentInstanceTable->getValue(k) == ptrInParent) + if (parentInstanceTable->getValueAtPos(k) == ptrInParent) { _IndexInParent = k; if (ptrInParent == this) @@ -276,7 +276,7 @@ void CObjectRefIdClient::getNameInParent(std::string &name, sint32 &indexInArray // I'm in an array in my parent, retrieve the index for (uint l = 0; l < getParent()->getSize(); ++l) { - if (getParent()->getValue(l) == static_cast(this)) + if (getParent()->getValueAtPos(l) == static_cast(this)) { name = parentInstanceTable->getKey(_IndexInParent); _IndexInParentArray = l; diff --git a/code/ryzom/common/src/game_share/crypt_sha512.cpp b/code/ryzom/common/src/game_share/crypt_sha512.cpp index 4d151880d..70a142baa 100644 --- a/code/ryzom/common/src/game_share/crypt_sha512.cpp +++ b/code/ryzom/common/src/game_share/crypt_sha512.cpp @@ -321,11 +321,28 @@ static char *sha512crypt(const char *key, const char *setting, char *output) p += sprintf(p, "$6$%s%.*s$", rounds, slen, salt); #if 1 static const unsigned char perm[][3] = { - 0,21,42,22,43,1,44,2,23,3,24,45,25,46,4, - 47,5,26,6,27,48,28,49,7,50,8,29,9,30,51, - 31,52,10,53,11,32,12,33,54,34,55,13,56,14,35, - 15,36,57,37,58,16,59,17,38,18,39,60,40,61,19, - 62,20,41 }; + { 0, 21, 42 }, + { 22, 43, 1 }, + { 44, 2, 23 }, + { 3, 24, 45 }, + { 25, 46, 4 }, + { 47, 5, 26 }, + { 6, 27, 48 }, + { 28, 49, 7 }, + { 50, 8, 29 }, + { 9, 30, 51 }, + { 31, 52, 10 }, + { 53, 11, 32 }, + { 12, 33, 54 }, + { 34, 55, 13 }, + { 56, 14, 35 }, + { 15, 36, 57 }, + { 37, 58, 16 }, + { 59, 17, 38 }, + { 18, 39, 60 }, + { 40, 61, 19 }, + { 62, 20, 41 } + }; for (i=0; i<21; i++) p = to64(p, (md[perm[i][0]]<<16)|(md[perm[i][1]]<<8)|md[perm[i][2]], 4); #else diff --git a/code/ryzom/common/src/game_share/mirror_prop_value.h b/code/ryzom/common/src/game_share/mirror_prop_value.h index cbc251be2..b9bc7956e 100644 --- a/code/ryzom/common/src/game_share/mirror_prop_value.h +++ b/code/ryzom/common/src/game_share/mirror_prop_value.h @@ -1154,8 +1154,8 @@ public: friend iterator; // MSVC friend const_iterator; #else - template friend class _CMirrorPropValueListIterator; // GCC3 - template friend class _CCMirrorPropValueListIterator; + template friend struct _CMirrorPropValueListIterator; // GCC3 + template friend struct _CCMirrorPropValueListIterator; #endif /// Constructor @@ -1241,9 +1241,9 @@ public: friend iterator; // MSVC friend const_iterator; #else - template friend class _CMirrorPropValueListIterator; // GCC3 - template friend class _CCMirrorPropValueListIterator; - template friend class CMirrorPropValueItem; + template friend struct _CMirrorPropValueListIterator; // GCC3 + template friend struct _CCMirrorPropValueListIterator; + template friend class CMirrorPropValueItem; #endif /// Constructor diff --git a/code/ryzom/common/src/game_share/object.cpp b/code/ryzom/common/src/game_share/object.cpp index 0505a8b35..f4426d067 100644 --- a/code/ryzom/common/src/game_share/object.cpp +++ b/code/ryzom/common/src/game_share/object.cpp @@ -392,7 +392,7 @@ CObject* CObject::getAttr(const std::string & /* name */) const { return 0;} std::string CObject::getKey(uint32 /* pos */) const{ BOMB("Try to call the function getKey() on an object that is not a table", return ""); return "";} -CObject* CObject::getValue(uint32 /* pos */) const{ BOMB("Try to call the function getValue() on an object that is not a table", return 0); return 0;} +CObject* CObject::getValueAtPos(uint32 /* pos */) const{ BOMB("Try to call the function getValueAtPos() on an object that is not a table", return 0); return 0;} uint32 CObject::getSize() const { BOMB("Try to call the function getSize() on an object that is not a table", return 0); return 0; } @@ -974,7 +974,7 @@ void CObjectTable::checkIntegrity() const { for(uint k = 0; k < getSize(); ++k) { - CObject *subObj = getValue(k); + CObject *subObj = getValueAtPos(k); if (subObj) { if (!subObj->getGhost()) @@ -1017,7 +1017,7 @@ void CObjectTable::setGhost(bool ghost) for(uint k = 0; k < getSize(); ++k) { - CObject *subObj = getValue(k); + CObject *subObj = getValueAtPos(k); if (subObj) { subObj->setGhost(ghost); @@ -1031,7 +1031,7 @@ void CObjectTable::previsit(std::vector &sons) sons.reserve(sons.size() + getSize()); for(uint k = 0; k < getSize(); ++k) { - CObject *subObj = getValue(k); + CObject *subObj = getValueAtPos(k); if (subObj) { subObj->previsit(sons); @@ -1068,7 +1068,7 @@ void CObjectTable::inPlaceCopy(const CObjectTable &src) } else { - src.getValue(k)->inPlaceCopyTo(*dest); + src.getValueAtPos(k)->inPlaceCopyTo(*dest); } } else @@ -1115,7 +1115,7 @@ void CObjectTable::sort() uint32 lastKey = keys->getSize(); for (; firstKey != lastKey ; ++firstKey) { - CObject* keyObject = keys->getValue(firstKey); + CObject* keyObject = keys->getValueAtPos(firstKey); if (! keyObject->isString()) return; std::string key = keyObject->toString(); @@ -1344,7 +1344,7 @@ std::string CObjectTable::getKey(uint32 pos) const return _Value[pos].first; } -CObject* CObjectTable::getValue(uint32 pos) const +CObject* CObjectTable::getValueAtPos(uint32 pos) const { //H_AUTO(R2_CObjectTable_getValue) if (pos >= _Value.size()) @@ -1404,7 +1404,7 @@ bool CObjectTable::setObject(const std::string& key, CObject* value) for ( ; first != last ; ++first) { std::string key1 = table->getKey(first); - CObject* value1 = table->getValue(first); + CObject* value1 = table->getValueAtPos(first); add(key1, value1->clone()); } return true; @@ -1577,9 +1577,9 @@ bool CObjectTable::equal(const CObject* other) const for ( i=0; i!= size ; ++i ) { std::string key = other->getKey(i); - CObject* value = other->getValue(i); + CObject* value = other->getValueAtPos(i); if (key != this->getKey(i)) return false; - if ( !value->equal(this->getValue(i))) return false; + if ( !value->equal(this->getValueAtPos(i))) return false; } return true; } @@ -1835,7 +1835,7 @@ void CObjectGenerator::createDefaultValues(CObjectFactory* factory) uint32 last = prop->getSize(); for ( ; first != last ; ++first ) { - CObject* found = prop->getValue(first); + CObject* found = prop->getValueAtPos(first); if (found && found->isString("DefaultValue") && found->isString("Name") ) { @@ -1895,7 +1895,7 @@ CObject* CObjectGenerator::instanciate(CObjectFactory* factory) const uint32 last = prop->getSize(); for ( ; first != last ; ++first ) { - CObject* found = prop->getValue(first); + CObject* found = prop->getValueAtPos(first); if (found && found->isString("Type") ) { @@ -2461,7 +2461,7 @@ public: uint8 shortKey = static_cast(uiKey); stream.serial(shortKey); - CObject*value = data->getValue(optionalPropFoundIndex[first]); + CObject*value = data->getValueAtPos(optionalPropFoundIndex[first]); if (serializer->Log) { nldebug("R2NET: (%u) Field '%s'", serializer->Level, key.c_str());} onSerial(stream, key, value, serializer); } @@ -2483,7 +2483,7 @@ public: stream.serial(last16); for (; first != last; ++first) { - CObject* value = data->getValue(valuePropFoundIndex[first]); + CObject* value = data->getValueAtPos(valuePropFoundIndex[first]); if (serializer->Log) { nldebug("R2NET: (%u) Field [%u]", serializer->Level, first);} CObjectSerializerImpl::getInstance().serialImpl(stream, value, serializer); } @@ -2509,7 +2509,7 @@ public: { uint32 keyIndex = otherPropFoundIndex[first]; std::string key = data->getKey(keyIndex); - CObject* value = data->getValue(keyIndex); + CObject* value = data->getValueAtPos(keyIndex); stream.serial(key); if (serializer->Log) { nldebug("R2NET: (%u) Field '%s'", serializer->Level, key.c_str());} CObjectSerializerImpl::getInstance().serialImpl(stream, value, serializer); @@ -3270,7 +3270,7 @@ void CObjectSerializerImpl::serialImpl(NLMISC::IStream& stream, CObject*& data, for (uint first = 0; first != size; ++first) { std::string key = data->getKey(first); - CObject* value = data->getValue(first); + CObject* value = data->getValueAtPos(first); stream.serial(key); ++ (serializer->Level); if (serializer->Log) { nldebug("R2NET: (%u) Field '%s'", serializer->Level, key.c_str());} diff --git a/code/ryzom/common/src/game_share/object.h b/code/ryzom/common/src/game_share/object.h index 71a30f32d..7d4ab1f49 100644 --- a/code/ryzom/common/src/game_share/object.h +++ b/code/ryzom/common/src/game_share/object.h @@ -114,7 +114,7 @@ public: virtual std::string getKey(uint32 pos) const; - virtual CObject* getValue(uint32 pos) const; + virtual CObject* getValueAtPos(uint32 pos) const; virtual uint32 getSize() const; @@ -385,7 +385,7 @@ public: virtual std::string getKey(uint32 pos) const; - virtual CObject* getValue(uint32 pos) const; + virtual CObject* getValueAtPos(uint32 pos) const; virtual sint32 findIndex(const CObject* child) const; diff --git a/code/ryzom/common/src/game_share/ring_access.cpp b/code/ryzom/common/src/game_share/ring_access.cpp index ee9d870ee..c191f8c83 100644 --- a/code/ryzom/common/src/game_share/ring_access.cpp +++ b/code/ryzom/common/src/game_share/ring_access.cpp @@ -421,7 +421,7 @@ bool CRingAccess::verifyRtScenario(CObject* rtScenario, const std::string& charR for ( ;firstLocation != lastLocation; ++firstLocation) { - CObject* location = locations->getValue(firstLocation); + CObject* location = locations->getValueAtPos(firstLocation); if (!location || !location->isString("Island")) { err = new CVerfiyRightRtScenarioError(CVerfiyRightRtScenarioError::InvalidData); @@ -445,7 +445,7 @@ bool CRingAccess::verifyRtScenario(CObject* rtScenario, const std::string& charR uint32 lastActIndex = acts->getSize(); for ( ;firstActIndex != lastActIndex; ++firstActIndex) { - CObject* act = acts->getValue(firstActIndex); + CObject* act = acts->getValueAtPos(firstActIndex); if (!act || !act->isTable() || !act->isTable("Npcs")) { err = new CVerfiyRightRtScenarioError(CVerfiyRightRtScenarioError::InvalidData); @@ -457,7 +457,7 @@ bool CRingAccess::verifyRtScenario(CObject* rtScenario, const std::string& charR uint32 lastNpcIndex = npcs->getSize(); for (; firstNpcIndex != lastNpcIndex; ++firstNpcIndex) { - CObject* npc = npcs->getValue(firstNpcIndex); + CObject* npc = npcs->getValueAtPos(firstNpcIndex); if (npc && npc->isTable() && npc->isString("SheetClient") && npc->isString("Sheet")) { std::string botName; diff --git a/code/ryzom/common/src/game_share/scenario.cpp b/code/ryzom/common/src/game_share/scenario.cpp index 6911df31a..120b422d2 100644 --- a/code/ryzom/common/src/game_share/scenario.cpp +++ b/code/ryzom/common/src/game_share/scenario.cpp @@ -122,7 +122,7 @@ CObject *CScenario::find(const std::string& instanceId, const std::string & attr } if (position != -1) { - CObject *subObj = src->getValue(position); + CObject *subObj = src->getValueAtPos(position); if (!subObj) { nlwarning("Can't find attribute %s[%d] inside object with InstanceId = %s", attrName.c_str(), (int) position, instanceId.c_str()); @@ -388,7 +388,7 @@ void CInstanceMap::add(CObject* root) sint32 first = 0; for (first = 0 ; first != size ; ++first) { - CObject* value = root->getValue(first); + CObject* value = root->getValueAtPos(first); add(value); } @@ -416,7 +416,7 @@ void CInstanceMap::remove(CObject* root) sint32 first = 0; for (first = 0 ; first != size ; ++first) { - CObject* value = root->getValue(first); + CObject* value = root->getValueAtPos(first); remove(value); } diff --git a/code/ryzom/common/src/game_share/server_animation_module.cpp b/code/ryzom/common/src/game_share/server_animation_module.cpp index 794d88212..8dd02f621 100644 --- a/code/ryzom/common/src/game_share/server_animation_module.cpp +++ b/code/ryzom/common/src/game_share/server_animation_module.cpp @@ -691,7 +691,7 @@ void CAttributeToProperty::setPrimPath() points->VPoints.resize(last); for ( ; first != last ; ++first ) { - CObject* pt = pts->getValue(first); + CObject* pt = pts->getValueAtPos(first); attr = pt->getAttr("x"); if (attr && attr->isNumber()) { points->VPoints[first].x = static_cast(attr->toNumber()); } @@ -721,7 +721,7 @@ void CAttributeToProperty::setPrimZone() points->VPoints.resize(last); for ( ; first != last ; ++first ) { - CObject* pt = pts->getValue(first); + CObject* pt = pts->getValueAtPos(first); attr = pt->getAttr("x"); if (attr && attr->isNumber()) { points->VPoints[first].x = static_cast(attr->toNumber()); } @@ -1103,7 +1103,7 @@ IPrimitive* CServerAnimationModule::getAction(CObject* action, const std::string uint32 nb =children->getSize(); for(uint32 i=0;igetValue(i), prefix,scenarioId); + IPrimitive* tmp=getAction(children->getValueAtPos(i), prefix,scenarioId); if (!tmp) { nlwarning("Error in action %s nb: %u", action->toString("Name").c_str(), i); @@ -1466,7 +1466,7 @@ bool CServerAnimationModule::translateActToPrimitive(CInstanceMap& components, C for ( ; firstAiState != lastAiState ; ++firstAiState) { - CObject* aiState = aiStates->getValue(firstAiState); + CObject* aiState = aiStates->getValueAtPos(firstAiState); std::string aiMovement = aiState->toString("AiMovement"); @@ -1532,7 +1532,7 @@ bool CServerAnimationModule::translateActToPrimitive(CInstanceMap& components, C uint32 firstChild(0), lastChild(children->getSize()); for ( ; firstChild != lastChild ; ++firstChild) { - CObject* childName = children->getValue(firstChild); + CObject* childName = children->getValueAtPos(firstChild); CObject* component = components.find(childName->toString()); @@ -1597,7 +1597,7 @@ bool CServerAnimationModule::translateActToPrimitive(CInstanceMap& components, C uint32 firstNpc(0), lastNpc(npcChild->getSize()); for ( ; firstNpc != lastNpc ; ++firstNpc) { - CObject* objectNpcId = npcChild->getValue(firstNpc); + CObject* objectNpcId = npcChild->getValueAtPos(firstNpc); std::string npcId ( objectNpcId->toString() ); CObject* objectNpc = components.find(npcId); @@ -1760,14 +1760,14 @@ bool CServerAnimationModule::translateActToPrimitive(CInstanceMap& components, C for(;firstEvent!=lastEvent;++firstEvent) { //create the primitive event and its associated actions - IPrimitive* pEvent = getEvent(events->getValue(firstEvent), components, prefix, animSession->SessionId); + IPrimitive* pEvent = getEvent(events->getValueAtPos(firstEvent), components, prefix, animSession->SessionId); if (!pEvent) { nlwarning("Error while generating primitive"); return false; } //insert the primitive event - CObject* eventObject = events->getValue(firstEvent); + CObject* eventObject = events->getValueAtPos(firstEvent); bool isTriggerZone = false; if ( eventObject->isInteger("IsTriggerZone") ) @@ -1806,7 +1806,7 @@ bool CServerAnimationModule::translateActToPrimitive(CInstanceMap& components, C uint32 firstnode = 0; for (; firstnode != lastnode; ++firstnode) { - CObject* node = tree->getValue(firstnode); + CObject* node = tree->getValueAtPos(firstnode); if (!node || !node->isTable() || !node->isString("Name") @@ -1898,7 +1898,7 @@ bool CServerAnimationModule::doMakeAnimationSession(CAnimationSession* animSessi uint32 firstPlotItem = 0; for (; firstPlotItem != lastPlotItem; ++firstPlotItem) { - CObject* plotItem = plotItems->getValue(firstPlotItem); + CObject* plotItem = plotItems->getValueAtPos(firstPlotItem); if (!plotItem || !plotItem->isTable() || !plotItem->isInteger("SheetId") @@ -1955,7 +1955,7 @@ bool CServerAnimationModule::doMakeAnimationSession(CAnimationSession* animSessi uint32 firstLocation = 0; for (; firstLocation != lastLocation; ++firstLocation) { - CObject* location = locations->getValue(firstLocation); + CObject* location = locations->getValueAtPos(firstLocation); if (!location || !location->isTable() || !location->isInteger("Season") @@ -1991,7 +1991,7 @@ bool CServerAnimationModule::doMakeAnimationSession(CAnimationSession* animSessi for (; firstAct != lastAct ; ++firstAct) { //std::string key = acts->getKey(firstAct); - CObject* act= acts->getValue(firstAct); + CObject* act= acts->getValueAtPos(firstAct); if (!act) { nlwarning("R2An: Can't make animation session, invalid RtAct"); @@ -3697,7 +3697,7 @@ IPrimitive* CServerAnimationModule::getEvent(CObject* event,CInstanceMap& compon //for each action of this event for(;firstAction!=lastAction;++firstAction) { - CObject * action_id = actions_id->getValue(firstAction); + CObject * action_id = actions_id->getValueAtPos(firstAction); std::string id = action_id->toString(); CObject* action=components.find(id); // can be null? if (!action) @@ -3770,7 +3770,7 @@ void CServerAnimationModule::requestLoadTable(CAnimationSession* session) msg.serial(size); for(uint32 i=0;igetValue(i); + CObject* entry = textsTable->getValueAtPos(i); std::string tmp = entry->getAttr("Id")->toString(); msg.serial(tmp); tmp = entry->getAttr("Text")->toString(); diff --git a/code/ryzom/common/src/game_share/server_edition_module.cpp b/code/ryzom/common/src/game_share/server_edition_module.cpp index e044e1323..2005879c1 100644 --- a/code/ryzom/common/src/game_share/server_edition_module.cpp +++ b/code/ryzom/common/src/game_share/server_edition_module.cpp @@ -3645,7 +3645,7 @@ bool CServerEditionModule::checkScenario(CObject* scenario) uint32 max = acts->getSize(); for(uint32 i = 0;igetValue(i); + CObject * act = acts->getValueAtPos(i); CObject * npcs = act->findAttr("Npcs"); CObject * states = act->findAttr("AiStates"); if (states && states->isTable()) @@ -4022,14 +4022,14 @@ bool CServerEditionModule::getPosition(TSessionId sessionId, double& x, double& CObject* acts = hl->getAttr("Acts"); BOMB_IF(!acts || !acts->isTable() || actIndex >= acts->getSize(), "Invalid acts.", return false); - CObject* selectedAct = acts->getValue(actIndex); + CObject* selectedAct = acts->getValueAtPos(actIndex); BOMB_IF(!selectedAct || !selectedAct->isString("LocationId"), "Invalid act.", return false); std::string locationInstanceId = selectedAct->toString("LocationId"); uint32 firstLocationIndex = 0, lastLocationIndex = locations->getSize(); for (; firstLocationIndex != lastLocationIndex; ++firstLocationIndex) { - CObject* location = locations->getValue(firstLocationIndex); + CObject* location = locations->getValueAtPos(firstLocationIndex); if ( location && location->isString("InstanceId") && location->toString("InstanceId") == locationInstanceId ) { locationId = firstLocationIndex; @@ -4043,7 +4043,7 @@ bool CServerEditionModule::getPosition(TSessionId sessionId, double& x, double& - CObject* firstLocation = locations->getValue(locationId); + CObject* firstLocation = locations->getValueAtPos(locationId); BOMB_IF(!firstLocation || !firstLocation->isTable(), "Invalid location.", return false); CObject* entryPointObj = firstLocation->getAttr("EntryPoint"); diff --git a/code/ryzom/common/src/game_share/small_string_manager.cpp b/code/ryzom/common/src/game_share/small_string_manager.cpp index e57d7d17b..83414b668 100644 --- a/code/ryzom/common/src/game_share/small_string_manager.cpp +++ b/code/ryzom/common/src/game_share/small_string_manager.cpp @@ -123,7 +123,7 @@ CSmallStringManager::CSmallStringManager(CObject* textManager) //unused ids for(uint32 i=0;i(unused->getValue(i)->toInteger()); + uint32 id = static_cast(unused->getValueAtPos(i)->toInteger()); _FreeIds.insert(id); } @@ -131,7 +131,7 @@ CSmallStringManager::CSmallStringManager(CObject* textManager) max = texts->getSize(); for(uint32 i=0;igetValue(i); + CObject* entry = texts->getValueAtPos(i); std::string text = entry->getAttr("Text")->toString(); uint32 textId = static_cast(entry->getAttr("TextId")->toInteger()); uint32 textCount = static_cast(entry->getAttr("Count")->toInteger()); diff --git a/code/ryzom/common/src/game_share/string_mgr_module.cpp b/code/ryzom/common/src/game_share/string_mgr_module.cpp index 9aaa232a2..49d9a9122 100644 --- a/code/ryzom/common/src/game_share/string_mgr_module.cpp +++ b/code/ryzom/common/src/game_share/string_mgr_module.cpp @@ -417,7 +417,7 @@ void CStringManagerModule::registerTableRequested(TSessionId sessionId,CObject* //for each entry of the local table for(uint i=0;igetValue(i); + CObject* text = textsTable->getValueAtPos(i); CObject* tmp = text->getAttr("Id"); nlassert(tmp); std::string localId = tmp->toString();