More C++11 cleanups, mostly from alchemy

This commit is contained in:
Lirusaito
2016-02-22 22:47:01 -05:00
parent 6a95f3b692
commit d15ac7640c
11 changed files with 89 additions and 98 deletions

View File

@@ -46,15 +46,9 @@
#include "lltimer.h"
#include "llsdserialize.h"
#include "llsdutil.h"
#include <boost/bind.hpp>
#include <boost/circular_buffer.hpp>
#include <boost/regex.hpp>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/range.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/is_float.hpp>
using namespace llsd;
@@ -96,8 +90,6 @@ const char MEMINFO_FILE[] = "/proc/meminfo";
extern int errno;
#endif
static const S32 CPUINFO_BUFFER_SIZE = 16383;
LLCPUInfo gSysCPU;
// Don't log memory info any more often than this. It also serves as our
@@ -109,6 +101,15 @@ static const F32 MEM_INFO_THROTTLE = 20;
// dropped below the login framerate, we'd have very little additional data.
static const F32 MEM_INFO_WINDOW = 10*60;
#if LL_WINDOWS
#pragma warning(disable : 4996)
#ifndef _WIN32_WINNT_WIN10
#define _WIN32_WINNT_WIN10 0x0A00
#endif
#endif // LL_WINDOWS
// Wrap boost::regex_match() with a function that doesn't throw.
template <typename S, typename M, typename R>
static bool regex_match_no_exc(const S& string, M& match, const R& regex)
@@ -148,7 +149,7 @@ LLOSInfo::LLOSInfo() :
#if LL_WINDOWS
bool is_server = IsWindowsServer();
std::string service_pack;
if (IsWindows10OrGreater())
if (IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN10), LOBYTE(_WIN32_WINNT_WIN10), 0))
{
if (is_server)
{
@@ -517,8 +518,6 @@ const std::string& LLOSInfo::getOSVersionString() const
return mOSVersionString;
}
const S32 STATUS_SIZE = 8192;
//static
U32 LLOSInfo::getProcessVirtualSizeKB()
{
@@ -526,6 +525,7 @@ U32 LLOSInfo::getProcessVirtualSizeKB()
#if LL_WINDOWS
#endif
#if LL_LINUX
# define STATUS_SIZE 2048
LLFILE* status_filep = LLFile::fopen("/proc/self/status", "rb");
if (status_filep)
{
@@ -683,7 +683,7 @@ public:
// Store every integer type as LLSD::Integer.
template <class T>
void add(const LLSD::String& name, const T& value,
typename boost::enable_if<boost::is_integral<T> >::type* = 0)
typename std::enable_if<std::is_integral<T>::value>::type* = nullptr)
{
mStats[name] = LLSD::Integer(value);
}
@@ -691,7 +691,7 @@ public:
// Store every floating-point type as LLSD::Real.
template <class T>
void add(const LLSD::String& name, const T& value,
typename boost::enable_if<boost::is_float<T> >::type* = 0)
typename std::enable_if<std::is_floating_point<T>::value>::type* = nullptr)
{
mStats[name] = LLSD::Real(value);
}
@@ -878,7 +878,7 @@ void LLMemoryInfo::stream(std::ostream& s) const
// Max key length
size_t key_width(0);
BOOST_FOREACH(const MapEntry& pair, inMap(mStatsMap))
for (const MapEntry& pair : inMap(mStatsMap))
{
size_t len(pair.first.length());
if (len > key_width)
@@ -888,7 +888,7 @@ void LLMemoryInfo::stream(std::ostream& s) const
}
// Now stream stats
BOOST_FOREACH(const MapEntry& pair, inMap(mStatsMap))
for (const MapEntry& pair : inMap(mStatsMap))
{
s << pfx << std::setw(key_width+1) << (pair.first + ':') << ' ';
LLSD value(pair.second);
@@ -1176,7 +1176,8 @@ public:
// Hooking onto the "mainloop" event pump gets us one call per frame.
mConnection(LLEventPumps::instance()
.obtain("mainloop")
.listen("FrameWatcher", boost::bind(&FrameWatcher::tick, this, _1))),
.listen("FrameWatcher", std::bind(&FrameWatcher::tick, this, std::placeholders::_1))),
// Initializing mSampleStart to an invalid timestamp alerts us to skip
// trying to compute framerate on the first call.
mSampleStart(-1),

View File

@@ -942,7 +942,6 @@ P2(meshHeaderResponder, connect_30s);
P2(meshLODResponder, connect_30s);
P2(meshPhysicsShapeResponder, connect_30s);
P2(meshSkinInfoResponder, connect_30s);
P(moderationResponder);
P(objectCostResponder);
P(physicsFlagsResponder);
P(productInfoRequestResponder);

View File

@@ -34,7 +34,8 @@
#include "llpanel.h"
#include "lluictrlfactory.h"
#include "llcriticaldamp.h"
#include "boost/foreach.hpp"
#include <boost/range/adaptor/reversed.hpp>
static const F32 MIN_FRACTIONAL_SIZE = 0.00001f;
static const F32 MAX_FRACTIONAL_SIZE = 1.f;
@@ -245,7 +246,7 @@ void LLLayoutStack::draw()
// always clip to stack itself
LLLocalClipRect clip(getLocalRect());
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
for (LLLayoutPanel* panelp : mPanels)
{
// clip to layout rectangle, not bounding rectangle
LLRect clip_rect = panelp->getRect();
@@ -367,8 +368,8 @@ void LLLayoutStack::updateLayout()
: getRect().getHeight();
// first, assign minimum dimensions
LLLayoutPanel* panelp = NULL;
BOOST_FOREACH(panelp, mPanels)
LLLayoutPanel* panelp = mPanels.size() ? *mPanels.rbegin() : nullptr;
for (auto* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -387,7 +388,7 @@ void LLLayoutStack::updateLayout()
F32 fraction_distributed = 0.f;
if (space_to_distribute > 0 && total_visible_fraction > 0.f)
{ // give space proportionally to visible auto resize panels
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -401,7 +402,7 @@ void LLLayoutStack::updateLayout()
}
// distribute any left over pixels to non-collapsed, visible panels
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
for (LLLayoutPanel* panelp : mPanels)
{
if (remaining_space == 0) break;
@@ -417,7 +418,7 @@ void LLLayoutStack::updateLayout()
F32 cur_pos = (mOrientation == HORIZONTAL) ? 0.f : (F32)getRect().getHeight();
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
for (LLLayoutPanel* panelp : mPanels)
{
F32 panel_dim = llmax(panelp->getExpandedMinDim(), panelp->mTargetDim);
F32 panel_visible_dim = panelp->getVisibleDim();
@@ -473,7 +474,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const
if (!panelp) return NULL;
e_panel_list_t::const_iterator panel_it;
BOOST_FOREACH(LLLayoutPanel* p, mPanels)
for (LLLayoutPanel* p : mPanels)
{
if (p == panelp)
{
@@ -487,7 +488,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) c
{
LLLayoutPanel* result = NULL;
BOOST_FOREACH(LLLayoutPanel* p, mPanels)
for (LLLayoutPanel* p : mPanels)
{
if (p->getName() == name)
{
@@ -501,7 +502,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) c
void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp)
{
BOOST_FOREACH(LLLayoutPanel* lp, mPanels)
for (LLLayoutPanel* lp : mPanels)
{
if (lp->mResizeBar == NULL)
{
@@ -545,7 +546,7 @@ void LLLayoutStack::updateFractionalSizes()
{
F32 total_resizable_dim = 0.f;
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -553,7 +554,7 @@ void LLLayoutStack::updateFractionalSizes()
}
}
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -574,7 +575,7 @@ void LLLayoutStack::normalizeFractionalSizes()
S32 num_auto_resize_panels = 0;
F32 total_fractional_size = 0.f;
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -585,7 +586,7 @@ void LLLayoutStack::normalizeFractionalSizes()
if (total_fractional_size == 0.f)
{ // equal distribution
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -595,7 +596,7 @@ void LLLayoutStack::normalizeFractionalSizes()
}
else
{ // renormalize
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->mAutoResize)
{
@@ -612,7 +613,7 @@ bool LLLayoutStack::animatePanels()
//
// animate visibility
//
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
for (LLLayoutPanel* panelp : mPanels)
{
if (panelp->getVisible())
{
@@ -710,7 +711,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
LLLayoutPanel* other_resize_panel = NULL;
LLLayoutPanel* following_panel = NULL;
BOOST_REVERSE_FOREACH(LLLayoutPanel* panelp, mPanels)
for(LLLayoutPanel* panelp : boost::adaptors::reverse(mPanels))
{
if (panelp->mAutoResize)
{
@@ -759,7 +760,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
AFTER_RESIZED_PANEL
} which_panel = BEFORE_RESIZED_PANEL;
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
for (LLLayoutPanel* panelp : mPanels)
{
if (!panelp->getVisible() || panelp->mCollapsed)
{
@@ -867,7 +868,7 @@ void LLLayoutStack::reshape(S32 width, S32 height, BOOL called_from_parent)
void LLLayoutStack::updateResizeBarLimits()
{
LLLayoutPanel* previous_visible_panelp = NULL;
BOOST_REVERSE_FOREACH(LLLayoutPanel* visible_panelp, mPanels)
for(LLLayoutPanel* visible_panelp : boost::adaptors::reverse(mPanels))
{
if (!visible_panelp->getVisible() || visible_panelp->mCollapsed)
{

View File

@@ -38,7 +38,6 @@
#include <cassert>
#include <boost/tokenizer.hpp>
#include <boost/foreach.hpp>
#include "llrender.h"
#include "llevent.h"
@@ -400,7 +399,7 @@ void LLView::removeChild(LLView* child)
LLView::ctrl_list_t LLView::getCtrlList() const
{
ctrl_list_t controls;
BOOST_FOREACH(LLView* viewp, mChildList)
for (LLView* viewp : mChildList)
{
if(viewp->isCtrl())
{
@@ -613,12 +612,12 @@ void LLView::deleteAllChildren()
LLView* viewp = mChildList.front();
delete viewp; // will remove the child from mChildList
}
mChildHashMap.clear();
mChildHashMap.clear(); // <alchemy/>
}
void LLView::setAllChildrenEnabled(BOOL b)
{
BOOST_FOREACH(LLView* viewp, mChildList)
for (LLView* viewp : mChildList)
{
viewp->setEnabled(b);
}
@@ -644,7 +643,7 @@ void LLView::setVisible(BOOL visible)
// virtual
void LLView::handleVisibilityChange ( BOOL new_visibility )
{
BOOST_FOREACH(LLView* viewp, mChildList)
for (LLView* viewp : mChildList)
{
// only views that are themselves visible will have their overall visibility affected by their ancestors
if (viewp->getVisible())
@@ -722,7 +721,7 @@ BOOL LLView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_s
std::string tool_tip;
BOOST_FOREACH(LLView* viewp, mChildList)
for(LLView* viewp : mChildList)
{
S32 local_x = x - viewp->mRect.mLeft;
S32 local_y = y - viewp->mRect.mBottom;
@@ -804,7 +803,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m
{
if ( getVisible() && getEnabled() )
{
BOOST_FOREACH(LLView* viewp, mChildList)
for (LLView* viewp : mChildList)
{
if ((viewp->*method)(c, mask, TRUE))
{
@@ -823,7 +822,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m
template <typename METHOD, typename XDATA>
LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra, bool allow_mouse_block)
{
BOOST_FOREACH(LLView* viewp, mChildList)
for (LLView* viewp : mChildList)
{
S32 local_x = x - viewp->getRect().mLeft;
S32 local_y = y - viewp->getRect().mBottom;
@@ -853,7 +852,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask,
// default to not accepting drag and drop, will be overridden by handler
*accept = ACCEPT_NO;
BOOST_FOREACH(LLView* viewp, mChildList)
for (LLView* viewp : mChildList)
{
S32 local_x = x - viewp->getRect().mLeft;
S32 local_y = y - viewp->getRect().mBottom;
@@ -879,7 +878,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask,
LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask)
{
BOOST_FOREACH(LLView* viewp, mChildList)
for (LLView* viewp : mChildList)
{
S32 local_x = x - viewp->getRect().mLeft;
S32 local_y = y - viewp->getRect().mBottom;
@@ -904,9 +903,9 @@ LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask)
LLView* LLView::childFromPoint(S32 x, S32 y, bool recur)
{
if (!getVisible())
return NULL;
return NULL; // <alchemy/>
BOOST_FOREACH(LLView* viewp, mChildList)
for (LLView* viewp : mChildList)
{
S32 local_x = x - viewp->getRect().mLeft;
S32 local_y = y - viewp->getRect().mBottom;
@@ -930,7 +929,7 @@ LLView* LLView::childFromPoint(S32 x, S32 y, bool recur)
return viewp;
}
return 0;
return NULL; // <alchemy/>
}
BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent)
@@ -947,8 +946,10 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent)
if (!handled)
{
// For event logging we don't care which widget handles it
// So we capture the key at the end of this function once we know if it was handled
handled = handleKeyHere( key, mask );
if (handled && LLView::sDebugKeys)
if (handled && LLView::sDebugKeys) // <alchemy/> - AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
{
LL_INFOS() << "Key handled by " << getName() << LL_ENDL;
}
@@ -1182,7 +1183,7 @@ LLView* LLView::childrenHandleMiddleMouseUp(S32 x, S32 y, MASK mask)
LLView* handled_view = NULL;
if( getVisible() && getEnabled() )
{
BOOST_FOREACH(LLView* viewp, mChildList)
for (LLView* viewp : mChildList)
{
S32 local_x = x - viewp->getRect().mLeft;
S32 local_y = y - viewp->getRect().mBottom;
@@ -1377,8 +1378,10 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent)
mRect.mTop = getRect().mBottom + height;
// move child views according to reshape flags
BOOST_FOREACH(LLView* viewp, mChildList)
for (LLView* viewp : mChildList)
{
if (viewp != NULL)
{
LLRect child_rect( viewp->mRect );
if (viewp->followsRight() && viewp->followsLeft())
@@ -1428,6 +1431,7 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent)
}
}
}
}
if (!called_from_parent)
{
@@ -1444,7 +1448,7 @@ LLRect LLView::calcBoundingRect()
{
LLRect local_bounding_rect = LLRect::null;
BOOST_FOREACH(LLView* childp, mChildList)
for (LLView* childp : mChildList)
{
// ignore invisible and "top" children when calculating bounding rect
// such as combobox popups
@@ -1606,7 +1610,7 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse, BOOL create_
//if(name.empty())
// return NULL;
// Look for direct children *first*
/*BOOST_FOREACH(LLView* childp, mChildList)
/*for (LLView* childp : mChildList)
{
llassert(childp);
if (childp->getName() == name)
@@ -1622,7 +1626,7 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse, BOOL create_
if (recurse)
{
// Look inside each child as well.
BOOST_FOREACH(LLView* childp, mChildList)
for (LLView* childp : mChildList)
{
llassert(childp);
LLView* viewp = childp->getChildView(name, recurse, FALSE);
@@ -3058,7 +3062,7 @@ S32 LLView::notifyParent(const LLSD& info)
bool LLView::notifyChildren(const LLSD& info)
{
bool ret = false;
BOOST_FOREACH(LLView* childp, mChildList)
for (LLView* childp : mChildList)
{
ret = ret || childp->notifyChildren(info);
}

View File

@@ -52,7 +52,6 @@
#include "llworld.h"
#include <boost/date_time.hpp>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
// [RLVa:KB]
@@ -412,7 +411,7 @@ BOOL LLFloaterAvatarList::postBuild()
mAvatarList->setCommitCallback(boost::bind(&LLFloaterAvatarList::onSelectName,this));
mAvatarList->setDoubleClickCallback(boost::bind(&LLFloaterAvatarList::onClickFocus,this));
mAvatarList->setSortChangedCallback(boost::bind(&LLFloaterAvatarList::onAvatarSortingChanged,this));
BOOST_FOREACH(LLViewerRegion* region, LLWorld::instance().getRegionList())
for (LLViewerRegion* region : LLWorld::instance().getRegionList())
{
updateAvatarList(region);
}
@@ -605,9 +604,9 @@ void LLFloaterAvatarList::expireAvatarList(const std::list<LLUUID>& ids)
std::vector<LLUUID> existing_avs;
std::vector<LLViewerRegion*> neighbors;
gAgent.getRegion()->getNeighboringRegions(neighbors);
BOOST_FOREACH(const LLViewerRegion* region, neighbors)
for (const LLViewerRegion* region : neighbors)
existing_avs.insert(existing_avs.end(), region->mMapAvatarIDs.begin(), region->mMapAvatarIDs.end());
BOOST_FOREACH(const LLUUID& id, ids)
for (const LLUUID& id : ids)
{
if (std::find(existing_avs.begin(), existing_avs.end(), id) != existing_avs.end()) continue; // Now in another region we know.
av_list_t::iterator it(std::find_if(mAvatars.begin(), mAvatars.end(), LLAvatarListEntry::uuidMatch(id)));
@@ -671,7 +670,7 @@ void LLFloaterAvatarList::refreshAvatarList()
av_list_t dead_entries;
bool name_restricted(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
BOOST_FOREACH(av_list_t::value_type& entry, mAvatars)
for (auto& entry : mAvatars)
{
LLVector3d position = entry->getPosition();
LLVector3d delta = position - mypos;
@@ -974,7 +973,7 @@ void LLFloaterAvatarList::refreshAvatarList()
mAvatarList->addRow(element);
}
BOOST_FOREACH(av_list_t::value_type& dead, dead_entries)
for (auto& dead : dead_entries)
mAvatars.erase(std::remove(mAvatars.begin(), mAvatars.end(), dead), mAvatars.end());
if (mAvatars.empty())
@@ -1003,7 +1002,7 @@ void LLFloaterAvatarList::resetAvatarNames()
bool hide_tags(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS));
bool anon_names(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES));
const std::string& hidden(RlvStrings::getString(RLV_STRING_HIDDEN));
BOOST_FOREACH(av_list_t::value_type& entry, mAvatars)
for (auto& entry : mAvatars)
{
entry->resetName(hide_tags, anon_names, hidden);
}
@@ -1144,7 +1143,7 @@ void LLFloaterAvatarList::onClickFocus()
void LLFloaterAvatarList::removeFocusFromAll()
{
BOOST_FOREACH(av_list_t::value_type& entry, mAvatars)
for (auto& entry : mAvatars)
{
entry->setFocus(false);
}

View File

@@ -91,7 +91,6 @@
#include "rlvhandler.h"
#include "rlvlocks.h"
// [/RLVa:KB]
#include <boost/foreach.hpp>
// Marketplace outbox current disabled
#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1
@@ -2498,7 +2497,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
LLInventoryModel::item_array_t items;
model->collectDescendents(cat_id, cats, items, LLInventoryModel::EXCLUDE_TRASH);
LLInventoryObject::const_object_list_t citems;
BOOST_FOREACH(LLPointer<LLViewerInventoryItem> item, items)
for (LLPointer<LLViewerInventoryItem> item : items)
{
citems.push_back(item.get());
}

View File

@@ -33,10 +33,6 @@
#include "llerror.h"
#include <boost/foreach.hpp>
#include <boost/signals2.hpp>
namespace LLMarketplaceInventoryNotifications
{
typedef boost::signals2::signal<void (const LLSD& param)> no_copy_payload_cb_signal_t;
@@ -54,7 +50,7 @@ namespace LLMarketplaceInventoryNotifications
llassert(!no_copy_payloads.empty());
llassert(no_copy_cb_action != NULL);
BOOST_FOREACH(const LLSD& payload, no_copy_payloads)
for (const LLSD& payload : no_copy_payloads)
{
(*no_copy_cb_action)(payload);
}

View File

@@ -65,7 +65,7 @@
#include "rlvhandler.h"
// [/RLVa:KB]
#include <boost/foreach.hpp>
#include <boost/range/adaptor/reversed.hpp>
//
// Globals
@@ -244,7 +244,7 @@ void LLOverlayBar::layoutButtons()
{
U32 button_count = 0;
const child_list_t& view_list = *(mStateManagementContainer->getChildList());
BOOST_FOREACH(LLView* viewp, view_list)
for (LLView* viewp : view_list)
{
if(!viewp->getEnabled())
continue;
@@ -264,7 +264,7 @@ void LLOverlayBar::layoutButtons()
S32 left = 0;
S32 bottom = 1;
BOOST_REVERSE_FOREACH(LLView* viewp, view_list)
for (LLView* viewp : boost::adaptors::reverse(view_list))
{
if(!viewp->getEnabled())
continue;

View File

@@ -49,8 +49,6 @@
#include "lluictrlfactory.h"
#include "llviewerwindow.h"
#include <boost/foreach.hpp>
LLPanelGroupBulkBan::LLPanelGroupBulkBan(const LLUUID& group_id) : LLPanelGroupBulk(group_id)
{
// Pass on construction of this panel to the control factory.
@@ -163,7 +161,7 @@ void LLPanelGroupBulkBan::submit()
}
if (group_datap)
{
BOOST_FOREACH(const LLGroupMgrGroupData::ban_list_t::value_type& group_ban_pair, group_datap->mBanList)
for (const LLGroupMgrGroupData::ban_list_t::value_type& group_ban_pair : group_datap->mBanList)
{
const LLUUID& group_ban_agent_id = group_ban_pair.first;
std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), group_ban_agent_id);

View File

@@ -42,10 +42,6 @@
#include "rlvhandler.h"
#include <boost/foreach.hpp>
extern AIHTTPTimeoutPolicy moderationResponder_timeout;
const LLColor4 INACTIVE_COLOR(0.3f, 0.3f, 0.3f, 0.5f);
const LLColor4 ACTIVE_COLOR(0.5f, 0.5f, 0.5f, 1.f);
@@ -204,7 +200,7 @@ BOOL LLSpeakerActionTimer::tick()
void LLSpeakerActionTimer::unset()
{
mActionCallback = 0;
mActionCallback = NULL;
}
LLSpeakersDelayActionsStorage::LLSpeakersDelayActionsStorage(LLSpeakerActionTimer::action_callback_t action_cb, F32 action_delay)
@@ -289,9 +285,10 @@ public:
mSessionID = session_id;
}
virtual void httpFailure(void)
protected:
virtual void httpFailure()
{
LL_WARNS() << mStatus << ": " << mReason << LL_ENDL;
LL_WARNS() << dumpResponse() << LL_ENDL;
if ( gIMMgr )
{
@@ -314,7 +311,6 @@ public:
}
}
}
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return moderationResponder_timeout; }
/*virtual*/ char const* getName(void) const { return "ModerationResponder"; }
private:
@@ -819,7 +815,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
}
else
{
LL_WARNS() << "bad membership list update " << ll_print_sd(agent_data["transition"]) << LL_ENDL;
LL_WARNS() << "bad membership list update from 'agent_updates' for agent " << agent_id << ", transition " << ll_print_sd(agent_data["transition"]) << LL_ENDL;
}
}
@@ -872,8 +868,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
}
else
{
LL_WARNS() << "bad membership list update "
<< agent_transition << LL_ENDL;
LL_WARNS() << "bad membership list update from 'updates' for agent " << agent_id << ", transition " << agent_transition << LL_ENDL;
}
}
}
@@ -1043,8 +1038,8 @@ void LLLocalSpeakerMgr::updateSpeakerList()
// pick up non-voice speakers in chat range
uuid_vec_t avatar_ids;
LLWorld::getInstance()->getAvatars(&avatar_ids, NULL, gAgent.getPositionGlobal(), CHAT_NORMAL_RADIUS);
BOOST_FOREACH(const LLUUID& id, avatar_ids)
LLWorld::getInstance()->getAvatars(&avatar_ids, nullptr, gAgent.getPositionGlobal(), CHAT_NORMAL_RADIUS);
for (const auto& id : avatar_ids)
{
setSpeaker(id);
}
@@ -1054,7 +1049,7 @@ void LLLocalSpeakerMgr::updateSpeakerList()
{
LLUUID speaker_id = speaker_it->first;
LLSpeaker* speakerp = speaker_it->second;
if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY)
if (speakerp && speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY)
{
LLVOAvatar* avatarp = gObjectList.findAvatar(speaker_id);
if (!avatarp || dist_vec_squared(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > CHAT_NORMAL_RADIUS * CHAT_NORMAL_RADIUS)

View File

@@ -26,7 +26,6 @@
#include "rlvinventory.h"
#include <boost/algorithm/string.hpp>
#include <boost/foreach.hpp>
// ============================================================================
// RlvCommmand
@@ -913,7 +912,7 @@ void RlvForceWear::updatePendingAttachments()
if (RlvForceWear::instanceExists())
{
RlvForceWear* pThis = RlvForceWear::getInstance();
BOOST_FOREACH(const pendingattachments_map_t::value_type& itAttach, pThis->m_pendingAttachments)
for (const auto& itAttach : pThis->m_pendingAttachments)
LLAttachmentsMgr::instance().addAttachment(itAttach.first, itAttach.second & ~ATTACHMENT_ADD, itAttach.second & ATTACHMENT_ADD);
pThis->m_pendingAttachments.clear();
}
@@ -954,7 +953,7 @@ void RlvForceWear::done()
// Wearables
if (m_remWearables.size())
{
BOOST_FOREACH(const LLViewerWearable* pWearable, m_remWearables)
for (const LLViewerWearable* pWearable : m_remWearables)
remItems.push_back(pWearable->getItemID());
m_remWearables.clear();
}
@@ -963,7 +962,7 @@ void RlvForceWear::done()
if (m_remGestures.size())
{
// NOTE: LLGestureMgr::deactivateGesture() will call LLAppearanceMgr::removeCOFItemLinks() for us and supply its own callback
BOOST_FOREACH(const LLViewerInventoryItem* pItem, m_remGestures)
for (const LLViewerInventoryItem* pItem : m_remGestures)
LLGestureMgr::instance().deactivateGesture(pItem->getUUID());
m_remGestures.clear();
}
@@ -972,7 +971,7 @@ void RlvForceWear::done()
if (m_remAttachments.size())
{
LLAgentWearables::userRemoveMultipleAttachments(m_remAttachments);
BOOST_FOREACH(const LLViewerObject* pAttachObj, m_remAttachments)
for (const LLViewerObject* pAttachObj : m_remAttachments)
remItems.push_back(pAttachObj->getAttachmentItemID());
m_remAttachments.clear();
}
@@ -986,7 +985,7 @@ void RlvForceWear::done()
for (addwearables_map_t::const_iterator itAddWearables = m_addWearables.begin(); itAddWearables != m_addWearables.end(); ++itAddWearables)
{
// NOTE: LLAppearanceMgr will filter our duplicates so no need for us to check here
BOOST_FOREACH(LLViewerInventoryItem* pItem, itAddWearables->second)
for (LLViewerInventoryItem* pItem : itAddWearables->second)
{
if (LLAssetType::AT_BODYPART == pItem->getType())
addBodyParts.push_back(pItem);
@@ -999,7 +998,7 @@ void RlvForceWear::done()
// Until LL provides a way for updateCOF to selectively attach add/replace we have to deal with attachments ourselves
for (addattachments_map_t::const_iterator itAddAttachments = m_addAttachments.begin(); itAddAttachments != m_addAttachments.end(); ++itAddAttachments)
{
BOOST_FOREACH(const LLViewerInventoryItem* pItem, itAddAttachments->second)
for (const LLViewerInventoryItem* pItem : itAddAttachments->second)
addPendingAttachment(pItem->getLinkedUUID(), itAddAttachments->first);
}
m_addAttachments.clear();