diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp index f49ad9826fba254cbecd9e5862e374c4b68976c4..062f9ceddea48177ac1a1ba7735180e7332d7b31 100644 --- a/indra/llappearance/lldriverparam.cpp +++ b/indra/llappearance/lldriverparam.cpp @@ -232,19 +232,19 @@ void LLDriverParam::setWeight(F32 weight) //-------|----|-------|----|-------> driver // | min1 max1 max2 min2 - for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ ) + for(LLDrivenEntry& driven : mDriven ) { - LLDrivenEntry* driven = &(*iter); - LLDrivenEntryInfo* info = driven->mInfo; + LLDrivenEntryInfo* info = driven.mInfo; + LLViewerVisualParam* driven_param = driven.mParam; F32 driven_weight = 0.f; - F32 driven_min = driven->mParam->getMinWeight(); - F32 driven_max = driven->mParam->getMaxWeight(); + F32 driven_min = driven_param->getMinWeight(); + F32 driven_max = driven_param->getMaxWeight(); if (mIsAnimating) { // driven param doesn't interpolate (textures, for example) - if (!driven->mParam->getAnimating()) + if (!driven_param->getAnimating()) { continue; } @@ -268,7 +268,7 @@ void LLDriverParam::setWeight(F32 weight) driven_weight = driven_min; } - setDrivenWeight(driven,driven_weight); + setDrivenWeight(&driven,driven_weight); continue; } else @@ -292,13 +292,13 @@ void LLDriverParam::setWeight(F32 weight) driven_weight = driven_min; } - setDrivenWeight(driven,driven_weight); + setDrivenWeight(&driven,driven_weight); continue; } } - driven_weight = getDrivenWeight(driven, mCurWeight); - setDrivenWeight(driven,driven_weight); + driven_weight = getDrivenWeight(&driven, mCurWeight); + setDrivenWeight(&driven,driven_weight); } } diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index 66e9751f0622a81a012867ffc38745e0cf9d6ab6..3f0423fc498921cb0c00ce4a62b5e898ef3c8f3e 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -555,11 +555,11 @@ void LLPolyMorphTarget::apply( ESex avatar_sex ) // Check for NaN condition (NaN is detected if a variable doesn't equal itself. if (mCurWeight != mCurWeight) { - mCurWeight = 0.0; + mCurWeight = 0.0f; } if (mLastWeight != mLastWeight) { - mLastWeight = mCurWeight+.001; + mLastWeight = mCurWeight+0.001f; } // perform differential update of morph diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 6079913a8e76c46c9cda9f35fd05dea0870553ee..e3565ee45044518e24647379b504e2ed66bb724b 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -672,9 +672,10 @@ void LLWearable::addVisualParam(LLVisualParam *param) void LLWearable::setVisualParamWeight(S32 param_index, F32 value) { - if( is_in_map(mVisualParamIndexMap, param_index ) ) + auto iter = mVisualParamIndexMap.find(param_index); + if(iter != mVisualParamIndexMap.end()) { - LLVisualParam *wearable_param = mVisualParamIndexMap[param_index]; + LLVisualParam *wearable_param = iter->second; wearable_param->setWeight(value); } else @@ -685,16 +686,17 @@ void LLWearable::setVisualParamWeight(S32 param_index, F32 value) F32 LLWearable::getVisualParamWeight(S32 param_index) const { - if( is_in_map(mVisualParamIndexMap, param_index ) ) + auto iter = mVisualParamIndexMap.find(param_index); + if(iter != mVisualParamIndexMap.end()) { - const LLVisualParam *wearable_param = mVisualParamIndexMap.find(param_index)->second; + const LLVisualParam *wearable_param = iter->second; return wearable_param->getWeight(); } else { LL_WARNS() << "LLWerable::getVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL; } - return (F32)-1.0; + return (F32)-1.0f; } LLVisualParam* LLWearable::getVisualParam(S32 index) const @@ -718,11 +720,9 @@ void LLWearable::getVisualParams(visual_param_vec_t &list) void LLWearable::animateParams(F32 delta) { - for(visual_param_index_map_t::iterator iter = mVisualParamIndexMap.begin(); - iter != mVisualParamIndexMap.end(); - ++iter) + for(const auto& param_pair : mVisualParamIndexMap) { - LLVisualParam *param = (LLVisualParam*) iter->second; + LLVisualParam *param = (LLVisualParam*)param_pair.second; param->animate(delta); } } @@ -762,7 +762,8 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp) { // cross-wearable parameters are not authoritative, as they are driven by a different wearable. So don't copy the values to the // avatar object if cross wearable. Cross wearable params get their values from the avatar, they shouldn't write the other way. - if( (((LLViewerVisualParam*)param)->getWearableType() == mType) && (!((LLViewerVisualParam*)param)->getCrossWearable()) ) + LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; + if((viewer_param->getWearableType() == mType) && (!viewer_param->getCrossWearable()) ) { S32 param_id = param->getID(); F32 weight = getVisualParamWeight(param_id); diff --git a/indra/llcharacter/llpose.cpp b/indra/llcharacter/llpose.cpp index fc95fafd61490f81a3b8494afdc4bc5ce24a2ea8..9ce32ebc31832d54f5c54e7b8ce8d5880f72580f 100644 --- a/indra/llcharacter/llpose.cpp +++ b/indra/llcharacter/llpose.cpp @@ -478,7 +478,8 @@ BOOL LLPoseBlender::addMotion(LLMotion* motion) { LLJoint *jointp = jsp->getJoint(); LLJointStateBlender* joint_blender; - if (mJointStateBlenderPool.find(jointp) == mJointStateBlenderPool.end()) + auto joint_iter = mJointStateBlenderPool.find(jointp); + if (joint_iter == mJointStateBlenderPool.end()) { // this is the first time we are animating this joint // so create new jointblender and add it to our pool @@ -487,7 +488,7 @@ BOOL LLPoseBlender::addMotion(LLMotion* motion) } else { - joint_blender = mJointStateBlenderPool[jointp]; + joint_blender = joint_iter->second; } if (jsp->getPriority() == LLJoint::USE_MOTION_PRIORITY) @@ -513,10 +514,8 @@ BOOL LLPoseBlender::addMotion(LLMotion* motion) //----------------------------------------------------------------------------- void LLPoseBlender::blendAndApply() { - for (blender_list_t::iterator iter = mActiveBlenders.begin(); - iter != mActiveBlenders.end(); ) + for (LLJointStateBlender* jsbp : mActiveBlenders) { - LLJointStateBlender* jsbp = *iter++; jsbp->blendJointStates(); } diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 3d28cd15b02234f3c28756d53f570bc21ea07ba2..08c3285fdea191f2e9155fe2a391fa657e13169e 100644 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -222,8 +222,8 @@ void BlockTimer::bootstrapTimerTree() // this preserves partial order derived from current frame's observations void BlockTimer::incrementalUpdateTimerTree() { - for(block_timer_tree_df_post_iterator_t it = begin_block_timer_tree_df_post(BlockTimer::getRootTimeBlock()); - it != end_block_timer_tree_df_post(); + for(block_timer_tree_df_post_iterator_t it = begin_block_timer_tree_df_post(BlockTimer::getRootTimeBlock()), end = end_block_timer_tree_df_post(); + it != end; ++it) { BlockTimerStatHandle* timerp = *it; @@ -396,8 +396,8 @@ void BlockTimer::dumpCurTimes() LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); // walk over timers in depth order and output timings - for(block_timer_tree_df_iterator_t it = begin_timer_tree(BlockTimer::getRootTimeBlock()); - it != end_timer_tree(); + for(block_timer_tree_df_iterator_t it = begin_timer_tree(BlockTimer::getRootTimeBlock()), end = end_timer_tree(); + it != end; ++it) { BlockTimerStatHandle* timerp = (*it);