diff options
50 files changed, 298 insertions, 381 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 1f5e6aa98c..89a7c4589b 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -214,7 +214,7 @@ void LLAvatarAppearance::initInstance() mRoot = createAvatarJoint(); mRoot->setName( "mRoot" ); - for (const auto& mesh_pair : sAvatarDictionary->getMeshEntries()) + for (const LLAvatarAppearanceDictionary::MeshEntries::value_type& mesh_pair : sAvatarDictionary->getMeshEntries()) { const EMeshIndex mesh_index = mesh_pair.first; const LLAvatarAppearanceDictionary::MeshEntry *mesh_dict = mesh_pair.second; @@ -258,7 +258,7 @@ void LLAvatarAppearance::initInstance() //------------------------------------------------------------------------- // associate baked textures with meshes //------------------------------------------------------------------------- - for (const auto& mesh_pair : sAvatarDictionary->getMeshEntries()) + for (const LLAvatarAppearanceDictionary::MeshEntries::value_type& mesh_pair : sAvatarDictionary->getMeshEntries()) { const EMeshIndex mesh_index = mesh_pair.first; const LLAvatarAppearanceDictionary::MeshEntry *mesh_dict = mesh_pair.second; @@ -266,7 +266,7 @@ void LLAvatarAppearance::initInstance() // Skip it if there's no associated baked texture. if (baked_texture_index == BAKED_NUM_INDICES) continue; - for (auto mesh : mMeshLOD[mesh_index]->mMeshParts) + for (LLAvatarJointMesh* mesh : mMeshLOD[mesh_index]->mMeshParts) { mBakedTextureDatas[(S32)baked_texture_index].mJointMeshes.push_back(mesh); } @@ -290,7 +290,7 @@ LLAvatarAppearance::~LLAvatarAppearance() delete_and_clear(mBakedTextureDatas[i].mTexLayerSet); mBakedTextureDatas[i].mJointMeshes.clear(); - for (auto masked_morph : mBakedTextureDatas[i].mMaskedMorphs) + for (LLMaskedMorph* masked_morph : mBakedTextureDatas[i].mMaskedMorphs) { delete masked_morph; } @@ -305,7 +305,7 @@ LLAvatarAppearance::~LLAvatarAppearance() std::for_each(mPolyMeshes.begin(), mPolyMeshes.end(), DeletePairedPointer()); mPolyMeshes.clear(); - for (auto joint : mMeshLOD) + for (LLAvatarJoint* joint : mMeshLOD) { std::for_each(joint->mMeshParts.begin(), joint->mMeshParts.end(), DeletePointer()); joint->mMeshParts.clear(); @@ -460,7 +460,7 @@ void LLAvatarAppearance::compareJointStateMaps(joint_state_map_t& last_state, if (!last_state.empty() && (last_state != curr_state)) { S32 diff_count = 0; - for (auto& pair : last_state) + for (joint_state_map_t::value_type& pair : last_state) { const std::string& key = pair.first; if (last_state[key] != curr_state[key]) @@ -672,7 +672,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent // setup children - for (auto child_info : info->mChildren) + for (LLAvatarBoneInfo* child_info : info->mChildren) { if (!setupBone(child_info, joint, volume_num, joint_num)) { @@ -725,7 +725,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info) S32 current_joint_num = 0; S32 current_volume_num = 0; - for (auto bone_info : info->mBoneInfoList) + for (LLAvatarBoneInfo* bone_info : info->mBoneInfoList) { if (!setupBone(bone_info, NULL, current_volume_num, current_joint_num)) { @@ -804,9 +804,9 @@ void LLAvatarAppearance::buildCharacter() //------------------------------------------------------------------------- // clear mesh data //------------------------------------------------------------------------- - for (auto joint : mMeshLOD) + for (LLAvatarJoint* joint : mMeshLOD) { - for (auto mesh : joint->mMeshParts) + for (LLAvatarJointMesh* mesh : joint->mMeshParts) { mesh->setMesh(NULL); } @@ -981,7 +981,7 @@ BOOL LLAvatarAppearance::loadAvatar() } // avatar_lad.xml : <morph_masks> - for (auto info : sAvatarXmlInfo->mMorphMaskInfoList) + for (LLAvatarXmlInfo::LLAvatarMorphInfo* info : sAvatarXmlInfo->mMorphMaskInfoList) { EBakedTextureIndex baked = sAvatarDictionary->findBakedByRegionName(info->mRegion); if (baked != BAKED_NUM_INDICES) @@ -1001,7 +1001,7 @@ BOOL LLAvatarAppearance::loadAvatar() loadLayersets(); // avatar_lad.xml : <driver_parameters> - for (auto info : sAvatarXmlInfo->mDriverInfoList) + for (LLDriverParamInfo* info : sAvatarXmlInfo->mDriverInfoList) { LLDriverParam* driver_param = new LLDriverParam( this ); if (driver_param->setInfo(info)) @@ -1034,7 +1034,7 @@ BOOL LLAvatarAppearance::loadSkeletonNode () mRoot->addChild( mSkeleton[0] ); // make meshes children before calling parent version of the function - for (auto joint : mMeshLOD) + for (LLAvatarJoint* joint : mMeshLOD) { joint->mUpdateXform = FALSE; joint->setMeshesToChildren(); @@ -1068,7 +1068,7 @@ BOOL LLAvatarAppearance::loadSkeletonNode () // SKELETAL DISTORTIONS { LLAvatarXmlInfo::skeletal_distortion_info_list_t::iterator iter; - for (auto visual_param_info : sAvatarXmlInfo->mSkeletalDistortionInfoList) + for (LLViewerVisualParamInfo* visual_param_info : sAvatarXmlInfo->mSkeletalDistortionInfoList) { LLPolySkeletalDistortionInfo *info = (LLPolySkeletalDistortionInfo*)visual_param_info; LLPolySkeletalDistortion *param = new LLPolySkeletalDistortion(this); @@ -1094,7 +1094,7 @@ BOOL LLAvatarAppearance::loadSkeletonNode () //----------------------------------------------------------------------------- BOOL LLAvatarAppearance::loadMeshNodes() { - for (const auto info : sAvatarXmlInfo->mMeshInfoList) + for (const LLAvatarXmlInfo::LLAvatarMeshInfo* info : sAvatarXmlInfo->mMeshInfoList) { const std::string &type = info->mType; S32 lod = info->mLOD; @@ -1107,7 +1107,7 @@ BOOL LLAvatarAppearance::loadMeshNodes() switch(lod) case 0: mesh = &mHairMesh0; */ - for (const auto& mesh_pair : sAvatarDictionary->getMeshEntries()) + for (const LLAvatarAppearanceDictionary::MeshEntries::value_type& mesh_pair : sAvatarDictionary->getMeshEntries()) { const EMeshIndex mesh_index = mesh_pair.first; const LLAvatarAppearanceDictionary::MeshEntry *mesh_dict = mesh_pair.second; @@ -1178,7 +1178,7 @@ BOOL LLAvatarAppearance::loadMeshNodes() mesh->setMesh( poly_mesh ); mesh->setLOD( info->mMinPixelArea ); - for (const auto& info_pair : info->mPolyMorphTargetInfoList) + for (const LLAvatarXmlInfo::LLAvatarMeshInfo::morph_info_pair_t& info_pair : info->mPolyMorphTargetInfoList) { LLPolyMorphTarget *param = new LLPolyMorphTarget(mesh->getMesh()); if (!param->setInfo((LLPolyMorphTargetInfo*)info_pair.first)) @@ -1211,7 +1211,7 @@ BOOL LLAvatarAppearance::loadMeshNodes() BOOL LLAvatarAppearance::loadLayersets() { BOOL success = TRUE; - for (auto layerset_info : sAvatarXmlInfo->mLayerInfoList) + for (LLTexLayerSetInfo* layerset_info : sAvatarXmlInfo->mLayerInfoList) { if (isSelf()) { @@ -1228,7 +1228,7 @@ BOOL LLAvatarAppearance::loadLayersets() // scan baked textures and associate the layerset with the appropriate one EBakedTextureIndex baked_index = BAKED_NUM_INDICES; - for (const auto& baked_pair : sAvatarDictionary->getBakedTextures()) + for (const LLAvatarAppearanceDictionary::BakedTextures::value_type& baked_pair : sAvatarDictionary->getBakedTextures()) { const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = baked_pair.second; if (layer_set->isBodyRegion(baked_dict->mName)) @@ -1249,7 +1249,7 @@ BOOL LLAvatarAppearance::loadLayersets() } // scan morph masks and let any affected layers know they have an associated morph - for (auto morph : mBakedTextureDatas[baked_index].mMaskedMorphs) + for (LLMaskedMorph* morph : mBakedTextureDatas[baked_index].mMaskedMorphs) { LLTexLayerInterface* layer = layer_set->findLayerByName(morph->mLayer); if (layer) @@ -1692,7 +1692,7 @@ void LLAvatarAppearance::makeJointAliases(LLAvatarBoneInfo *bone_info) boost::char_separator<char> sep(" "); boost::tokenizer<boost::char_separator<char> > tok(aliases, sep); - for(auto& i : tok) + for(const std::string& i : tok) { if ( mJointAliasMap.find(i) != mJointAliasMap.end() ) { @@ -1713,13 +1713,13 @@ const LLAvatarAppearance::joint_alias_map_t& LLAvatarAppearance::getJointAliases if (mJointAliasMap.empty()) { - for (auto bone_info : sAvatarSkeletonInfo->mBoneInfoList) + for (LLAvatarBoneInfo* bone_info : sAvatarSkeletonInfo->mBoneInfoList) { //LLAvatarBoneInfo *bone_info = *iter; makeJointAliases(bone_info); } - for (auto info : sAvatarXmlInfo->mAttachmentInfoList) + for (LLAvatarXmlInfo::LLAvatarAttachmentInfo* info : sAvatarXmlInfo->mAttachmentInfoList) { std::string bone_name = info->mName; diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index cb1cbc11a6..e3444efcf6 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -387,7 +387,7 @@ protected: LLAvatarMeshInfo() : mLOD(0), mMinPixelArea(.1f) {} ~LLAvatarMeshInfo() { - for (auto& pair : mPolyMorphTargetInfoList) + for (morph_info_list_t::value_type& pair : mPolyMorphTargetInfoList) { delete pair.first; } diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index 5ab3f92b31..8759c387e8 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -183,14 +183,14 @@ LLAvatarAppearanceDictionary::~LLAvatarAppearanceDictionary() // map it to the baked texture. void LLAvatarAppearanceDictionary::createAssociations() { - for (const auto& baked_pair : mBakedTextures) + for (BakedTextures::value_type& baked_pair : mBakedTextures) { const EBakedTextureIndex baked_index = baked_pair.first; const BakedEntry *dict = baked_pair.second; // For each texture that this baked texture index affects, associate those textures // with this baked texture index. - for (const auto local_texture_index : dict->mLocalTextures) + for (const ETextureIndex local_texture_index : dict->mLocalTextures) { mTextures[local_texture_index]->mIsUsedByBakedTexture = true; mTextures[local_texture_index]->mBakedTextureIndex = baked_index; diff --git a/indra/llappearance/llavatarjoint.cpp b/indra/llappearance/llavatarjoint.cpp index 82050605e1..9300b08b7b 100644 --- a/indra/llappearance/llavatarjoint.cpp +++ b/indra/llappearance/llavatarjoint.cpp @@ -100,7 +100,7 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive ) //---------------------------------------------------------------- if (recursive) { - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child); joint->setValid(valid, TRUE); @@ -131,7 +131,7 @@ void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive) if (recursive) { - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child); joint->setVisible(visible, recursive); @@ -141,7 +141,7 @@ void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive) void LLAvatarJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area) { - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child); joint->updateFaceSizes(num_vertices, num_indices, pixel_area); @@ -150,7 +150,7 @@ void LLAvatarJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pix void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update) { - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child); joint->updateFaceData(face, pixel_area, damp_wind, terse_update); @@ -159,7 +159,7 @@ void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, void LLAvatarJoint::updateJointGeometry() { - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child); joint->updateJointGeometry(); @@ -172,7 +172,7 @@ BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate) BOOL lod_changed = FALSE; BOOL found_lod = FALSE; - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child); F32 jointLOD = joint->getLOD(); @@ -200,7 +200,7 @@ BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate) void LLAvatarJoint::dump() { - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast<LLAvatarJoint*>(child); joint->dump(); @@ -211,7 +211,7 @@ void LLAvatarJoint::dump() void LLAvatarJoint::setMeshesToChildren() { removeAllChildren(); - for (auto mesh : mMeshParts) + for (LLAvatarJointMesh* mesh : mMeshParts) { addChild(mesh); } diff --git a/indra/llappearance/llavatarjointmesh.cpp b/indra/llappearance/llavatarjointmesh.cpp index aa1a216678..ed39f78d28 100644 --- a/indra/llappearance/llavatarjointmesh.cpp +++ b/indra/llappearance/llavatarjointmesh.cpp @@ -379,7 +379,7 @@ void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint) } // depth-first traversal - for (auto joint : current_joint->mChildren) + for (LLJoint* joint : current_joint->mChildren) { LLAvatarJoint* child_joint = (LLAvatarJoint*)joint; setupJoint(child_joint); diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp index 7845647281..f46d0324a5 100644 --- a/indra/llappearance/lldriverparam.cpp +++ b/indra/llappearance/lldriverparam.cpp @@ -102,7 +102,7 @@ void LLDriverParamInfo::toStream(std::ostream &out) LLViewerVisualParamInfo::toStream(out); out << "driver" << "\t"; out << mDrivenInfoList.size() << "\t"; - for (auto& driven : mDrivenInfoList) + for (LLDrivenEntryInfo& driven : mDrivenInfoList) { out << driven.mDrivenID << "\t"; } @@ -120,7 +120,7 @@ void LLDriverParamInfo::toStream(std::ostream &out) if(mDriverParam && mDriverParam->getAvatarAppearance()->isSelf() && mDriverParam->getAvatarAppearance()->isValid()) { - for (auto& driven : mDrivenInfoList) + for (LLDrivenEntryInfo& driven : mDrivenInfoList) { LLViewerVisualParam *param = (LLViewerVisualParam*)mDriverParam->getAvatarAppearance()->getVisualParam(driven.mDrivenID); @@ -230,7 +230,7 @@ void LLDriverParam::setWeight(F32 weight) //-------|----|-------|----|-------> driver // | min1 max1 max2 min2 - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { LLDrivenEntry* drivenp = &driven; LLDrivenEntryInfo* info = drivenp->mInfo; @@ -303,7 +303,7 @@ void LLDriverParam::setWeight(F32 weight) F32 LLDriverParam::getTotalDistortion() { F32 sum = 0.f; - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { sum += driven.mParam->getTotalDistortion(); } @@ -317,7 +317,7 @@ const LLVector4a &LLDriverParam::getAvgDistortion() LLVector4a sum; sum.clear(); S32 count = 0; - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { sum.add(driven.mParam->getAvgDistortion()); count++; @@ -331,7 +331,7 @@ const LLVector4a &LLDriverParam::getAvgDistortion() F32 LLDriverParam::getMaxDistortion() { F32 max = 0.f; - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { F32 param_max = driven.mParam->getMaxDistortion(); if( param_max > max ) @@ -348,7 +348,7 @@ LLVector4a LLDriverParam::getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) { LLVector4a sum; sum.clear(); - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { sum.add(driven.mParam->getVertexDistortion(index, poly_mesh)); } @@ -359,7 +359,7 @@ const LLVector4a* LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **pol { mCurrentDistortionParam = NULL; const LLVector4a* v = NULL; - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { v = driven.mParam->getFirstDistortion(index, poly_mesh); if( v ) @@ -441,7 +441,7 @@ void LLDriverParam::setAnimationTarget( F32 target_value) { LLVisualParam::setAnimationTarget(target_value); - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { LLDrivenEntry* drivenp = &driven; F32 driven_weight = getDrivenWeight(drivenp, mTargetWeight); @@ -459,7 +459,7 @@ void LLDriverParam::stopAnimating() { LLVisualParam::stopAnimating(); - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { driven.mParam->setAnimating(FALSE); } @@ -469,7 +469,7 @@ void LLDriverParam::stopAnimating() BOOL LLDriverParam::linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params) { BOOL success = TRUE; - for (auto& driven_info : getInfo()->mDrivenInfoList) + for (LLDrivenEntryInfo& driven_info : getInfo()->mDrivenInfoList) { S32 driven_id = driven_info.mDrivenID; @@ -513,7 +513,7 @@ void LLDriverParam::updateCrossDrivenParams(LLWearableType::EType driven_type) bool needs_update = (getWearableType()==driven_type); // if the driver has a driven entry for the passed-in wearable type, we need to refresh the value - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { if (driven.mParam && driven.mParam->getCrossWearable() && driven.mParam->getWearableType() == driven_type) { diff --git a/indra/llappearance/lllocaltextureobject.cpp b/indra/llappearance/lllocaltextureobject.cpp index b66b51f4e4..ac8a1abb2d 100644 --- a/indra/llappearance/lllocaltextureobject.cpp +++ b/indra/llappearance/lllocaltextureobject.cpp @@ -95,7 +95,7 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(U32 index) const LLTexLayer* LLLocalTextureObject::getTexLayer(const std::string &name) { - for(auto layer : mTexLayers) + for(LLTexLayer* layer : mTexLayers) { if (layer->getName().compare(name) == 0) { diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp index d0f0199d61..dab14851c8 100644 --- a/indra/llappearance/llpolymesh.cpp +++ b/indra/llappearance/llpolymesh.cpp @@ -890,7 +890,7 @@ void LLPolyMesh::dumpDiagInfo() LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; // print each loaded mesh, and it's memory usage - for(const auto& mesh_pair : sGlobalSharedMeshList) + for(const LLPolyMeshSharedDataTable::value_type& mesh_pair : sGlobalSharedMeshList) { const std::string& mesh_name = mesh_pair.first; LLPolyMeshSharedData* mesh = mesh_pair.second; @@ -996,7 +996,7 @@ LLPolyMorphData* LLPolyMesh::getMorphData(const std::string& morph_name) { if (!mSharedData) return NULL; - for (auto morph_data : mSharedData->mMorphData) + for (LLPolyMorphData* morph_data : mSharedData->mMorphData) { if (morph_data->getName() == morph_name) { diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index 1f83f748a1..ca3ecda8c3 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -364,7 +364,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) LLAvatarAppearance* avatarp = mMesh->getAvatar(); LLPolyMorphTargetInfo::volume_info_list_t::iterator iter; - for (auto& volume_info : getInfo()->mVolumeInfoList) + for (LLPolyVolumeMorphInfo& volume_info : getInfo()->mVolumeInfoList) { for (S32 i = 0; i < avatarp->mNumCollisionVolumes; i++) { @@ -640,7 +640,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex ) } // now apply volume changes - for(auto& volume_morph : mVolumeMorphs) + for(LLPolyVolumeMorph& volume_morph : mVolumeMorphs) { LLVector3 scale_delta = volume_morph.mScale * delta_weight; LLVector3 pos_delta = volume_morph.mPos * delta_weight; @@ -733,7 +733,7 @@ void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S3 void LLPolyMorphTarget::applyVolumeChanges(F32 delta_weight) { // now apply volume changes - for(auto& volume_morph : mVolumeMorphs) + for(LLPolyVolumeMorph& volume_morph : mVolumeMorphs) { LLVector3 scale_delta = volume_morph.mScale * delta_weight; LLVector3 pos_delta = volume_morph.mPos * delta_weight; diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index e1460b68de..8712cdd286 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -144,7 +144,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) setWeight(getDefaultWeight()); LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter; - for (auto& bone_info : getInfo()->mBoneInfoList) + for (LLPolySkeletalBoneInfo& bone_info : getInfo()->mBoneInfoList) { LLJoint* joint = mAvatar->getJoint(bone_info.mBoneName); if (!joint) @@ -159,7 +159,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) mJointScales[joint] = bone_info.mScaleDeformation; // apply to children that need to inherit it - for (auto joint : joint->mChildren) + for (LLJoint* joint : joint->mChildren) { LLAvatarJoint* child_joint = (LLAvatarJoint*)joint; if (child_joint->inheritScale()) @@ -194,7 +194,7 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) LLJoint* joint; - for (auto& scale_pair : mJointScales) + for (joint_vec_map_t::value_type& scale_pair : mJointScales) { joint = scale_pair.first; LLVector3 newScale = joint->getScale(); @@ -213,7 +213,7 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) joint->setScale(newScale, true); } - for (auto& offset_pair : mJointOffsets) + for (joint_vec_map_t::value_type& offset_pair : mJointOffsets) { joint = offset_pair.first; LLVector3 newPosition = joint->getPosition(); diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index 611b87a7cf..75815482c9 100644 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -55,7 +55,7 @@ BOOL LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info) //mID = info->mID; // No ID mParamGlobalColorList.reserve(mInfo->mParamColorInfoList.size()); - for (auto color_info : mInfo->mParamColorInfoList) + for (LLTexLayerParamColorInfo* color_info : mInfo->mParamColorInfoList) { LLTexParamGlobalColor* param_color = new LLTexParamGlobalColor(this); if (!param_color->setInfo(color_info, TRUE)) diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 68a021eb9a..6f23b2e04c 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -241,7 +241,7 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node) void LLTexLayerSetInfo::createVisualParams(LLAvatarAppearance *appearance) { //layer_info_list_t mLayerInfoList; - for (auto layer_info : mLayerInfoList) + for (LLTexLayerInfo* layer_info : mLayerInfoList) { layer_info->createVisualParams(appearance); } @@ -284,7 +284,7 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info) //mID = info->mID; // No ID mLayerList.reserve(info->mLayerInfoList.size()); - for (auto layer_info : info->mLayerInfoList) + for (LLTexLayerInfo* layer_info : info->mLayerInfoList) { LLTexLayerInterface *layer = NULL; if (layer_info->isUserSettable()) @@ -343,11 +343,11 @@ BOOL LLTexLayerSet::parseData(LLXmlTreeNode* node) void LLTexLayerSet::deleteCaches() { - for(auto layer : mLayerList) + for(LLTexLayerInterface* layer : mLayerList) { layer->deleteCaches(); } - for (auto layer : mMaskLayerList) + for (LLTexLayerInterface* layer : mMaskLayerList) { layer->deleteCaches(); } @@ -361,7 +361,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* if (mMaskLayerList.size() > 0) { - for (auto layer : mMaskLayerList) + for (LLTexLayerInterface* layer : mMaskLayerList) { if (layer->isInvisibleAlphaMask()) { @@ -391,7 +391,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* if (mIsVisible) { // composite color layers - for(auto layer : mLayerList) + for(LLTexLayerInterface* layer : mLayerList) { if (layer->getRenderPass() == LLTexLayer::RP_COLOR) { @@ -464,7 +464,7 @@ void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S LL_PROFILE_ZONE_SCOPED; memset(data, 255, width * height); - for(auto layer : mLayerList) + for(LLTexLayerInterface* layer : mLayerList) { layer->gatherAlphaMasks(data, origin_x, origin_y, width, height, bound_target); } @@ -516,7 +516,7 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, if (mMaskLayerList.size() > 0) { gGL.setSceneBlendType(LLRender::BT_MULT_ALPHA); - for (auto layer : mMaskLayerList) + for (LLTexLayerInterface* layer : mMaskLayerList) { gGL.flush(); layer->blendAlphaTexture(x,y,width, height); @@ -538,7 +538,7 @@ void LLTexLayerSet::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_ BOOL LLTexLayerSet::isMorphValid() const { - for(const auto layer : mLayerList) + for(const LLTexLayerInterface* layer : mLayerList) { if (layer && !layer->isMorphValid()) { @@ -550,7 +550,7 @@ BOOL LLTexLayerSet::isMorphValid() const void LLTexLayerSet::invalidateMorphMasks() { - for(auto layer : mLayerList) + for(LLTexLayerInterface* layer : mLayerList) { if (layer) { @@ -648,7 +648,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) /* if ("upper_shirt" == local_texture_name) mLocalTexture = TEX_UPPER_SHIRT; */ mLocalTexture = TEX_NUM_INDICES; - for (const auto& dict_pair : LLAvatarAppearance::getDictionary()->getTextures()) + for (const LLAvatarAppearanceDictionary::Textures::value_type& dict_pair : LLAvatarAppearance::getDictionary()->getTextures()) { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = dict_pair.second; if (local_texture_name == texture_dict->mName) @@ -720,7 +720,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) { BOOL success = TRUE; - for (auto color_info : mParamColorInfoList) + for (LLTexLayerParamColorInfo* color_info : mParamColorInfoList) { LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance); if (!param_color->setInfo(color_info, TRUE)) @@ -731,7 +731,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) } } - for (auto alpha_info : mParamAlphaInfoList) + for (LLTexLayerParamAlphaInfo* alpha_info : mParamAlphaInfoList) { LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance); if (!param_alpha->setInfo(alpha_info, TRUE)) @@ -775,7 +775,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab //mID = info->mID; // No ID mParamColorList.reserve(mInfo->mParamColorInfoList.size()); - for (auto color_info : mInfo->mParamColorInfoList) + for (LLTexLayerParamColorInfo* color_info : mInfo->mParamColorInfoList) { LLTexLayerParamColor* param_color; if (!wearable) @@ -800,7 +800,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab } mParamAlphaList.reserve(mInfo->mParamAlphaInfoList.size()); - for (auto alpha_info : mInfo->mParamAlphaInfoList) + for (LLTexLayerParamAlphaInfo* alpha_info : mInfo->mParamAlphaInfoList) { LLTexLayerParamAlpha* param_alpha; if (!wearable) @@ -849,7 +849,7 @@ LLWearableType::EType LLTexLayerInterface::getWearableType() const { LLWearableType::EType type = LLWearableType::WT_INVALID; - for (auto param : mParamColorList) + for (LLTexLayerParamColor* param : mParamColorList) { if (param) { @@ -865,7 +865,7 @@ LLWearableType::EType LLTexLayerInterface::getWearableType() const } } - for (auto param : mParamAlphaList) + for (LLTexLayerParamAlpha* param : mParamAlphaList) { if (param) { @@ -909,14 +909,14 @@ void LLTexLayerInterface::invalidateMorphMasks() LLViewerVisualParam* LLTexLayerInterface::getVisualParamPtr(S32 index) const { LLViewerVisualParam *result = NULL; - for (auto param : mParamColorList) + for (LLTexLayerParamColor* param : mParamColorList) { if (param->getID() == index) { result = param; } } - for (auto param : mParamAlphaList) + for (LLTexLayerParamAlpha* param : mParamAlphaList) { if (param->getID() == index) { @@ -965,7 +965,7 @@ LLTexLayer::~LLTexLayer() //std::for_each(mParamAlphaList.begin(), mParamAlphaList.end(), DeletePointer()); //std::for_each(mParamColorList.begin(), mParamColorList.end(), DeletePointer()); - for(auto& alpha_pair : mAlphaCache) + for (alpha_cache_t::value_type& alpha_pair : mAlphaCache) { U8* alpha_data = alpha_pair.second; ll_aligned_free_32(alpha_data); @@ -991,7 +991,7 @@ BOOL LLTexLayer::setInfo(const LLTexLayerInfo* info, LLWearable* wearable ) //static void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LLColor4 &net_color) { - for (const auto param : param_list) + for (const LLTexLayerParamColor* param : param_list) { LLColor4 param_net = param->getNetColor(); const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)param->getInfo(); @@ -1017,7 +1017,7 @@ void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LL /*virtual*/ void LLTexLayer::deleteCaches() { // Only need to delete caches for alpha params. Color params don't hold extra memory - for (auto param : mParamAlphaList) + for (LLTexLayerParamAlpha* param : mParamAlphaList) { param->deleteCaches(); } @@ -1192,7 +1192,7 @@ const U8* LLTexLayer::getAlphaData() const const LLUUID& uuid = getUUID(); alpha_mask_crc.update((U8*)(&uuid.mData), UUID_BYTES); - for (const auto param : mParamAlphaList) + for (const LLTexLayerParamAlpha* param : mParamAlphaList) { // MULTI-WEARABLE: verify visual parameters used here F32 param_weight = param->getWeight(); @@ -1330,7 +1330,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC // Accumulate alphas LLGLSNoAlphaTest gls_no_alpha_test; gGL.color4f( 1.f, 1.f, 1.f, 1.f ); - for (auto param : mParamAlphaList) + for (LLTexLayerParamAlpha* param : mParamAlphaList) { success &= param->render( x, y, width, height ); if (!success && !force_render) @@ -1405,7 +1405,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC const LLUUID& uuid = getUUID(); alpha_mask_crc.update((U8*)(&uuid.mData), UUID_BYTES); - for (const auto param : mParamAlphaList) + for (const LLTexLayerParamAlpha* param : mParamAlphaList) { F32 param_weight = param->getWeight(); alpha_mask_crc.update((U8*)¶m_weight, sizeof(F32)); @@ -1646,7 +1646,7 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const BOOL success = TRUE; updateWearableCache(); - for (auto wearable : mWearableCache) + for (LLWearable* wearable : mWearableCache) { LLLocalTextureObject *lto = NULL; LLTexLayer *layer = NULL; @@ -1746,14 +1746,14 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const //----------------------------------------------------------------------------- LLTexLayerInterface* LLTexLayerSet::findLayerByName(const std::string& name) { - for (auto layer : mLayerList) + for (LLTexLayerInterface* layer : mLayerList) { if (layer->getName() == name) { return layer; } } - for (auto layer : mMaskLayerList) + for (LLTexLayerInterface* layer : mMaskLayerList) { if (layer->getName() == name) { @@ -1766,7 +1766,7 @@ LLTexLayerInterface* LLTexLayerSet::findLayerByName(const std::string& name) void LLTexLayerSet::cloneTemplates(LLLocalTextureObject *lto, LLAvatarAppearanceDefines::ETextureIndex tex_index, LLWearable *wearable) { // initialize all texlayers with this texture type for this LTO - for(auto layer : mLayerList) + for(LLTexLayerInterface* layer : mLayerList) { LLTexLayerTemplate* layer_template = (LLTexLayerTemplate*)layer; if (layer_template->getInfo()->getLocalTexture() == (S32)tex_index) @@ -1774,7 +1774,7 @@ void LLTexLayerSet::cloneTemplates(LLLocalTextureObject *lto, LLAvatarAppearance lto->addTexLayer(layer_template, wearable); } } - for(auto layer : mMaskLayerList) + for(LLTexLayerInterface* layer : mMaskLayerList) { LLTexLayerTemplate* layer_template = (LLTexLayerTemplate*)layer; if (layer_template->getInfo()->getLocalTexture() == (S32)tex_index) diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 549b1802a7..a288c8955a 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -103,7 +103,7 @@ void LLTexLayerParamAlpha::getCacheByteCount(S32* gl_bytes) { *gl_bytes = 0; - for (auto instance : sInstances) + for (LLTexLayerParamAlpha* instance : sInstances) { LLGLTexture* tex = instance->mCachedProcessedTexture; if (tex) diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 6889304410..10d668d0af 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -60,7 +60,7 @@ LLWearable::LLWearable() // virtual LLWearable::~LLWearable() { - for (auto& vp_pair : mVisualParamIndexMap) + for (visual_param_index_map_t::value_type& vp_pair : mVisualParamIndexMap) { LLVisualParam* vp = vp_pair.second; vp->clearNextParam(); @@ -122,7 +122,7 @@ BOOL LLWearable::exportStream( std::ostream& output_stream ) const // parameters output_stream << "parameters " << mVisualParamIndexMap.size() << "\n"; - for (auto& vp_pair : mVisualParamIndexMap) + for (const visual_param_index_map_t::value_type& vp_pair : mVisualParamIndexMap) { S32 param_id = vp_pair.first; const LLVisualParam* param = vp_pair.second; @@ -133,7 +133,7 @@ BOOL LLWearable::exportStream( std::ostream& output_stream ) const // texture entries output_stream << "textures " << mTEMap.size() << "\n"; - for (auto& te_pair : mTEMap) + for (const te_map_t::value_type& te_pair : mTEMap) { S32 te = te_pair.first; const LLUUID& image_id = te_pair.second->getID(); @@ -158,7 +158,7 @@ void LLWearable::createVisualParams(LLAvatarAppearance *avatarp) } // resync driver parameters to point to the newly cloned driven parameters - for (auto& param_pair : mVisualParamIndexMap) + for (visual_param_index_map_t::value_type& param_pair : mVisualParamIndexMap) { LLVisualParam* param = param_pair.second; LLVisualParam*(LLWearable::*wearable_function)(S32)const = &LLWearable::getVisualParam; @@ -519,7 +519,7 @@ std::vector<LLLocalTextureObject*> LLWearable::getLocalTextureListSeq() { std::vector<LLLocalTextureObject*> result; - for(auto& te_pair : mTEMap) + for(te_map_t::value_type& te_pair : mTEMap) { LLLocalTextureObject* lto = te_pair.second; result.push_back(lto); @@ -543,7 +543,7 @@ void LLWearable::revertValues() //update saved settings so wearable is no longer dirty // One loop should be necessary here - for (auto& vp_pair : mSavedVisualParamMap) + for (param_map_t::value_type& vp_pair : mSavedVisualParamMap) { S32 id = vp_pair.first; LLVisualParam *param = getVisualParam(id); @@ -562,7 +562,7 @@ void LLWearable::saveValues() { //update saved settings so wearable is no longer dirty mSavedVisualParamMap.clear(); - for (auto& vp_pair : mVisualParamIndexMap) + for (const visual_param_index_map_t::value_type& vp_pair : mVisualParamIndexMap) { S32 id = vp_pair.first; LLVisualParam *wearable_param = vp_pair.second; @@ -680,7 +680,7 @@ LLVisualParam* LLWearable::getVisualParam(S32 index) const void LLWearable::getVisualParams(visual_param_vec_t &list) { // add all visual params to the passed-in vector - for(auto& vp_pair : mVisualParamIndexMap) + for(visual_param_index_map_t::value_type& vp_pair : mVisualParamIndexMap) { list.push_back(vp_pair.second); } @@ -688,7 +688,7 @@ void LLWearable::getVisualParams(visual_param_vec_t &list) void LLWearable::animateParams(F32 delta) { - for(auto& vp_pair : mVisualParamIndexMap) + for(visual_param_index_map_t::value_type& vp_pair : mVisualParamIndexMap) { LLVisualParam *param = (LLVisualParam*)vp_pair.second; param->animate(delta); diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index 19b9903a64..ddc508455f 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -123,14 +123,14 @@ void LLAudioEngine::shutdown() cleanupWind(); // Clean up audio sources - for (source_map::value_type src_pair : mAllSources) + for (source_map::value_type& src_pair : mAllSources) { delete src_pair.second; } // Clean up audio data - for (data_map::value_type data_pair : mAllData) + for (data_map::value_type& data_pair : mAllData) { delete data_pair.second; } @@ -308,7 +308,7 @@ void LLAudioEngine::idle() updateChannels(); // Update queued sounds (switch to next queued data if the current has finished playing) - for (source_map::value_type src_pair : mAllSources) + for (source_map::value_type& src_pair : mAllSources) { // This is lame, instead of this I could actually iterate through all the sources // attached to each channel, since only those with active channels @@ -393,7 +393,7 @@ void LLAudioEngine::idle() LLAudioSource *sync_masterp = NULL; LLAudioChannel *master_channelp = NULL; F32 max_sm_priority = -1.f; - for (source_map::value_type src_pair : mAllSources) + for (source_map::value_type& src_pair : mAllSources) { LLAudioSource *sourcep = src_pair.second; if (sourcep->isMuted()) @@ -415,7 +415,7 @@ void LLAudioEngine::idle() { // Synchronize loop slaves with their masters // Update queued sounds (switch to next queued data if the current has finished playing) - for (source_map::value_type src_pair : mAllSources) + for (source_map::value_type& src_pair : mAllSources) { LLAudioSource *sourcep = src_pair.second; @@ -1113,7 +1113,7 @@ void LLAudioEngine::startNextTransfer() } - for (data_map::value_type preload_pair : asp->mPreloadMap) + for (data_map::value_type& preload_pair : asp->mPreloadMap) { LLAudioData *adp = preload_pair.second; if (!adp) @@ -1135,7 +1135,7 @@ void LLAudioEngine::startNextTransfer() { max_pri = -1.f; source_map::iterator source_iter; - for (source_map::value_type source_pair : mAllSources) + for (source_map::value_type& source_pair : mAllSources) { asp = source_pair.second; if (!asp) @@ -1164,7 +1164,7 @@ void LLAudioEngine::startNextTransfer() continue; } - for (data_map::value_type preload_pair : asp->mPreloadMap) + for (data_map::value_type& preload_pair : asp->mPreloadMap) { LLAudioData *adp = preload_pair.second; if (!adp) @@ -1601,7 +1601,7 @@ void LLAudioSource::addAudioData(LLAudioData *adp, const bool set_current) bool LLAudioSource::hasPendingPreloads() const { // Check to see if we've got any preloads on deck for this source - for (data_map::value_type preload_pair : mPreloadMap) + for (const data_map::value_type& preload_pair : mPreloadMap) { LLAudioData *adp = preload_pair.second; // note: a bad UUID will forever be !hasDecodedData() diff --git a/indra/llcharacter/llanimationstates.cpp b/indra/llcharacter/llanimationstates.cpp index c8709dda19..2e78e30405 100644 --- a/indra/llcharacter/llanimationstates.cpp +++ b/indra/llcharacter/llanimationstates.cpp @@ -379,7 +379,7 @@ LLUUID LLAnimationLibrary::stringToAnimState( const std::string& name, BOOL allo if (true_name) { - for (anim_map_t::value_type anim_pair : mAnimMap) + for (anim_map_t::value_type& anim_pair : mAnimMap) { if (anim_pair.second == true_name) { diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index 70f6c0c4c9..47c6d6a7bb 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -156,7 +156,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error } // Recognize all names we've been told are legal. - for (std::map<std::string, std::string>::value_type alias_pair : joint_alias_map) + for (std::map<std::string, std::string>::value_type& alias_pair : joint_alias_map) { makeTranslation( alias_pair.first , alias_pair.second ); } diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index bc0c2ec0d3..6d56d59e8c 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -218,7 +218,7 @@ public: S32 getVisualParamCountInGroup(const EVisualParamGroup group) const { S32 rtn = 0; - for (visual_param_index_map_t::value_type index_pair : mVisualParamIndexMap) + for (const visual_param_index_map_t::value_type& index_pair : mVisualParamIndexMap) { if (index_pair.second->getGroup() == group) { @@ -235,7 +235,7 @@ public: } S32 getVisualParamID(LLVisualParam *id) { - for (visual_param_index_map_t::value_type index_pair : mVisualParamIndexMap) + for (visual_param_index_map_t::value_type& index_pair : mVisualParamIndexMap) { if (index_pair.second == id) return index_pair.first; diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp index e9a4475707..80717d8d26 100644 --- a/indra/llcharacter/llgesture.cpp +++ b/indra/llcharacter/llgesture.cpp @@ -200,7 +200,7 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin boost::char_separator<char> sep(" "); tokenizer tokens(string, sep); - for(std::string cur_token : tokens) + for(const std::string& cur_token : tokens) { LLGesture* gesture = NULL; diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 282db5c88b..280641a1a5 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -67,7 +67,7 @@ void LLVector3OverrideMap::showJointVector3Overrides( std::ostringstream& os ) c map_type::const_iterator max_it = std::max_element(m_map.begin(), m_map.end(), attachment_map_iter_compare_key<map_type::value_type>); - for (const map_type::value_type pos_pair : m_map) + for (const map_type::value_type& pos_pair : m_map) { const LLVector3& pos = pos_pair.second; os << " " << "[" << pos_pair.first <<": " << pos << "]" << ((pos_pair==(*max_it)) ? "*" : ""); @@ -509,7 +509,7 @@ void LLJoint::getAllAttachmentPosOverrides(S32& num_pos_overrides, std::set<LLVector3>& distinct_pos_overrides) const { num_pos_overrides = m_attachmentPosOverrides.count(); - for (LLVector3OverrideMap::map_type::value_type pos_override_pair : m_attachmentPosOverrides.getMap()) + for (const LLVector3OverrideMap::map_type::value_type& pos_override_pair : m_attachmentPosOverrides.getMap()) { distinct_pos_overrides.insert(pos_override_pair.second); } @@ -522,7 +522,7 @@ void LLJoint::getAllAttachmentScaleOverrides(S32& num_scale_overrides, std::set<LLVector3>& distinct_scale_overrides) const { num_scale_overrides = m_attachmentScaleOverrides.count(); - for (LLVector3OverrideMap::map_type::value_type scale_override_pair : m_attachmentScaleOverrides.getMap()) + for (const LLVector3OverrideMap::map_type::value_type& scale_override_pair : m_attachmentScaleOverrides.getMap()) { distinct_scale_overrides.insert(scale_override_pair.second); } @@ -549,7 +549,7 @@ void LLJoint::showAttachmentPosOverrides(const std::string& av_info) const { LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " has " << count << " attachment pos overrides" << LL_ENDL; std::set<LLVector3> distinct_offsets; - for (LLVector3OverrideMap::map_type::value_type pos_override_pair : m_attachmentPosOverrides.getMap()) + for (const LLVector3OverrideMap::map_type::value_type& pos_override_pair : m_attachmentPosOverrides.getMap()) { distinct_offsets.insert(pos_override_pair.second); } @@ -708,7 +708,7 @@ void LLJoint::showAttachmentScaleOverrides(const std::string& av_info) const { LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " has " << count << " attachment scale overrides" << LL_ENDL; std::set<LLVector3> distinct_offsets; - for (LLVector3OverrideMap::map_type::value_type scale_override_pair : m_attachmentScaleOverrides.getMap()) + for (const LLVector3OverrideMap::map_type::value_type& scale_override_pair : m_attachmentScaleOverrides.getMap()) { distinct_offsets.insert(scale_override_pair.second); } diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 04c1475161..d82ce23b4b 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -1999,7 +1999,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const success &= dp.packS32(joint_motionp->mRotationCurve.mNumKeys, "num_rot_keys"); LL_DEBUGS("BVH") << "Joint " << joint_motionp->mJointName << LL_ENDL; - for (RotationCurve::key_map_t::value_type rot_pair : joint_motionp->mRotationCurve.mKeys) + for (RotationCurve::key_map_t::value_type& rot_pair : joint_motionp->mRotationCurve.mKeys) { RotationKey& rot_key = rot_pair.second; U16 time_short = F32_to_U16(rot_key.mTime, 0.f, mJointMotionList->mDuration); @@ -2020,7 +2020,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const } success &= dp.packS32(joint_motionp->mPositionCurve.mNumKeys, "num_pos_keys"); - for (PositionCurve::key_map_t::value_type pos_pair : joint_motionp->mPositionCurve.mKeys) + for (PositionCurve::key_map_t::value_type& pos_pair : joint_motionp->mPositionCurve.mKeys) { PositionKey& pos_key = pos_pair.second; U16 time_short = F32_to_U16(pos_key.mTime, 0.f, mJointMotionList->mDuration); @@ -2394,7 +2394,7 @@ void LLKeyframeDataCache::dumpDiagInfo() LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; // print each loaded mesh, and it's memory usage - for (keyframe_data_map_t::value_type data_pair : sKeyframeDataMap) + for (keyframe_data_map_t::value_type& data_pair : sKeyframeDataMap) { U32 joint_motion_kb; diff --git a/indra/llcharacter/llkeyframemotionparam.cpp b/indra/llcharacter/llkeyframemotionparam.cpp index fce445fee7..c80aabe294 100644 --- a/indra/llcharacter/llkeyframemotionparam.cpp +++ b/indra/llcharacter/llkeyframemotionparam.cpp @@ -64,7 +64,7 @@ LLKeyframeMotionParam::LLKeyframeMotionParam( const LLUUID &id) : LLMotion(id) //----------------------------------------------------------------------------- LLKeyframeMotionParam::~LLKeyframeMotionParam() { - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { motion_list_t& motionList = motion_pair.second; for (const ParameterizedMotion& paramMotion : motionList) @@ -88,7 +88,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotionParam::onInitialize(LLCharacter *ch return STATUS_FAILURE; } - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { motion_list_t& motionList = motion_pair.second; for (const ParameterizedMotion& paramMotion : motionList) @@ -135,7 +135,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotionParam::onInitialize(LLCharacter *ch //----------------------------------------------------------------------------- BOOL LLKeyframeMotionParam::onActivate() { - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { motion_list_t& motionList = motion_pair.second; for (const ParameterizedMotion& paramMotion : motionList) @@ -156,7 +156,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) F32 weightFactor = 1.f / (F32)mParameterizedMotions.size(); // zero out all pose weights - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { motion_list_t& motionList = motion_pair.second; for (const ParameterizedMotion& paramMotion : motionList) @@ -167,7 +167,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) } - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { const std::string& paramName = motion_pair.first; F32* paramValue = (F32 *)mCharacter->getAnimationData(paramName); @@ -270,7 +270,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) //----------------------------------------------------------------------------- void LLKeyframeMotionParam::onDeactivate() { - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { motion_list_t& motionList = motion_pair.second; for (const ParameterizedMotion& paramMotion : motionList) @@ -306,7 +306,7 @@ BOOL LLKeyframeMotionParam::addKeyframeMotion(char *name, const LLUUID &id, char //----------------------------------------------------------------------------- void LLKeyframeMotionParam::setDefaultKeyframeMotion(char *name) { - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { motion_list_t& motionList = motion_pair.second; for (const ParameterizedMotion& paramMotion : motionList) diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index 8716fbff56..96e0d5e8d7 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -1053,7 +1053,7 @@ LLMotion* LLMotionController::findMotion(const LLUUID& id) const void LLMotionController::dumpMotions() { LL_INFOS() << "=====================================" << LL_ENDL; - for (motion_map_t::value_type motion_pair : mAllMotions) + for (motion_map_t::value_type& motion_pair : mAllMotions) { LLUUID id = motion_pair.first; std::string state_string; @@ -1076,7 +1076,7 @@ void LLMotionController::dumpMotions() //----------------------------------------------------------------------------- void LLMotionController::deactivateAllMotions() { - for (motion_map_t::value_type motion_pair : mAllMotions) + for (motion_map_t::value_type& motion_pair : mAllMotions) { LLMotion* motionp = motion_pair.second; deactivateMotionInstance(motionp); @@ -1110,7 +1110,7 @@ void LLMotionController::flushAllMotions() mCharacter->removeAnimationData("Hand Pose"); // restart motions - for (std::vector<std::pair<LLUUID,F32> >::value_type motion_pair : active_motions) + for (std::vector<std::pair<LLUUID,F32> >::value_type& motion_pair : active_motions) { startMotion(motion_pair.first, motion_pair.second); } diff --git a/indra/llcharacter/llpose.cpp b/indra/llcharacter/llpose.cpp index a7156a250b..6f41a0e747 100644 --- a/indra/llcharacter/llpose.cpp +++ b/indra/llcharacter/llpose.cpp @@ -148,7 +148,7 @@ LLJointState* LLPose::findJointState(const std::string &name) void LLPose::setWeight(F32 weight) { joint_map_iterator iter; - for (joint_map_value_type joint_pair : mJointMap) + for (joint_map_value_type& joint_pair : mJointMap) { joint_pair.second->setWeight(weight); } diff --git a/indra/llcharacter/llstatemachine.cpp b/indra/llcharacter/llstatemachine.cpp index 320381e91e..2e8214ffaf 100644 --- a/indra/llcharacter/llstatemachine.cpp +++ b/indra/llcharacter/llstatemachine.cpp @@ -169,7 +169,7 @@ void LLStateDiagram::setDefaultState(LLFSMState& default_state) S32 LLStateDiagram::numDeadendStates() { S32 numDeadends = 0; - for (StateMap::value_type state_pair : mStates) + for (StateMap::value_type& state_pair : mStates) { if (state_pair.second.size() == 0) { @@ -190,7 +190,7 @@ BOOL LLStateDiagram::stateIsValid(LLFSMState& state) LLFSMState* LLStateDiagram::getState(U32 state_id) { - for (StateMap::value_type state_pair : mStates) + for (StateMap::value_type& state_pair : mStates) { if (state_pair.first->getID() == state_id) { @@ -213,13 +213,13 @@ BOOL LLStateDiagram::saveDotFile(const std::string& filename) } apr_file_printf(dot_file, "digraph StateMachine {\n\tsize=\"100,100\";\n\tfontsize=40;\n\tlabel=\"Finite State Machine\";\n\torientation=landscape\n\tratio=.77\n"); - for (StateMap::value_type state_pair : mStates) + for (StateMap::value_type& state_pair : mStates) { apr_file_printf(dot_file, "\t\"%s\" [fontsize=28,shape=box]\n", state_pair.first->getName().c_str()); } apr_file_printf(dot_file, "\t\"All States\" [fontsize=30,style=bold,shape=box]\n"); - for (Transitions::value_type transition_pair : mDefaultTransitions) + for (Transitions::value_type& transition_pair : mDefaultTransitions) { apr_file_printf(dot_file, "\t\"All States\" -> \"%s\" [label = \"%s\",fontsize=24];\n", transition_pair.second->getName().c_str(), transition_pair.second->getName().c_str()); @@ -231,11 +231,11 @@ BOOL LLStateDiagram::saveDotFile(const std::string& filename) } - for (StateMap::value_type state_pair : mStates) + for (StateMap::value_type& state_pair : mStates) { LLFSMState *state = state_pair.first; - for (Transitions::value_type transition_pair : state_pair.second) + for (Transitions::value_type& transition_pair : state_pair.second) { std::string state_name = state->getName(); std::string target_name = transition_pair.second->getName(); @@ -258,15 +258,15 @@ std::ostream& operator<<(std::ostream &s, LLStateDiagram &FSM) s << "Default State: " << FSM.mDefaultState->getName() << "\n"; } - for (LLStateDiagram::Transitions::value_type transition_pair : FSM.mDefaultTransitions) + for (LLStateDiagram::Transitions::value_type& transition_pair : FSM.mDefaultTransitions) { s << "Any State -- " << transition_pair.first->getName() << " --> " << transition_pair.second->getName() << "\n"; } - for (LLStateDiagram::StateMap::value_type state_pair : FSM.mStates) + for (LLStateDiagram::StateMap::value_type& state_pair : FSM.mStates) { - for (LLStateDiagram::Transitions::value_type transition_pair : state_pair.second) + for (LLStateDiagram::Transitions::value_type& transition_pair : state_pair.second) { s << state_pair.first->getName() << " -- " << transition_pair.first->getName() << " --> " << transition_pair.second->getName() << "\n"; diff --git a/indra/llcommon/llallocator_heap_profile.cpp b/indra/llcommon/llallocator_heap_profile.cpp index b2eafde1aa..6dd399e1e3 100644 --- a/indra/llcommon/llallocator_heap_profile.cpp +++ b/indra/llcommon/llallocator_heap_profile.cpp @@ -131,14 +131,13 @@ void LLAllocatorHeapProfile::parse(std::string const & prof_text) void LLAllocatorHeapProfile::dump(std::ostream & out) const { lines_t::const_iterator i; - for(i = mLines.begin(); i != mLines.end(); ++i) + for (const LLAllocatorHeapProfile::line& line : mLines) { - out << i->mLiveCount << ": " << i->mLiveSize << '[' << i->mTotalCount << ": " << i->mTotalSize << "] @"; + out << line.mLiveCount << ": " << line.mLiveSize << '[' << line.mTotalCount << ": " << line.mTotalSize << "] @"; - stack_trace::const_iterator j; - for(j = i->mTrace.begin(); j != i->mTrace.end(); ++j) + for (const stack_marker marker : line.mTrace) { - out << ' ' << *j; + out << ' ' << marker; } out << '\n'; } diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp index e6cc06e8d0..4c84223dad 100644 --- a/indra/llcommon/llassettype.cpp +++ b/indra/llcommon/llassettype.cpp @@ -150,14 +150,12 @@ LLAssetType::EType LLAssetType::lookup(const char* name) LLAssetType::EType LLAssetType::lookup(const std::string& type_name) { const LLAssetDictionary *dict = LLAssetDictionary::getInstance(); - for (LLAssetDictionary::const_iterator iter = dict->begin(); - iter != dict->end(); - iter++) + for (const LLAssetDictionary::value_type& pair : *dict) { - const AssetEntry *entry = iter->second; + const AssetEntry *entry = pair.second; if (type_name == entry->mTypeName) { - return iter->first; + return pair.first; } } return AT_UNKNOWN; @@ -188,14 +186,12 @@ LLAssetType::EType LLAssetType::lookupHumanReadable(const char* name) LLAssetType::EType LLAssetType::lookupHumanReadable(const std::string& readable_name) { const LLAssetDictionary *dict = LLAssetDictionary::getInstance(); - for (LLAssetDictionary::const_iterator iter = dict->begin(); - iter != dict->end(); - iter++) + for (const LLAssetDictionary::value_type& pair : *dict) { - const AssetEntry *entry = iter->second; + const AssetEntry *entry = pair.second; if (entry->mHumanName && (readable_name == entry->mHumanName)) { - return iter->first; + return pair.first; } } return AT_NONE; diff --git a/indra/llcommon/llcallbacklist.cpp b/indra/llcommon/llcallbacklist.cpp index 541ff75ee4..93d0a035da 100644 --- a/indra/llcommon/llcallbacklist.cpp +++ b/indra/llcommon/llcallbacklist.cpp @@ -109,7 +109,7 @@ void LLCallbackList::deleteAllFunctions() void LLCallbackList::callFunctions() { - for (callback_list_t::iterator iter = mCallbackList.begin(); iter != mCallbackList.end(); ) + for (callback_list_t::iterator iter = mCallbackList.begin(); iter != mCallbackList.end(); ) { callback_list_t::iterator curiter = iter++; curiter->first(curiter->second); diff --git a/indra/llcommon/llcallstack.cpp b/indra/llcommon/llcallstack.cpp index 8db291eed1..83d5ae2a63 100644 --- a/indra/llcommon/llcallstack.cpp +++ b/indra/llcommon/llcallstack.cpp @@ -91,10 +91,9 @@ LLCallStack::LLCallStack(S32 skip_count, bool verbose): bool LLCallStack::contains(const std::string& str) { - for (std::vector<std::string>::const_iterator it = m_strings.begin(); - it != m_strings.end(); ++it) + for (const std::string& src_str : m_strings) { - if (it->find(str) != std::string::npos) + if (src_str.find(str) != std::string::npos) { return true; } @@ -105,10 +104,9 @@ bool LLCallStack::contains(const std::string& str) std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack) { #ifndef LL_RELEASE_FOR_DOWNLOAD - std::vector<std::string>::const_iterator it; - for (it=call_stack.m_strings.begin(); it!=call_stack.m_strings.end(); ++it) + for (const std::string& str : call_stack.m_strings) { - s << *it; + s << str; } #else s << "UNAVAILABLE IN RELEASE"; @@ -156,9 +154,9 @@ bool LLContextStrings::contains(const std::string& str) { const std::map<std::string,S32>& strings = LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->m_contextStrings; - for (std::map<std::string,S32>::const_iterator it = strings.begin(); it!=strings.end(); ++it) + for (const std::map<std::string,S32>::value_type& str_pair : strings) { - if (it->first.find(str) != std::string::npos) + if (str_pair.first.find(str) != std::string::npos) { return true; } @@ -171,9 +169,9 @@ void LLContextStrings::output(std::ostream& os) { const std::map<std::string,S32>& strings = LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->m_contextStrings; - for (std::map<std::string,S32>::const_iterator it = strings.begin(); it!=strings.end(); ++it) + for (const std::map<std::string,S32>::value_type& str_pair : strings) { - os << it->first << "[" << it->second << "]" << "\n"; + os << str_pair.first << "[" << str_pair.second << "]" << "\n"; } } diff --git a/indra/llcommon/lldependencies.h b/indra/llcommon/lldependencies.h index 950af4a4ad..fa54a944c8 100644 --- a/indra/llcommon/lldependencies.h +++ b/indra/llcommon/lldependencies.h @@ -514,21 +514,16 @@ public: // former broken behavior has finally been fixed -- and our builds // treat warnings as errors. { - for (typename DepNodeMap::const_iterator nmi = mNodes.begin(), nmend = mNodes.end(); - nmi != nmend; ++nmi) + for (typename const DepNodeMap::value_type& nm_pair : mNodes) { - vmap.insert(typename VertexMap::value_type(nmi->first, vmap.size())); - for (typename DepNode::dep_set::const_iterator ai = nmi->second.after.begin(), - aend = nmi->second.after.end(); - ai != aend; ++ai) + vmap.insert(typename VertexMap::value_type(nm_pair.first, vmap.size())); + for (typename const KEY& after_k : nm_pair.second.after) { - vmap.insert(typename VertexMap::value_type(*ai, vmap.size())); + vmap.insert(typename VertexMap::value_type(after_k, vmap.size())); } - for (typename DepNode::dep_set::const_iterator bi = nmi->second.before.begin(), - bend = nmi->second.before.end(); - bi != bend; ++bi) + for (typename const KEY& before_k : nm_pair.second.before) { - vmap.insert(typename VertexMap::value_type(*bi, vmap.size())); + vmap.insert(typename VertexMap::value_type(before_k, vmap.size())); } } } @@ -536,24 +531,19 @@ public: // all the known key dependencies to integer pairs. EdgeList edges; { - for (typename DepNodeMap::const_iterator nmi = mNodes.begin(), nmend = mNodes.end(); - nmi != nmend; ++nmi) + for (typename const DepNodeMap::value_type& nm_pair : mNodes) { - auto thisnode = vmap[nmi->first]; + auto thisnode = vmap[nm_pair.first]; // after dependencies: build edges from the named node to this one - for (typename DepNode::dep_set::const_iterator ai = nmi->second.after.begin(), - aend = nmi->second.after.end(); - ai != aend; ++ai) + for (typename const KEY& after_k : nm_pair.second.after) { - edges.push_back(EdgeList::value_type(vmap[*ai], thisnode)); + edges.push_back(EdgeList::value_type(vmap[after_k], thisnode)); } // before dependencies: build edges from this node to the // named one - for (typename DepNode::dep_set::const_iterator bi = nmi->second.before.begin(), - bend = nmi->second.before.end(); - bi != bend; ++bi) + for (typename const KEY& before_k : nm_pair.second.before) { - edges.push_back(EdgeList::value_type(thisnode, vmap[*bi])); + edges.push_back(EdgeList::value_type(thisnode, vmap[before_k])); } } } @@ -565,21 +555,19 @@ public: // and we're certain that the associated int values are distinct // indexes. The fact that they're not in order is irrelevant. KeyList vkeys(vmap.size()); - for (typename VertexMap::const_iterator vmi = vmap.begin(), vmend = vmap.end(); - vmi != vmend; ++vmi) + for (typename const VertexMap::value_type& vm_pair : vmap) { - vkeys[vmi->second] = vmi->first; + vkeys[vm_pair.second] = vm_pair.first; } // Walk the sorted output list, building the result into mCache so // we'll have it next time someone asks. mCache.clear(); - for (VertexList::const_iterator svi = sorted.begin(), svend = sorted.end(); - svi != svend; ++svi) + for (const size_t sv : sorted) { - // We're certain that vkeys[*svi] exists. However, there might not + // We're certain that vkeys[sv] exists. However, there might not // yet be a corresponding entry in mNodes. self_type* non_const_this(const_cast<self_type*>(this)); - typename DepNodeMap::iterator found = non_const_this->mNodes.find(vkeys[*svi]); + typename DepNodeMap::iterator found = non_const_this->mNodes.find(vkeys[sv]); if (found != non_const_this->mNodes.end()) { // Make an iterator of appropriate type. diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 519426e9d1..310da2c9f0 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -586,11 +586,9 @@ namespace void Globals::invalidateCallSites() { - for (CallSiteVector::const_iterator i = callSites.begin(); - i != callSites.end(); - ++i) + for (LLError::CallSite* site : callSites) { - (*i)->invalidate(); + site->invalidate(); } callSites.clear(); @@ -1224,12 +1222,8 @@ namespace std::string escaped_message; LLMutexLock lock(&s->mRecorderMutex); - for (Recorders::const_iterator i = s->mRecorders.begin(); - i != s->mRecorders.end(); - ++i) + for (LLError::RecorderPtr& r : s->mRecorders) { - LLError::RecorderPtr r = *i; - if (!r->enabled()) { continue; diff --git a/indra/llcommon/llevent.cpp b/indra/llcommon/llevent.cpp index 633df01588..501d06e3cd 100644 --- a/indra/llcommon/llevent.cpp +++ b/indra/llcommon/llevent.cpp @@ -203,10 +203,9 @@ void LLSimpleDispatcher::removeListener(LLEventListener* listener) std::vector<LLListenerEntry> LLSimpleDispatcher::getListeners() const { std::vector<LLListenerEntry> ret; - std::vector<LLListenerEntry>::const_iterator itor; - for (itor=mListeners.begin(); itor!=mListeners.end(); ++itor) + for (const LLListenerEntry& entry : mListeners) { - ret.push_back(*itor); + ret.push_back(entry); } return ret; @@ -215,14 +214,12 @@ std::vector<LLListenerEntry> LLSimpleDispatcher::getListeners() const // virtual bool LLSimpleDispatcher::fireEvent(LLPointer<LLEvent> event, LLSD filter) { - std::vector<LLListenerEntry>::iterator itor; std::string filter_string = filter.asString(); - for (itor=mListeners.begin(); itor!=mListeners.end(); ++itor) + for (LLListenerEntry& entry : mListeners) { - LLListenerEntry& entry = *itor; if (filter_string == "" || entry.filter.asString() == filter_string) { - (entry.listener)->handleEvent(event, (*itor).userdata); + (entry.listener)->handleEvent(event, entry.userdata); } } return true; @@ -276,10 +273,9 @@ void LLSimpleListener::clearDispatchers() bool LLSimpleListener::handleAttach(LLEventDispatcher *dispatcher) { // Add dispatcher if it doesn't already exist - std::vector<LLEventDispatcher *>::iterator itor; - for (itor = mDispatchers.begin(); itor != mDispatchers.end(); ++itor) + for (LLEventDispatcher* disp : mDispatchers) { - if ((*itor) == dispatcher) return true; + if (disp == dispatcher) return true; } mDispatchers.push_back(dispatcher); return true; diff --git a/indra/llcommon/llheteromap.cpp b/indra/llcommon/llheteromap.cpp index 7c19196e0c..c84e49d085 100644 --- a/indra/llcommon/llheteromap.cpp +++ b/indra/llcommon/llheteromap.cpp @@ -22,11 +22,11 @@ LLHeteroMap::~LLHeteroMap() { // For each entry in our map, we must call its deleter, which is the only // record we have of its original type. - for (TypeMap::iterator mi(mMap.begin()), me(mMap.end()); mi != me; ++mi) + for (TypeMap::value_type& pair : mMap) { - // mi->second is the std::pair; mi->second.first is the void*; - // mi->second.second points to the deleter function - (mi->second.second)(mi->second.first); - mi->second.first = NULL; + // pair.second is the std::pair; pair.second.first is the void*; + // pair.second.second points to the deleter function + (pair.second.second)(pair.second.first); + pair.second.first = NULL; } } diff --git a/indra/llcommon/llinitdestroyclass.cpp b/indra/llcommon/llinitdestroyclass.cpp index e6382a7924..e3b9e6d099 100644 --- a/indra/llcommon/llinitdestroyclass.cpp +++ b/indra/llcommon/llinitdestroyclass.cpp @@ -21,10 +21,9 @@ void LLCallbackRegistry::fireCallbacks() const { - for (FuncList::const_iterator fi = mCallbacks.begin(), fe = mCallbacks.end(); - fi != fe; ++fi) + for (FuncList::value_type pair : mCallbacks) { - LL_INFOS("LLInitDestroyClass") << "calling " << fi->first << "()" << LL_ENDL; - fi->second(); + LL_INFOS("LLInitDestroyClass") << "calling " << pair.first << "()" << LL_ENDL; + pair.second(); } } diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp index aa2f4eb289..9d3394b4f7 100644 --- a/indra/llcommon/llinitparam.cpp +++ b/indra/llcommon/llinitparam.cpp @@ -207,10 +207,10 @@ namespace LLInitParam if (!mValidated) { const BlockDescriptor& block_data = mostDerivedBlockDescriptor(); - for (BlockDescriptor::param_validation_list_t::const_iterator it = block_data.mValidationList.begin(); it != block_data.mValidationList.end(); ++it) + for (const BlockDescriptor::param_validation_list_t::value_type& pair : block_data.mValidationList) { - const Param* param = getParamFromHandle(it->first); - if (!it->second(param)) + const Param* param = getParamFromHandle(pair.first); + if (!pair.second(param)) { if (emit_errors) { @@ -235,13 +235,11 @@ namespace LLInitParam // unnamed param is like LLView::Params::rect - implicit const BlockDescriptor& block_data = mostDerivedBlockDescriptor(); - for (BlockDescriptor::param_list_t::const_iterator it = block_data.mUnnamedParams.begin(); - it != block_data.mUnnamedParams.end(); - ++it) + for (const ParamDescriptorPtr& ptr : block_data.mUnnamedParams) { - param_handle_t param_handle = (*it)->mParamHandle; + param_handle_t param_handle = ptr->mParamHandle; const Param* param = getParamFromHandle(param_handle); - ParamDescriptor::serialize_func_t serialize_func = (*it)->mSerializeFunc; + ParamDescriptor::serialize_func_t serialize_func = ptr->mSerializeFunc; if (serialize_func && predicate_rule.check(ll_make_predicate(PROVIDED, param->anyProvided()))) { const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL; @@ -249,23 +247,19 @@ namespace LLInitParam } } - for(BlockDescriptor::param_map_t::const_iterator it = block_data.mNamedParams.begin(); - it != block_data.mNamedParams.end(); - ++it) + for (const BlockDescriptor::param_map_t::value_type& pair : block_data.mNamedParams) { - param_handle_t param_handle = it->second->mParamHandle; + param_handle_t param_handle = pair.second->mParamHandle; const Param* param = getParamFromHandle(param_handle); - ParamDescriptor::serialize_func_t serialize_func = it->second->mSerializeFunc; + ParamDescriptor::serialize_func_t serialize_func = pair.second->mSerializeFunc; if (serialize_func && predicate_rule.check(ll_make_predicate(PROVIDED, param->anyProvided()))) { // Ensure this param has not already been serialized // Prevents <rect> from being serialized as its own tag. bool duplicate = false; - for (BlockDescriptor::param_list_t::const_iterator it2 = block_data.mUnnamedParams.begin(); - it2 != block_data.mUnnamedParams.end(); - ++it2) + for (const ParamDescriptorPtr& ptr : block_data.mUnnamedParams) { - if (param_handle == (*it2)->mParamHandle) + if (param_handle == ptr->mParamHandle) { duplicate = true; break; @@ -279,7 +273,7 @@ namespace LLInitParam continue; } - name_stack.push_back(std::make_pair(it->first, !duplicate)); + name_stack.push_back(std::make_pair(pair.first, !duplicate)); const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL; serialized |= serialize_func(*param, parser, name_stack, predicate_rule, diff_param); name_stack.pop_back(); @@ -300,45 +294,39 @@ namespace LLInitParam // unnamed param is like LLView::Params::rect - implicit const BlockDescriptor& block_data = mostDerivedBlockDescriptor(); - for (BlockDescriptor::param_list_t::const_iterator it = block_data.mUnnamedParams.begin(); - it != block_data.mUnnamedParams.end(); - ++it) + for (const ParamDescriptorPtr& ptr : block_data.mUnnamedParams) { - param_handle_t param_handle = (*it)->mParamHandle; + param_handle_t param_handle = ptr->mParamHandle; const Param* param = getParamFromHandle(param_handle); - ParamDescriptor::inspect_func_t inspect_func = (*it)->mInspectFunc; + ParamDescriptor::inspect_func_t inspect_func = ptr->mInspectFunc; if (inspect_func) { name_stack.push_back(std::make_pair("", true)); - inspect_func(*param, parser, name_stack, (*it)->mMinCount, (*it)->mMaxCount); + inspect_func(*param, parser, name_stack, ptr->mMinCount, ptr->mMaxCount); name_stack.pop_back(); } } - for(BlockDescriptor::param_map_t::const_iterator it = block_data.mNamedParams.begin(); - it != block_data.mNamedParams.end(); - ++it) + for(const BlockDescriptor::param_map_t::value_type& pair : block_data.mNamedParams) { - param_handle_t param_handle = it->second->mParamHandle; + param_handle_t param_handle = pair.second->mParamHandle; const Param* param = getParamFromHandle(param_handle); - ParamDescriptor::inspect_func_t inspect_func = it->second->mInspectFunc; + ParamDescriptor::inspect_func_t inspect_func = pair.second->mInspectFunc; if (inspect_func) { // Ensure this param has not already been inspected bool duplicate = false; - for (BlockDescriptor::param_list_t::const_iterator it2 = block_data.mUnnamedParams.begin(); - it2 != block_data.mUnnamedParams.end(); - ++it2) + for (const ParamDescriptorPtr ptr : block_data.mUnnamedParams) { - if (param_handle == (*it2)->mParamHandle) + if (param_handle == ptr->mParamHandle) { duplicate = true; break; } } - name_stack.push_back(std::make_pair(it->first, !duplicate)); - inspect_func(*param, parser, name_stack, it->second->mMinCount, it->second->mMaxCount); + name_stack.push_back(std::make_pair(pair.first, !duplicate)); + inspect_func(*param, parser, name_stack, pair.second->mMinCount, pair.second->mMaxCount); name_stack.pop_back(); } } @@ -382,12 +370,10 @@ namespace LLInitParam } // try to parse unnamed parameters, in declaration order - for ( BlockDescriptor::param_list_t::iterator it = block_data.mUnnamedParams.begin(); - it != block_data.mUnnamedParams.end(); - ++it) + for (ParamDescriptorPtr& ptr : block_data.mUnnamedParams) { - Param* paramp = getParamFromHandle((*it)->mParamHandle); - ParamDescriptor::deserialize_func_t deserialize_func = (*it)->mDeserializeFunc; + Param* paramp = getParamFromHandle(ptr->mParamHandle); + ParamDescriptor::deserialize_func_t deserialize_func = ptr->mDeserializeFunc; if (deserialize_func && deserialize_func(*paramp, p, name_stack_range, new_name)) { @@ -453,12 +439,9 @@ namespace LLInitParam { param_handle_t handle = getHandleFromParam(¶m); BlockDescriptor& descriptor = mostDerivedBlockDescriptor(); - BlockDescriptor::all_params_list_t::iterator end_it = descriptor.mAllParams.end(); - for (BlockDescriptor::all_params_list_t::iterator it = descriptor.mAllParams.begin(); - it != end_it; - ++it) + for (ParamDescriptorPtr& ptr : descriptor.mAllParams) { - if ((*it)->mParamHandle == handle) return *it; + if (ptr->mParamHandle == handle) return ptr; } return ParamDescriptorPtr(); } @@ -468,17 +451,14 @@ namespace LLInitParam bool BaseBlock::mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { bool some_param_changed = false; - BlockDescriptor::all_params_list_t::const_iterator end_it = block_data.mAllParams.end(); - for (BlockDescriptor::all_params_list_t::const_iterator it = block_data.mAllParams.begin(); - it != end_it; - ++it) + for (const ParamDescriptorPtr& ptr : block_data.mAllParams) { - const Param* other_paramp = other.getParamFromHandle((*it)->mParamHandle); - ParamDescriptor::merge_func_t merge_func = (*it)->mMergeFunc; + const Param* other_paramp = other.getParamFromHandle(ptr->mParamHandle); + ParamDescriptor::merge_func_t merge_func = ptr->mMergeFunc; if (merge_func) { - Param* paramp = getParamFromHandle((*it)->mParamHandle); - llassert(paramp->getEnclosingBlockOffset() == (*it)->mParamHandle); + Param* paramp = getParamFromHandle(ptr->mParamHandle); + llassert(paramp->getEnclosingBlockOffset() == ptr->mParamHandle); some_param_changed |= merge_func(*paramp, *other_paramp, overwrite); } } diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 7f5b9b4ac2..9edc7e40f3 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -325,13 +325,11 @@ namespace LLInitParam std::string calcValueName(const value_t& value) const { value_name_map_t* map = getValueNames(); - for (typename value_name_map_t::iterator it = map->begin(), end_it = map->end(); - it != end_it; - ++it) + for (typename value_name_map_t::value_type& map_pair : *map) { - if (ParamCompare<T>::equals(it->second, value)) + if (ParamCompare<T>::equals(map_pair.second, value)) { - return it->first; + return map_pair.first; } } @@ -376,11 +374,9 @@ namespace LLInitParam static std::vector<std::string> sValues; value_name_map_t* map = getValueNames(); - for (typename value_name_map_t::iterator it = map->begin(), end_it = map->end(); - it != end_it; - ++it) + for (typename value_name_map_t::value_type& map_pair : *map) { - sValues.push_back(it->first); + sValues.push_back(map_pair.first); } return &sValues; } diff --git a/indra/llcommon/llkeybind.cpp b/indra/llcommon/llkeybind.cpp index 12e57ae94b..b89160cc55 100644 --- a/indra/llcommon/llkeybind.cpp +++ b/indra/llcommon/llkeybind.cpp @@ -207,9 +207,9 @@ bool LLKeyBind::operator!=(const LLKeyBind& rhs) bool LLKeyBind::isEmpty() const { - for (data_vector_t::const_iterator iter = mData.begin(); iter != mData.end(); iter++) + for (const LLKeyData& key_data : mData) { - if (!iter->isEmpty()) return false; + if (!key_data.isEmpty()) return false; } return true; } @@ -225,12 +225,11 @@ LLKeyBind::data_vector_t::const_iterator LLKeyBind::endNonEmpty() const LLSD LLKeyBind::asLLSD() const { LLSD data; - auto end{ endNonEmpty() }; - for (auto it = mData.begin(); it < end; ++it) + for (const LLKeyData& key_data : mData) { // append intermediate entries even if empty to not affect visual // representation - data.append(it->asLLSD()); + data.append(key_data.asLLSD()); } return data; } @@ -243,9 +242,9 @@ bool LLKeyBind::canHandle(EMouseClickType mouse, KEY key, MASK mask) const return false; } - for (data_vector_t::const_iterator iter = mData.begin(); iter != mData.end(); iter++) + for (const LLKeyData& key_data : mData) { - if (iter->canHandle(mouse, key, mask)) + if (key_data.canHandle(mouse, key, mask)) { return true; } @@ -267,12 +266,12 @@ bool LLKeyBind::hasKeyData(EMouseClickType mouse, KEY key, MASK mask, bool ignor { if (mouse != CLICK_NONE || key != KEY_NONE) { - for (data_vector_t::const_iterator iter = mData.begin(); iter != mData.end(); iter++) + for (const LLKeyData& key_data : mData) { - if (iter->mKey == key - && iter->mMask == mask - && iter->mMouse == mouse - && iter->mIgnoreMasks == ignore) + if (key_data.mKey == key + && key_data.mMask == mask + && key_data.mMouse == mouse + && key_data.mIgnoreMasks == ignore) { return true; } @@ -354,16 +353,16 @@ void LLKeyBind::replaceKeyData(const LLKeyData& data, U32 index) { // if both click and key are none (isEmpty()), we are inserting a placeholder, we don't want to reset anything // otherwise reset identical key - for (data_vector_t::iterator iter = mData.begin(); iter != mData.end(); iter++) + for (LLKeyData& key_data : mData) { - if (iter->mKey == data.mKey - && iter->mMouse == data.mMouse - && iter->mIgnoreMasks == data.mIgnoreMasks - && iter->mMask == data.mMask) + if (key_data.mKey == data.mKey + && key_data.mMouse == data.mMouse + && key_data.mIgnoreMasks == data.mIgnoreMasks + && key_data.mMask == data.mMask) { // Replacing only fully equal combinations even in case 'ignore' is set // Reason: Simplicity and user might decide to do a 'move' command as W and Shift+Ctrl+W, and 'run' as Shift+W - iter->reset(); + key_data.reset(); break; } } diff --git a/indra/llcommon/llmetricperformancetester.cpp b/indra/llcommon/llmetricperformancetester.cpp index 864ecf650b..ab509b46eb 100644 --- a/indra/llcommon/llmetricperformancetester.cpp +++ b/indra/llcommon/llmetricperformancetester.cpp @@ -42,9 +42,9 @@ LLMetricPerformanceTesterBasic::name_tester_map_t LLMetricPerformanceTesterBasic /*static*/ void LLMetricPerformanceTesterBasic::cleanupClass() { - for (name_tester_map_t::iterator iter = sTesterMap.begin() ; iter != sTesterMap.end() ; ++iter) + for (name_tester_map_t::value_type& pair : sTesterMap) { - delete iter->second ; + delete pair.second; } sTesterMap.clear() ; } @@ -154,10 +154,9 @@ void LLMetricPerformanceTesterBasic::doAnalysisMetrics(std::string baseline, std llofstream os(output.c_str()); os << "Label, Metric, Base(B), Target(T), Diff(T-B), Percentage(100*T/B)\n"; - for(LLMetricPerformanceTesterBasic::name_tester_map_t::iterator iter = LLMetricPerformanceTesterBasic::sTesterMap.begin() ; - iter != LLMetricPerformanceTesterBasic::sTesterMap.end() ; ++iter) + for (LLMetricPerformanceTesterBasic::name_tester_map_t::value_type& pair : LLMetricPerformanceTesterBasic::sTesterMap) { - LLMetricPerformanceTesterBasic* tester = ((LLMetricPerformanceTesterBasic*)iter->second) ; + LLMetricPerformanceTesterBasic* tester = ((LLMetricPerformanceTesterBasic*)pair.second); tester->analyzePerformance(&os, &base, ¤t) ; } diff --git a/indra/llcommon/llnametable.h b/indra/llcommon/llnametable.h index d3283543f3..2c8e71263e 100644 --- a/indra/llcommon/llnametable.h +++ b/indra/llcommon/llnametable.h @@ -86,12 +86,10 @@ public: // O(N)! (currently only used in one place... (newsim/llstate.cpp)) const char *resolveData(const DATA &data) const { - const_iter_t iter = mNameMap.begin(); - const_iter_t end = mNameMap.end(); - for (; iter != end; ++iter) + for (const name_map_t::value_type& pair : mNameMap) { - if (iter->second == data) - return iter->first; + if (pair.second == data) + return pair.first; } return NULL; } diff --git a/indra/llcommon/llpriqueuemap.h b/indra/llcommon/llpriqueuemap.h index d8d3edd48a..030e2e0f21 100644 --- a/indra/llcommon/llpriqueuemap.h +++ b/indra/llcommon/llpriqueuemap.h @@ -115,9 +115,9 @@ public: LL_WARNS() << "Data not on priority queue!" << LL_ENDL; // OK, try iterating through all of the data and seeing if we just screwed up the priority // somehow. - for (iter = mMap.begin(); iter != mMap.end(); iter++) + for (pqm_pair pair : mMap) { - if ((*(iter)).second == data) + if (pair.second == data) { LL_ERRS() << "Data on priority queue but priority not matched!" << LL_ENDL; } diff --git a/indra/llcommon/llregistry.h b/indra/llcommon/llregistry.h index 750fe9fdc8..e272d7a9b8 100644 --- a/indra/llcommon/llregistry.h +++ b/indra/llcommon/llregistry.h @@ -141,11 +141,9 @@ public: ptr_value_t getValue(ref_const_key_t key) { - for(scope_list_iterator_t it = mActiveScopes.begin(); - it != mActiveScopes.end(); - ++it) + for(Registrar* scope : mActiveScopes) { - ptr_value_t valuep = (*it)->getValue(key); + ptr_value_t valuep = scope->getValue(key); if (valuep != NULL) return valuep; } return mDefaultRegistrar.getValue(key); @@ -153,11 +151,9 @@ public: ptr_const_value_t getValue(ref_const_key_t key) const { - for(scope_list_const_iterator_t it = mActiveScopes.begin(); - it != mActiveScopes.end(); - ++it) + for(const Registrar* scope : mActiveScopes) { - ptr_value_t valuep = (*it)->getValue(key); + ptr_const_value_t valuep = scope->getValue(key); if (valuep != NULL) return valuep; } return mDefaultRegistrar.getValue(key); @@ -165,11 +161,9 @@ public: bool exists(ref_const_key_t key) const { - for(scope_list_const_iterator_t it = mActiveScopes.begin(); - it != mActiveScopes.end(); - ++it) + for(const Registrar* scope : mActiveScopes) { - if ((*it)->exists(key)) return true; + if (scope->exists(key)) return true; } return mDefaultRegistrar.exists(key); @@ -177,11 +171,9 @@ public: bool empty() const { - for(scope_list_const_iterator_t it = mActiveScopes.begin(); - it != mActiveScopes.end(); - ++it) + for(const Registrar* scope : mActiveScopes) { - if (!(*it)->empty()) return false; + if (!scope->empty()) return false; } return mDefaultRegistrar.empty(); diff --git a/indra/llcommon/llsdparam.cpp b/indra/llcommon/llsdparam.cpp index af4ccf25fd..30f49b27ea 100644 --- a/indra/llcommon/llsdparam.cpp +++ b/indra/llcommon/llsdparam.cpp @@ -113,11 +113,9 @@ void LLParamSDParser::writeSDImpl(LLSD& sd, const LLInitParam::BaseBlock& block, /*virtual*/ std::string LLParamSDParser::getCurrentElementName() { std::string full_name = "sd"; - for (name_stack_t::iterator it = mNameStack.begin(); - it != mNameStack.end(); - ++it) + for (name_stack_t::value_type& stack_pair : mNameStack) { - full_name += llformat("[%s]", it->first.c_str()); + full_name += llformat("[%s]", stack_pair.first.c_str()); } return full_name; diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index 8e90d1e8b8..f70bee9903 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -148,10 +148,9 @@ LLSD ll_binary_from_string(const LLSD& sd) std::vector<U8> binary_value; std::string string_value = sd.asString(); - for (std::string::iterator iter = string_value.begin(); - iter != string_value.end(); ++iter) + for (const U8 c : string_value) { - binary_value.push_back(*iter); + binary_value.push_back(c); } binary_value.push_back('\0'); diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 1fd6cac14a..7ba5c8c241 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -1668,13 +1668,13 @@ std::basic_string<T> LLStringUtilBase<T>::quote(const string_type& str, // For whatever reason, we must quote this string. string_type result; result.push_back('"'); - for (typename string_type::const_iterator ci(str.begin()), cend(str.end()); ci != cend; ++ci) + for (typename const S8 c : str) { - if (*ci == '"') + if (c == '"') { result.append(escape); } - result.push_back(*ci); + result.push_back(c); } result.push_back('"'); return result; diff --git a/indra/llcommon/llstringtable.cpp b/indra/llcommon/llstringtable.cpp index f288999964..92a5e777a6 100644 --- a/indra/llcommon/llstringtable.cpp +++ b/indra/llcommon/llstringtable.cpp @@ -89,9 +89,8 @@ LLStringTable::~LLStringTable() { if (mStringList[i]) { - string_list_t::iterator iter; - for (iter = mStringList[i]->begin(); iter != mStringList[i]->end(); iter++) - delete *iter; // *iter = (LLStringTableEntry*) + for (LLStringTableEntry* entry : *mStringList[i]) + delete entry; } delete mStringList[i]; } @@ -156,9 +155,9 @@ LLStringTableEntry* LLStringTable::checkStringEntry(const char *str) if (str) { char *ret_val; - LLStringTableEntry *entry; U32 hash_value = hash_my_string(str, mMaxEntries); #if STRING_TABLE_HASH_MAP + LLStringTableEntry *entry; #if 1 // Microsoft string_hash_t::iterator lower = mStringHash.lower_bound(hash_value); string_hash_t::iterator upper = mStringHash.upper_bound(hash_value); @@ -180,10 +179,8 @@ LLStringTableEntry* LLStringTable::checkStringEntry(const char *str) string_list_t *strlist = mStringList[hash_value]; if (strlist) { - string_list_t::iterator iter; - for (iter = strlist->begin(); iter != strlist->end(); iter++) + for (LLStringTableEntry* entry : *strlist) { - entry = *iter; ret_val = entry->mString; if (!strncmp(ret_val, str, MAX_STRINGS_LENGTH)) { @@ -226,9 +223,9 @@ LLStringTableEntry* LLStringTable::addStringEntry(const char *str) if (str) { char *ret_val = NULL; - LLStringTableEntry *entry; U32 hash_value = hash_my_string(str, mMaxEntries); #if STRING_TABLE_HASH_MAP + LLStringTableEntry *entry; #if 1 // Microsoft string_hash_t::iterator lower = mStringHash.lower_bound(hash_value); string_hash_t::iterator upper = mStringHash.upper_bound(hash_value); @@ -257,10 +254,8 @@ LLStringTableEntry* LLStringTable::addStringEntry(const char *str) if (strlist) { - string_list_t::iterator iter; - for (iter = strlist->begin(); iter != strlist->end(); iter++) + for (LLStringTableEntry* entry : *strlist) { - entry = *iter; ret_val = entry->mString; if (!strncmp(ret_val, str, MAX_STRINGS_LENGTH)) { @@ -294,10 +289,10 @@ void LLStringTable::removeString(const char *str) if (str) { char *ret_val; - LLStringTableEntry *entry; U32 hash_value = hash_my_string(str, mMaxEntries); #if STRING_TABLE_HASH_MAP { + LLStringTableEntry *entry; #if 1 // Microsoft string_hash_t::iterator lower = mStringHash.lower_bound(hash_value); string_hash_t::iterator upper = mStringHash.upper_bound(hash_value); @@ -331,10 +326,8 @@ void LLStringTable::removeString(const char *str) if (strlist) { - string_list_t::iterator iter; - for (iter = strlist->begin(); iter != strlist->end(); iter++) + for (LLStringTableEntry* entry : *strlist) { - entry = *iter; ret_val = entry->mString; if (!strncmp(ret_val, str, MAX_STRINGS_LENGTH)) { diff --git a/indra/llcommon/llstringtable.h b/indra/llcommon/llstringtable.h index ff09e71677..0a292c8bac 100644 --- a/indra/llcommon/llstringtable.h +++ b/indra/llcommon/llstringtable.h @@ -136,9 +136,9 @@ public: for (S32 i = 0; i<mTableSize; i++) { string_set_t& stringset = mStringList[i]; - for (string_set_t::iterator iter = stringset.begin(); iter != stringset.end(); iter++) + for (LLStdStringHandle str : stringset) { - delete *iter; + delete str; } stringset.clear(); } diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index dd148dd08a..a8dcc5226a 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -773,11 +773,9 @@ void PeriodicRecording::handleReset() } else { - for (std::vector<Recording>::iterator it = mRecordingPeriods.begin(), end_it = mRecordingPeriods.end(); - it != end_it; - ++it) + for (Recording& rec : mRecordingPeriods) { - it->reset(); + rec.reset(); } } mCurPeriod = 0; diff --git a/indra/llcommon/lltracethreadrecorder.cpp b/indra/llcommon/lltracethreadrecorder.cpp index 4028a5ce97..282c454a2a 100644 --- a/indra/llcommon/lltracethreadrecorder.cpp +++ b/indra/llcommon/lltracethreadrecorder.cpp @@ -284,13 +284,11 @@ void ThreadRecorder::pullFromChildren() AccumulatorBufferGroup& target_recording_buffers = mActiveRecordings.back()->mPartialRecording; target_recording_buffers.sync(); - for (child_thread_recorder_list_t::iterator it = mChildThreadRecorders.begin(), end_it = mChildThreadRecorders.end(); - it != end_it; - ++it) - { LLMutexLock lock(&(*it)->mSharedRecordingMutex); + for (LLTrace::ThreadRecorder* rec : mChildThreadRecorders) + { LLMutexLock lock(&(rec->mSharedRecordingMutex)); - target_recording_buffers.merge((*it)->mSharedRecordingBuffers); - (*it)->mSharedRecordingBuffers.reset(); + target_recording_buffers.merge(rec->mSharedRecordingBuffers); + rec->mSharedRecordingBuffers.reset(); } } #endif diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index 22711a83d2..4fb92a8f3e 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -663,9 +663,9 @@ LLSD LLURI::pathArray() const tokenizer::iterator end = tokens.end(); LLSD params; - for ( ; it != end; ++it) + for (const std::string& str : tokens) { - params.append(*it); + params.append(str); } return params; } diff --git a/indra/llcommon/llworkerthread.cpp b/indra/llcommon/llworkerthread.cpp index 97838e296e..e5eda1eac7 100644 --- a/indra/llcommon/llworkerthread.cpp +++ b/indra/llcommon/llworkerthread.cpp @@ -69,11 +69,11 @@ void LLWorkerThread::clearDeleteList() << " entries in delete list." << LL_ENDL; mDeleteMutex->lock(); - for (delete_list_t::iterator iter = mDeleteList.begin(); iter != mDeleteList.end(); ++iter) + for (LLWorkerClass* worker : mDeleteList) { - (*iter)->mRequestHandle = LLWorkerThread::nullHandle(); - (*iter)->clearFlags(LLWorkerClass::WCF_HAVE_WORK); - delete *iter ; + worker->mRequestHandle = LLWorkerThread::nullHandle(); + worker->clearFlags(LLWorkerClass::WCF_HAVE_WORK); + delete worker; } mDeleteList.clear() ; mDeleteMutex->unlock() ; @@ -108,15 +108,12 @@ size_t LLWorkerThread::update(F32 max_time_ms) } mDeleteMutex->unlock(); // abort and delete after releasing mutex - for (std::vector<LLWorkerClass*>::iterator iter = abort_list.begin(); - iter != abort_list.end(); ++iter) + for (LLWorkerClass* worker : abort_list) { - (*iter)->abortWork(false); + worker->abortWork(false); } - for (std::vector<LLWorkerClass*>::iterator iter = delete_list.begin(); - iter != delete_list.end(); ++iter) + for (LLWorkerClass* worker : delete_list) { - LLWorkerClass* worker = *iter; if (worker->mRequestHandle) { // Finished but not completed @@ -124,7 +121,7 @@ size_t LLWorkerThread::update(F32 max_time_ms) worker->mRequestHandle = LLWorkerThread::nullHandle(); worker->clearFlags(LLWorkerClass::WCF_HAVE_WORK); } - delete *iter; + delete worker; } // delete and aborted entries mean there's still work to do res += delete_list.size() + abort_list.size(); |