Merge branch 'master' of git://github.com/Shyotl/SingularityViewer

# Conflicts:
#	indra/llcommon/llsd.cpp
#	indra/llcommon/llsdserialize.cpp
#	indra/newview/llspeakers.cpp
#	indra/newview/llviewermessage.cpp
This commit is contained in:
Liru Færs
2020-02-25 06:16:07 -05:00
48 changed files with 305 additions and 411 deletions

View File

@@ -132,7 +132,7 @@ class LL_COMMON_API AIArgs
// Add another replacement.
AIArgs& operator()(char const* key, std::string const& replacement) { mArgs[key] = replacement; return *this; }
// The destructor may not throw.
~AIArgs() throw() { }
~AIArgs() noexcept { }
// Accessor.
LLStringUtil::format_map_t const& operator*() const { return mArgs; }
@@ -193,7 +193,7 @@ class LL_COMMON_API Line
Line(std::string const& xml_desc, AIArgs const& args, bool newline = false) : mNewline(newline), mXmlDesc(xml_desc), mArgs(args), mType(normal) { }
Line(Prefix const& prefix, bool newline = false) : mNewline(newline), mXmlDesc("AIPrefix"), mArgs("[PREFIX]", prefix.str()), mType(prefix.type()) { }
// The destructor may not throw.
~Line() throw() { }
~Line() noexcept { }
// Prepend a newline before this line.
void set_newline(void) { mNewline = true; }
@@ -225,7 +225,7 @@ class LL_COMMON_API Error : public std::exception
typedef std::deque<Line> lines_type;
// The destructor may not throw.
~Error() throw() { }
~Error() noexcept { }
// Accessors.
lines_type const& lines(void) const { return mLines; }
@@ -267,7 +267,7 @@ class LL_COMMON_API ErrorCode : public Error
public:
// The destructor may not throw.
~ErrorCode() throw() { }
~ErrorCode() noexcept { }
// Accessor.
int getCode(void) const { return mCode; }

View File

@@ -412,7 +412,7 @@ public:
std::runtime_error(what),
mData(data)
{}
virtual ~LLErrorEvent() throw() {}
virtual ~LLErrorEvent() noexcept {}
LLSD getData() const { return mData; }

View File

@@ -381,10 +381,9 @@ std::string LLSDArgsMapper::formatlist(const LLSD& list)
{
std::ostringstream out;
const char* delim = "";
for (LLSD::array_const_iterator li(list.beginArray()), lend(list.endArray());
li != lend; ++li)
for (auto const& entry : list.array())
{
out << delim << li->asString();
out << delim << entry.asString();
delim = ", ";
}
return out.str();
@@ -494,10 +493,9 @@ struct LLEventDispatcher::MapParamsDispatchEntry: public LLEventDispatcher::Para
{
// Build the set of all param keys, then delete the ones that are
// optional. What's left are the ones that are required.
for (LLSD::array_const_iterator pi(params.beginArray()), pend(params.endArray());
pi != pend; ++pi)
for (auto const& entry : params.array())
{
mRequired[pi->asString()] = LLSD();
mRequired[entry.asString()] = LLSD();
}
if (defaults.isArray() || defaults.isUndefined())

View File

@@ -54,6 +54,7 @@ std::string LLFile::strerr(int errn)
{
char buffer[256];
strerror_s(buffer, errn); // infers sizeof(buffer) -- love it!
buffer[255] = 0;
return buffer;
}

View File

@@ -140,10 +140,14 @@ public:
virtual void erase(Integer) { }
virtual const LLSD& ref(Integer) const { return undef(); }
virtual LLSD::map_const_iterator beginMap() const { return endMap(); }
virtual LLSD::map_const_iterator endMap() const { static const std::map<String, LLSD> empty; return empty.end(); }
virtual LLSD::array_const_iterator beginArray() const { return endArray(); }
virtual LLSD::array_const_iterator endArray() const { static const std::vector<LLSD> empty; return empty.end(); }
virtual const std::map<String, LLSD>& map() const { static const std::map<String, LLSD> empty; return empty; }
virtual std::map<String, LLSD>& map() { static std::map<String, LLSD> empty; return empty; }
LLSD::map_const_iterator beginMap() const { return map().begin(); }
LLSD::map_const_iterator endMap() const { return map().end(); }
virtual const std::vector<LLSD>& array() const { static const std::vector<LLSD> empty; return empty; }
virtual std::vector<LLSD>& array() { static std::vector<LLSD> empty; return empty; }
LLSD::array_const_iterator beginArray() const { return array().begin(); }
LLSD::array_const_iterator endArray() const { return array().end(); }
virtual void dumpStats() const;
virtual void calcStats(S32 type_counts[], S32 share_counts[]) const;
@@ -200,7 +204,7 @@ namespace
};
class ImplBoolean
class ImplBoolean final
: public ImplBase<LLSD::TypeBoolean, LLSD::Boolean>
{
public:
@@ -221,7 +225,7 @@ namespace
{ return mValue ? "true" : ""; }
class ImplInteger
class ImplInteger final
: public ImplBase<LLSD::TypeInteger, LLSD::Integer>
{
public:
@@ -237,7 +241,7 @@ namespace
{ return llformat("%d", mValue); }
class ImplReal
class ImplReal final
: public ImplBase<LLSD::TypeReal, LLSD::Real>
{
public:
@@ -259,7 +263,7 @@ namespace
{ return llformat("%lg", mValue); }
class ImplString
class ImplString final
: public ImplBase<LLSD::TypeString, LLSD::String, const LLSD::String&>
{
public:
@@ -303,7 +307,7 @@ namespace
}
class ImplUUID
class ImplUUID final
: public ImplBase<LLSD::TypeUUID, LLSD::UUID, const LLSD::UUID&>
{
public:
@@ -314,7 +318,7 @@ namespace
};
class ImplDate
class ImplDate final
: public ImplBase<LLSD::TypeDate, LLSD::Date, const LLSD::Date&>
{
public:
@@ -336,7 +340,7 @@ namespace
};
class ImplURI
class ImplURI final
: public ImplBase<LLSD::TypeURI, LLSD::URI, const LLSD::URI&>
{
public:
@@ -347,7 +351,7 @@ namespace
};
class ImplBinary
class ImplBinary final
: public ImplBase<LLSD::TypeBinary, LLSD::Binary, const LLSD::Binary&>
{
public:
@@ -357,7 +361,7 @@ namespace
};
class ImplMap : public LLSD::Impl
class ImplMap final : public LLSD::Impl
{
private:
typedef std::map<LLSD::String, LLSD> DataMap;
@@ -390,10 +394,8 @@ namespace
int size() const override { return mData.size(); }
LLSD::map_iterator beginMap() { return mData.begin(); }
LLSD::map_iterator endMap() { return mData.end(); }
LLSD::map_const_iterator beginMap() const override { return mData.begin(); }
LLSD::map_const_iterator endMap() const override { return mData.end(); }
DataMap& map() final override { return mData; }
const DataMap& map() const final override { return mData; }
void dumpStats() const override;
void calcStats(S32 type_counts[], S32 share_counts[]) const override;
@@ -491,7 +493,7 @@ namespace
}
class ImplArray : public LLSD::Impl
class ImplArray final : public LLSD::Impl
{
private:
typedef std::vector<LLSD> DataVector;
@@ -522,12 +524,8 @@ namespace
LLSD& ref(LLSD::Integer);
const LLSD& ref(LLSD::Integer) const override;
LLSD::array_iterator beginArray() { return mData.begin(); }
LLSD::array_iterator endArray() { return mData.end(); }
LLSD::reverse_array_iterator rbeginArray() { return mData.rbegin(); }
LLSD::reverse_array_iterator rendArray() { return mData.rend(); }
LLSD::array_const_iterator beginArray() const override { return mData.begin(); }
LLSD::array_const_iterator endArray() const override { return mData.end(); }
DataVector& array() final override { return mData; }
const DataVector& array() const final override { return mData; }
void calcStats(S32 type_counts[], S32 share_counts[]) const override;
};
@@ -959,18 +957,24 @@ const char *LLSD::dump(const LLSD &llsd)
return llsd_dump(llsd, false);
}
LLSD::map_iterator LLSD::beginMap() { return makeMap(impl).beginMap(); }
LLSD::map_iterator LLSD::endMap() { return makeMap(impl).endMap(); }
LLSD::map_const_iterator LLSD::beginMap() const { return safe(impl).beginMap(); }
LLSD::map_const_iterator LLSD::endMap() const { return safe(impl).endMap(); }
std::map<LLSD::String, LLSD>& LLSD::map() { return makeMap(impl).map(); }
const std::map<LLSD::String, LLSD>& LLSD::map() const { return safe(impl).map(); }
LLSD::array_iterator LLSD::beginArray() { return makeArray(impl).beginArray(); }
LLSD::array_iterator LLSD::endArray() { return makeArray(impl).endArray(); }
LLSD::array_const_iterator LLSD::beginArray() const{ return safe(impl).beginArray(); }
LLSD::array_const_iterator LLSD::endArray() const { return safe(impl).endArray(); }
LLSD::map_iterator LLSD::beginMap() { return map().begin(); }
LLSD::map_iterator LLSD::endMap() { return map().end(); }
LLSD::map_const_iterator LLSD::beginMap() const { return map().cbegin(); }
LLSD::map_const_iterator LLSD::endMap() const { return map().cend(); }
LLSD::reverse_array_iterator LLSD::rbeginArray() { return makeArray(impl).rbeginArray(); }
LLSD::reverse_array_iterator LLSD::rendArray() { return makeArray(impl).rendArray(); }
std::vector<LLSD>& LLSD::array() { return makeArray(impl).array(); }
const std::vector<LLSD>& LLSD::array() const { return safe(impl).array(); }
LLSD::array_iterator LLSD::beginArray() { return array().begin(); }
LLSD::array_iterator LLSD::endArray() { return array().end(); }
LLSD::array_const_iterator LLSD::beginArray() const{ return array().cbegin(); }
LLSD::array_const_iterator LLSD::endArray() const { return array().cend(); }
LLSD::reverse_array_iterator LLSD::rbeginArray() { return array().rbegin(); }
LLSD::reverse_array_iterator LLSD::rendArray() { return array().rend(); }
namespace llsd
{

View File

@@ -320,6 +320,8 @@ public:
typedef std::map<String, LLSD>::iterator map_iterator;
typedef std::map<String, LLSD>::const_iterator map_const_iterator;
std::map<String, LLSD>& map();
const std::map<String, LLSD>& map() const;
map_iterator beginMap();
map_iterator endMap();
map_const_iterator beginMap() const;
@@ -329,6 +331,8 @@ public:
typedef std::vector<LLSD>::const_iterator array_const_iterator;
typedef std::vector<LLSD>::reverse_iterator reverse_array_iterator;
std::vector<LLSD>& array();
const std::vector<LLSD>& array() const;
array_iterator beginArray();
array_iterator endArray();
array_const_iterator beginArray() const;

View File

@@ -122,9 +122,9 @@ nlohmann::json LlsdToJson(const LLSD &val)
}
break;
case LLSD::TypeArray:
for (LLSD::array_const_iterator it = val.beginArray(); it != val.endArray(); ++it)
for (auto const& entry : val.array())
{
result.push_back(LlsdToJson(*it));
result.push_back(LlsdToJson(entry));
}
break;
case LLSD::TypeBinary:

View File

@@ -267,12 +267,10 @@ void LLParamSDParserUtilities::readSDValues(read_sd_cb_t cb, const LLSD& sd, LLI
}
else if (sd.isArray())
{
for (LLSD::array_const_iterator it = sd.beginArray();
it != sd.endArray();
++it)
for (auto const& entry : sd.array())
{
stack.push_back(make_pair(std::string(), true));
readSDValues(cb, *it, stack);
readSDValues(cb, entry, stack);
stack.pop_back();
}
}

View File

@@ -1322,13 +1322,11 @@ S32 LLSDNotationFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32
{
ostr << post << pre << "[";
bool need_comma = false;
auto iter = data.beginArray();
auto end = data.endArray();
for(; iter != end; ++iter)
for (const auto& entry : data.array())
{
if(need_comma) ostr << ",";
if (need_comma) ostr << ",";
need_comma = true;
format_count += format_impl(*iter, ostr, options, level + 1);
format_count += format_impl(entry, ostr, options, level + 1);
}
ostr << "]";
break;
@@ -1461,11 +1459,9 @@ S32 LLSDBinaryFormatter::format(const LLSD& data, std::ostream& ostr, U32 option
ostr.put('[');
U32 size_nbo = htonl(data.size());
ostr.write(reinterpret_cast<const char*>(&size_nbo), sizeof(U32));
auto iter = data.beginArray();
auto end = data.endArray();
for(; iter != end; ++iter)
for (const auto& entry : data.array())
{
format_count += format(*iter, ostr);
format_count += format(entry, ostr);
}
ostr.put(']');
break;

View File

@@ -116,11 +116,9 @@ S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 opti
else
{
ostr << pre << "<array>" << post;
LLSD::array_const_iterator iter = data.beginArray();
LLSD::array_const_iterator end = data.endArray();
for(; iter != end; ++iter)
for (const auto& entry : data.array())
{
format_count += format_impl(*iter, ostr, options, level + 1);
format_count += format_impl(entry, ostr, options, level + 1);
}
ostr << pre << "</array>" << post;
}

View File

@@ -891,9 +891,9 @@ LLSD llsd_clone(LLSD value, LLSD filter)
break;
case LLSD::TypeArray:
clone = LLSD::emptyArray();
for (LLSD::array_const_iterator ita = value.beginArray(); ita != value.endArray(); ++ita)
for (auto const& entry : value.array())
{
clone.append(llsd_clone(*ita, filter));
clone.append(llsd_clone(entry, filter));
}
break;
@@ -943,9 +943,9 @@ LLSD llsd_shallow(LLSD value, LLSD filter)
else if (value.isArray())
{
shallow = LLSD::emptyArray();
for (LLSD::array_const_iterator ita = value.beginArray(); ita != value.endArray(); ++ita)
for (auto const& entry : value.array())
{
shallow.append(*ita);
shallow.append(entry);
}
}
else

View File

@@ -1340,7 +1340,8 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals)
// std::locale() throws if the locale is unknown! (EXT-7926)
try
{
strStream.imbue(std::locale(sLocale.c_str()));
std::locale locale(sLocale.c_str());
strStream.imbue(locale);
} catch (const std::exception &)
{
LL_WARNS_ONCE("Locale") << "Cannot set locale to " << sLocale << LL_ENDL;

View File

@@ -243,7 +243,7 @@ public:
bool operator<(const LLFormatMapString& rhs) const { return mString < rhs.mString; }
std::size_t length() const { return mString.length(); }
// The destructor may not throw.
~LLFormatMapString() throw() { }
~LLFormatMapString() noexcept { }
private:
std::string mString;

View File

@@ -1274,7 +1274,7 @@ BOOL gunzip_file(const std::string& srcfile, const std::string& dstfile)
const S32 UNCOMPRESS_BUFFER_SIZE = 32768;
BOOL retval = FALSE;
gzFile src = NULL;
U8 buffer[UNCOMPRESS_BUFFER_SIZE];
std::array<U8, UNCOMPRESS_BUFFER_SIZE> buffer;
LLFILE *dst = NULL;
S32 bytes = 0;
tmpfile = dstfile + ".t";
@@ -1288,8 +1288,8 @@ BOOL gunzip_file(const std::string& srcfile, const std::string& dstfile)
if (! dst) goto err;
do
{
bytes = gzread(src, buffer, UNCOMPRESS_BUFFER_SIZE);
size_t nwrit = fwrite(buffer, sizeof(U8), bytes, dst);
bytes = gzread(src, buffer.data(), buffer.size());
size_t nwrit = fwrite(buffer.data(), sizeof(U8), bytes, dst);
if (nwrit < (size_t) bytes)
{
LL_WARNS() << "Short write on " << tmpfile << ": Wrote " << nwrit << " of " << bytes << " bytes." << LL_ENDL;
@@ -1311,7 +1311,7 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile)
const S32 COMPRESS_BUFFER_SIZE = 32768;
std::string tmpfile;
BOOL retval = FALSE;
U8 buffer[COMPRESS_BUFFER_SIZE];
std::array<U8, COMPRESS_BUFFER_SIZE> buffer;
gzFile dst = NULL;
LLFILE *src = NULL;
S32 bytes = 0;
@@ -1325,9 +1325,9 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile)
src = LLFile::fopen(srcfile, "rb"); /* Flawfinder: ignore */
if (! src) goto err;
while ((bytes = (S32)fread(buffer, sizeof(U8), COMPRESS_BUFFER_SIZE, src)) > 0)
while ((bytes = (S32)fread(buffer.data(), sizeof(U8), buffer.size(), src)) > 0)
{
if (gzwrite(dst, buffer, bytes) <= 0)
if (gzwrite(dst, buffer.data(), bytes) <= 0)
{
LL_WARNS() << "gzwrite failed: " << gzerror(dst, NULL) << LL_ENDL;
goto err;

View File

@@ -103,9 +103,9 @@ LLSD LLSettingsBase::combineSDMaps(const LLSD &settings, const LLSD &other) cons
break;
case LLSD::TypeArray:
newSettings[key_name] = LLSD::emptyArray();
for (LLSD::array_const_iterator ita = value.beginArray(); ita != value.endArray(); ++ita)
for (auto const& entry : value.array())
{
newSettings[key_name].append(*ita);
newSettings[key_name].append(entry);
}
break;
//case LLSD::TypeInteger:
@@ -137,9 +137,9 @@ LLSD LLSettingsBase::combineSDMaps(const LLSD &settings, const LLSD &other) cons
break;
case LLSD::TypeArray:
newSettings[key_name] = LLSD::emptyArray();
for (LLSD::array_const_iterator ita = value.beginArray(); ita != value.endArray(); ++ita)
for (auto const& entry : value.array())
{
newSettings[key_name].append(*ita);
newSettings[key_name].append(entry);
}
break;
//case LLSD::TypeInteger:

View File

@@ -240,16 +240,16 @@ bool LLSettingsDay::initialize(bool validate_frames)
{
mDayTracks[i].clear();
LLSD curtrack = tracks[i];
for (LLSD::array_const_iterator it = curtrack.beginArray(); it != curtrack.endArray(); ++it)
for (const auto& entry : curtrack.array())
{
LLSettingsBase::TrackPosition keyframe = LLSettingsBase::TrackPosition((*it)[SETTING_KEYKFRAME].asReal());
LLSettingsBase::TrackPosition keyframe = LLSettingsBase::TrackPosition(entry[SETTING_KEYKFRAME].asReal());
keyframe = llclamp(keyframe, 0.0f, 1.0f);
LLSettingsBase::ptr_t setting;
if ((*it).has(SETTING_KEYNAME))
if (entry.has(SETTING_KEYNAME))
{
std::string key_name = (*it)[SETTING_KEYNAME];
std::string key_name = entry[SETTING_KEYNAME];
if (i == TRACK_WATER)
{
setting = used[key_name];
@@ -469,36 +469,36 @@ namespace
S32 framecount(0);
for (LLSD::array_iterator track = value.beginArray(); track != value.endArray(); ++track)
for (auto& entry : value.array())
{
S32 index = 0;
while (index < (*track).size())
while (index < entry.size())
{
LLSD& elem = (*track)[index];
LLSD& elem = entry[index];
++framecount;
if (index >= LLSettingsDay::FRAME_MAX)
{
(*track).erase(index);
entry.erase(index);
continue;
}
if (!elem.has(LLSettingsDay::SETTING_KEYKFRAME))
{
(*track).erase(index);
entry.erase(index);
continue;
}
if (!elem[LLSettingsDay::SETTING_KEYKFRAME].isReal())
{
(*track).erase(index);
entry.erase(index);
continue;
}
if (!elem.has(LLSettingsDay::SETTING_KEYNAME) &&
!elem.has(LLSettingsDay::SETTING_KEYID))
{
(*track).erase(index);
entry.erase(index);
continue;
}

View File

@@ -425,7 +425,7 @@ public:
}
void accept(oct_traveler* visitor) { visitor->visit(this); }
virtual bool isLeaf() const { return mChildCount == 0; }
bool isLeaf() const { return mChildCount == 0; }
U32 getElementCount() const { return mData.size(); }
bool isEmpty() const { return mData.size() == 0; }
@@ -498,7 +498,7 @@ public:
return node;
}
virtual bool insert(T* data)
bool insert(T* data) override
{
OctreeGuard::checkGuarded(this);
if (data == NULL || data->getBinIndex() != -1)
@@ -537,7 +537,7 @@ public:
OctreeStats::getInstance()->realloc(old_cap,mData.capacity());
#endif
BaseType::insert(data);
notifyAddition(data);
return true;
}
else
@@ -593,7 +593,7 @@ public:
OctreeStats::getInstance()->realloc(old_cap,mData.capacity());
#endif
BaseType::insert(data);
notifyAddition(data);
return true;
}
@@ -704,11 +704,11 @@ public:
#endif
}
this->notifyRemoval(data);
notifyRemoval(data);
checkAlive();
}
bool remove(T* data)
bool remove(T* data) final override
{
OctreeGuard::checkGuarded(this);
S32 i = data->getBinIndex();
@@ -849,10 +849,9 @@ public:
if (!silent)
{
for (U32 i = 0; i < this->getListenerCount(); i++)
for (auto& entry : this->mListeners)
{
oct_listener* listener = getOctListener(i);
listener->handleChildAddition(this, child);
((oct_listener*)entry.get())->handleChildAddition(this, child);
}
}
}
@@ -861,16 +860,17 @@ public:
{
OctreeGuard::checkGuarded(this);
for (U32 i = 0; i < this->getListenerCount(); i++)
oct_node* child = getChild(index);
for (auto& entry : this->mListeners)
{
oct_listener* listener = getOctListener(i);
listener->handleChildRemoval(this, getChild(index));
((oct_listener*)entry.get())->handleChildRemoval(this, child);
}
if (destroy)
{
mChild[index]->destroy();
delete mChild[index];
child->destroy();
delete child;
}
--mChildCount;
@@ -1012,7 +1012,7 @@ public:
}
// LLOctreeRoot::insert
bool insert(T* data)
bool insert(T* data) final override
{
if (data == NULL)
{

View File

@@ -44,7 +44,6 @@ public:
virtual void handleInsertion(const LLTreeNode<T>* node, T* data) = 0;
virtual void handleRemoval(const LLTreeNode<T>* node, T* data) = 0;
virtual void handleDestruction(const LLTreeNode<T>* node) = 0;
virtual void handleStateChange(const LLTreeNode<T>* node) = 0;
};
template <class T>
@@ -53,11 +52,15 @@ class LLTreeNode
public:
virtual ~LLTreeNode();
virtual bool insert(T* data);
virtual bool remove(T* data);
virtual void notifyRemoval(T* data);
virtual U32 getListenerCount() { return mListeners.size(); }
virtual LLTreeListener<T>* getListener(U32 index) const
virtual bool insert(T* data) = 0;
virtual bool remove(T* data) = 0;
bool notifyAddition(T* data);
void notifyRemoval(T* data);
U32 getListenerCount() const
{
return mListeners.size();
}
LLTreeListener<T>* getListener(U32 index) const
{
if(index < mListeners.size())
{
@@ -65,7 +68,10 @@ public:
}
return NULL;
}
virtual void addListener(LLTreeListener<T>* listener) { mListeners.push_back(listener); }
void addListener(LLTreeListener<T>* listener)
{
mListeners.push_back(listener);
}
protected:
void destroyListeners()
@@ -97,7 +103,7 @@ LLTreeNode<T>::~LLTreeNode()
};
template <class T>
bool LLTreeNode<T>::insert(T* data)
bool LLTreeNode<T>::notifyAddition(T* data)
{
for (U32 i = 0; i < mListeners.size(); i++)
{
@@ -106,12 +112,6 @@ bool LLTreeNode<T>::insert(T* data)
return true;
};
template <class T>
bool LLTreeNode<T>::remove(T* data)
{
return true;
};
template <class T>
void LLTreeNode<T>::notifyRemoval(T* data)
{

View File

@@ -38,7 +38,7 @@ class LLVolumeParams;
class LLProfile;
class LLPath;
template <class T> class LLOctreeNode;
template <class T> class LLOctreeRoot;
class LLVolumeFace;
class LLVolume;
@@ -964,7 +964,7 @@ public:
// vertices per joint.
LLJointRiggingInfoTab mJointRiggingInfoTab;
LLOctreeNode<LLVolumeTriangle>* mOctree;
LLOctreeRoot<LLVolumeTriangle>* mOctree;
//whether or not face has been cache optimized
BOOL mOptimized;

View File

@@ -112,14 +112,13 @@ public:
}
//LISTENER FUNCTIONS
virtual void handleChildAddition(const LLOctreeNode<LLVolumeTriangle>* parent,
LLOctreeNode<LLVolumeTriangle>* child);
virtual void handleStateChange(const LLTreeNode<LLVolumeTriangle>* node) { }
virtual void handleChildRemoval(const LLOctreeNode<LLVolumeTriangle>* parent,
const LLOctreeNode<LLVolumeTriangle>* child) { }
virtual void handleInsertion(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) { }
virtual void handleRemoval(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) { }
virtual void handleDestruction(const LLTreeNode<LLVolumeTriangle>* node) { }
void handleChildAddition(const LLOctreeNode<LLVolumeTriangle>* parent,
LLOctreeNode<LLVolumeTriangle>* child) final override;
void handleChildRemoval(const LLOctreeNode<LLVolumeTriangle>* parent,
const LLOctreeNode<LLVolumeTriangle>* child) final override { }
void handleInsertion(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) final override { }
void handleRemoval(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) final override { }
void handleDestruction(const LLTreeNode<LLVolumeTriangle>* node) final override { }
public:

View File

@@ -130,11 +130,10 @@ void LLExperienceCache::importFile(std::istream& istr)
LLSD experiences = data["experiences"];
LLUUID public_key;
LLSD::map_const_iterator it = experiences.beginMap();
for (; it != experiences.endMap(); ++it)
for (const auto& it : experiences.map())
{
public_key.set(it->first);
mCache[public_key] = it->second;
public_key.set(it.first);
mCache[public_key] = it.second;
}
LL_DEBUGS("ExperienceCache") << "importFile() loaded " << mCache.size() << LL_ENDL;
@@ -164,10 +163,8 @@ void LLExperienceCache::exportFile(std::ostream& ostr) const
void LLExperienceCache::bootstrap(const LLSD& legacyKeys, int initialExpiration)
{
LLExperienceCacheImpl::mapKeys(legacyKeys);
LLSD::array_const_iterator it = legacyKeys.beginArray();
for (/**/; it != legacyKeys.endArray(); ++it)
for (auto experience : legacyKeys.array())
{
LLSD experience = *it;
if (experience.has(EXPERIENCE_ID))
{
if (!experience.has(EXPIRES))
@@ -272,10 +269,8 @@ void LLExperienceCache::requestExperiencesCoro(const LLCoroResponder& responder,
LLSD experiences = result["experience_keys"];
for (LLSD::array_const_iterator it = experiences.beginArray();
it != experiences.endArray(); ++it)
for (const auto& row : experiences.array())
{
const LLSD& row = *it;
LLUUID public_key = row[EXPERIENCE_ID].asUUID();
LL_DEBUGS("ExperienceCache") << "Received result for " << public_key
@@ -286,10 +281,9 @@ void LLExperienceCache::requestExperiencesCoro(const LLCoroResponder& responder,
LLSD error_ids = result["error_ids"];
for (LLSD::array_const_iterator errIt = error_ids.beginArray();
errIt != error_ids.endArray(); ++errIt)
for (const auto& err : error_ids.array())
{
LLUUID id = errIt->asUUID();
LLUUID id = err.asUUID();
LLSD exp;
exp[EXPIRES] = DEFAULT_EXPIRATION;
exp[EXPERIENCE_ID] = id;
@@ -605,9 +599,9 @@ void LLExperienceCache::findExperienceByNameCoro(const LLCoroResponder& responde
}
const LLSD& experiences = result["experience_keys"];
for (LLSD::array_const_iterator it = experiences.beginArray(); it != experiences.endArray(); ++it)
for (const auto& it : experiences.array())
{
insert(*it);
insert(it);
}
fn(result);
@@ -803,15 +797,14 @@ void LLExperienceCache::updateExperience(LLSD updateData, ExperienceGetFn_t fn)
//=========================================================================
void LLExperienceCacheImpl::mapKeys(const LLSD& legacyKeys)
{
LLSD::array_const_iterator exp = legacyKeys.beginArray();
for (/**/; exp != legacyKeys.endArray(); ++exp)
{
if (exp->has(LLExperienceCacheImpl::EXPERIENCE_ID) && exp->has(LLExperienceCacheImpl::PRIVATE_KEY))
{
LLExperienceCacheImpl::privateToPublicKeyMap[(*exp)[LLExperienceCacheImpl::PRIVATE_KEY].asUUID()] =
(*exp)[LLExperienceCacheImpl::EXPERIENCE_ID].asUUID();
}
}
for (const auto& exp : legacyKeys.array())
{
if (exp.has(LLExperienceCacheImpl::EXPERIENCE_ID) && exp.has(LLExperienceCacheImpl::PRIVATE_KEY))
{
LLExperienceCacheImpl::privateToPublicKeyMap[exp[LLExperienceCacheImpl::PRIVATE_KEY].asUUID()] =
exp[LLExperienceCacheImpl::EXPERIENCE_ID].asUUID();
}
}
}
// Return time to retry a request that generated an error, based on

View File

@@ -734,11 +734,9 @@ void AISUpdate::parseUUIDArray(const LLSD& content, const std::string& name, uui
{
if (content.has(name))
{
for(LLSD::array_const_iterator it = content[name].beginArray(),
end = content[name].endArray();
it != end; ++it)
for (auto& id : content[name].array())
{
ids.insert((*it).asUUID());
ids.insert(id.asUUID());
}
}
}

View File

@@ -225,22 +225,20 @@ LLExperienceLog::~LLExperienceLog()
void LLExperienceLog::eraseExpired()
{
const auto& inst(*this); // Fixes Linux
std::vector<std::string> expired;
std::for_each(mEvents.beginMap(), mEvents.endMap(),
[&](const auto& event_pair)
{
const std::string& date = event_pair.first;
if (inst.isExpired(date))
{
for (const auto& event_pair : mEvents.map())
{
const std::string& date = event_pair.first;
if (isExpired(date))
{
expired.push_back(date);
}
});
}
}
for (const auto& date : expired)
{
mEvents.erase(date);
}
}
}
bool LLExperienceLog::isExpired(const std::string& date) const

View File

@@ -491,18 +491,18 @@ void LLFloaterExperienceProfile::setPreferences( const LLSD& content )
const LLSD& blocked = content["blocked"];
for(LLSD::array_const_iterator it = experiences.beginArray(); it != experiences.endArray() ; ++it)
for(const auto& exp : experiences.array())
{
if (it->asUUID()==mExperienceId)
if (exp.asUUID()==mExperienceId)
{
experienceAllowed();
return;
}
}
for(LLSD::array_const_iterator it = blocked.beginArray(); it != blocked.endArray() ; ++it)
for(const auto& exp : blocked.array())
{
if (it->asUUID()==mExperienceId)
if (exp.asUUID()==mExperienceId)
{
experienceBlocked();
return;
@@ -520,19 +520,17 @@ void LLFloaterExperienceProfile::onFieldChanged()
{
return;
}
LLSD::map_const_iterator st = mExperienceDetails.beginMap();
LLSD::map_const_iterator dt = mPackage.beginMap();
mDirty = false;
while(!mDirty && st != mExperienceDetails.endMap() && dt != mPackage.endMap())
mDirty = mPackage.size() != mExperienceDetails.size();
if (!mDirty)
{
mDirty = st->first != dt->first || st->second.asString() != dt->second.asString();
++st;++dt;
}
if (!mDirty && (st != mExperienceDetails.endMap() || dt != mPackage.endMap()))
{
mDirty = true;
LLSD::map_const_iterator st = mExperienceDetails.beginMap();
LLSD::map_const_iterator dt = mPackage.beginMap();
LLSD::map_const_iterator ste = mExperienceDetails.endMap();
LLSD::map_const_iterator dte = mPackage.endMap();
for (; st != ste && dt != dte; ++st, ++dt)
if (mDirty = st->first != dt->first || st->second.asString() != dt->second.asString())
break;
}
getChild<LLButton>(BTN_SAVE)->setEnabled(mDirty);
@@ -607,16 +605,15 @@ void LLFloaterExperienceProfile::onSaveComplete( const LLSD& content )
if (content.has("removed"))
{
const LLSD& removed = content["removed"];
LLSD::map_const_iterator it = removed.beginMap();
for(/**/; it != removed.endMap(); ++it)
for(const auto& it : removed.map())
{
const std::string& field = it->first;
const std::string& field = it.first;
if (field == LLExperienceCache::EXPERIENCE_ID)
{
//this message should be removed by the experience api
continue;
}
const LLSD& data = it->second;
const LLSD& data = it.second;
std::string error_tag = data["error_tag"].asString()+ "ExperienceProfileMessage";
LLSD fields;
if (LLNotificationTemplates::instance().templateExists(error_tag))
@@ -641,21 +638,21 @@ void LLFloaterExperienceProfile::onSaveComplete( const LLSD& content )
const LLSD& experiences = content["experience_keys"];
LLSD::array_const_iterator it = experiences.beginArray();
if (it == experiences.endArray())
{
if (experiences.size() == 0)
{
LL_WARNS() << "LLFloaterExperienceProfile::onSaveComplete called with empty content" << LL_ENDL;
return;
}
return;
}
if (!it->has(LLExperienceCache::EXPERIENCE_ID) || ((*it)[LLExperienceCache::EXPERIENCE_ID].asUUID() != id))
{
const auto& exp = experiences[0];
if (!exp.has(LLExperienceCache::EXPERIENCE_ID) || (exp[LLExperienceCache::EXPERIENCE_ID].asUUID() != id))
{
LL_WARNS() << "LLFloaterExperienceProfile::onSaveComplete called with unexpected experience id" << LL_ENDL;
return;
}
return;
}
refreshExperience(*it);
LLExperienceCache::instance().insert(*it);
refreshExperience(exp);
LLExperienceCache::instance().insert(exp);
LLExperienceCache::instance().fetch(id, true);
if (mSaveCompleteAction == VIEW)
@@ -872,14 +869,12 @@ bool LLFloaterExperienceProfile::hasPermission(const LLSD& content, const std::s
return false;
const LLSD& list = content[name];
LLSD::array_const_iterator it = list.beginArray();
while (it != list.endArray())
for (const auto& it : list.array())
{
if (it->asUUID() == test)
if (it.asUUID() == test)
{
return true;
}
++it;
}
return false;
}

View File

@@ -259,9 +259,9 @@ void LLFloaterExperiences::checkAndOpen(LLPanelExperiences* panel, const LLSD& c
if (mPrepurchaseIds.size() + 1 == response_ids.size())
{
// we have a new element
for (LLSD::array_const_iterator it = response_ids.beginArray(); it != response_ids.endArray(); ++it)
for (const auto& it : response_ids.array())
{
LLUUID experience_id = it->asUUID();
LLUUID experience_id = it.asUUID();
if (std::find(mPrepurchaseIds.begin(), mPrepurchaseIds.end(), experience_id) == mPrepurchaseIds.end())
{
// new element found, open it

View File

@@ -1681,12 +1681,9 @@ struct LLEstateAccessChangeInfo
{
mDialogName = sd["dialog_name"].asString();
mOperationFlag = (U32)sd["operation"].asInteger();
LLSD::array_const_iterator end_it = sd["allowed_ids"].endArray();
for (LLSD::array_const_iterator id_it = sd["allowed_ids"].beginArray();
id_it != end_it;
++id_it)
for (auto const& id : sd["allowed_ids"].array())
{
mAgentOrGroupIDs.push_back(id_it->asUUID());
mAgentOrGroupIDs.push_back(id.asUUID());
}
}
@@ -4267,9 +4264,9 @@ void LLPanelEstateAccess::onEstateAccessReceived(const LLSD& result)
const auto order = allowed_agent_name_list->getSortOrder();
allowed_agent_name_list->clearSortOrder();
allowed_agent_name_list->deleteAllItems();
for (LLSD::array_const_iterator it = result["AllowedAgents"].beginArray(); it != result["AllowedAgents"].endArray(); ++it)
for (auto const& entry : result["AllowedAgents"].array())
{
LLUUID id = (*it)["id"].asUUID();
LLUUID id = entry["id"].asUUID();
allowed_agent_name_list->addNameItem(id);
}
allowed_agent_name_list->setSortOrder(order);
@@ -4288,23 +4285,23 @@ void LLPanelEstateAccess::onEstateAccessReceived(const LLSD& result)
const auto order = banned_agent_name_list->getSortOrder();
banned_agent_name_list->clearSortOrder();
banned_agent_name_list->deleteAllItems();
for (LLSD::array_const_iterator it = result["BannedAgents"].beginArray(); it != result["BannedAgents"].endArray(); ++it)
for (auto const& entry : result["BannedAgents"].array())
{
LLSD item;
item["id"] = (*it)["id"].asUUID();
item["id"] = entry["id"].asUUID();
LLSD& columns = item["columns"];
columns[0]["column"] = "name"; // to be populated later
auto& col = columns[1];
col["column"] = "last_login_date";
handlePseudoISO8601((*it)["last_login_date"].asString(), col, format);
handlePseudoISO8601(entry["last_login_date"].asString(), col, format);
columns[2]["column"] = "ban_date";
handlePseudoISO8601((*it)["ban_date"].asString(), columns[2], format);
handlePseudoISO8601(entry["ban_date"].asString(), columns[2], format);
columns[3]["column"] = "bannedby";
LLUUID banning_id = (*it)["banning_id"].asUUID();
LLUUID banning_id = entry["banning_id"].asUUID();
LLAvatarName av_name;
if (banning_id.isNull())
{
@@ -4332,9 +4329,9 @@ void LLPanelEstateAccess::onEstateAccessReceived(const LLSD& result)
const auto order = allowed_group_name_list->getSortOrder();
allowed_group_name_list->clearSortOrder();
allowed_group_name_list->deleteAllItems();
for (LLSD::array_const_iterator it = result["AllowedGroups"].beginArray(); it != result["AllowedGroups"].endArray(); ++it)
for (auto const& entry : result["AllowedGroups"].array())
{
LLUUID id = (*it)["id"].asUUID();
LLUUID id = entry["id"].asUUID();
allowed_group_name_list->addGroupNameItem(id);
}
allowed_group_name_list->setSortOrder(order);
@@ -4352,9 +4349,9 @@ void LLPanelEstateAccess::onEstateAccessReceived(const LLSD& result)
const auto order = estate_manager_name_list->getSortOrder();
estate_manager_name_list->clearSortOrder();
estate_manager_name_list->deleteAllItems();
for (LLSD::array_const_iterator it = result["Managers"].beginArray(); it != result["Managers"].endArray(); ++it)
for (auto const& entry : result["Managers"].array())
{
LLUUID id = (*it)["agent_id"].asUUID();
LLUUID id = entry["agent_id"].asUUID();
estate_manager_name_list->addNameItem(id);
}
estate_manager_name_list->setSortOrder(order);

View File

@@ -876,12 +876,9 @@ void BGFolderHttpHandler::httpFailure(void)
if (is_internal_http_error_that_warrants_a_retry(mStatus)) // timed out
{
for(LLSD::array_const_iterator folder_it = mRequestSD["folders"].beginArray();
folder_it != mRequestSD["folders"].endArray();
++folder_it)
for (auto const& entry : mRequestSD["folders"].array())
{
LLSD folder_sd(*folder_it);
LLUUID folder_id(folder_sd["folder_id"].asUUID());
LLUUID folder_id(entry["folder_id"].asUUID());
const BOOL recursive = getIsRecursive(folder_id);
fetcher->addRequestAtFront(folder_id, recursive, true);
}

View File

@@ -59,11 +59,8 @@ void LLMapLayerResponder::httpSuccess(void)
LLWorldMap::getInstance()->mMapLayers.clear();
LLSD::array_const_iterator iter;
for(iter = mContent["LayerData"].beginArray(); iter != mContent["LayerData"].endArray(); ++iter)
for (auto const& layer_data : mContent["LayerData"].array())
{
const LLSD& layer_data = *iter;
LLWorldMapLayer new_layer;
new_layer.LayerDefined = TRUE;

View File

@@ -301,11 +301,8 @@ public:
log_SLM_infos("Get /listings", getStatus(), body);
// Extract the info from the results
for (LLSD::array_iterator it = result["listings"].beginArray();
it != result["listings"].endArray(); ++it)
for (auto const& listing : result["listings"].array())
{
LLSD listing = *it;
int listingId = listing["id"].asInteger();
bool isListed = listing["is_listed"].asBoolean();
std::string editUrl = listing["edit_url"].asString();
@@ -367,12 +364,8 @@ public:
log_SLM_infos("Post /listings", getStatus(), body);
// Extract the info from the Json string
auto it = result["listings"].beginArray();
while (it != result["listings"].endArray())
for (auto const& listing : result["listings"].array())
{
auto listing = *it;
int listing_id = listing["id"].asInteger();
bool is_listed = listing["is_listed"].asBoolean();
std::string edit_url = listing["edit_url"].asString();
@@ -385,7 +378,6 @@ public:
LLMarketplaceData::instance().addListing(folder_id,listing_id,version_id,is_listed,edit_url,count);
update_marketplace_category(folder_id, false);
gInventory.notifyObservers();
it++;
}
}
virtual char const* getName() const { return "LLSLMCreateListingsResponder"; }
@@ -439,11 +431,8 @@ public:
log_SLM_infos("Get /listing", getStatus(), body);
// Extract the info from the results
for (LLSD::array_iterator it = result["listings"].beginArray();
it != result["listings"].endArray(); ++it)
for (auto const& listing : result["listings"].array())
{
LLSD listing = *it;
int resListingId = listing["id"].asInteger();
bool isListed = listing["is_listed"].asBoolean();
std::string editUrl = listing["edit_url"].asString();
@@ -510,11 +499,8 @@ public:
log_SLM_infos("Put /listing", getStatus(), body);
// Extract the info from the Json string
for (LLSD::array_iterator it = result["listings"].beginArray();
it != result["listings"].endArray(); ++it)
for (auto const& listing : result["listings"].array())
{
LLSD listing = *it;
int listing_id = listing["id"].asInteger();
bool is_listed = listing["is_listed"].asBoolean();
std::string edit_url = listing["edit_url"].asString();
@@ -591,11 +577,8 @@ public:
log_SLM_infos("Put /associate_inventory", getStatus(), body);
for (LLSD::array_iterator it = result["listings"].beginArray();
it != result["listings"].endArray(); ++it)
for (auto const& listing : result["listings"].array())
{
LLSD listing = *it;
int listing_id = listing["id"].asInteger();
bool is_listed = listing["is_listed"].asBoolean();
std::string edit_url = listing["edit_url"].asString();
@@ -666,11 +649,8 @@ public:
log_SLM_infos("Delete /listing", getStatus(), body);
for (LLSD::array_iterator it = result["listings"].beginArray();
it != result["listings"].endArray(); ++it)
for (auto const& listing : result["listings"].array())
{
LLSD listing = *it;
int listing_id = listing["id"].asInteger();
LLUUID folder_id = LLMarketplaceData::instance().getListingFolder(listing_id);
LLMarketplaceData::instance().deleteListing(folder_id);

View File

@@ -420,9 +420,8 @@ void LLMaterialMgr::onGetResponse(bool success, const LLSD& content, const LLUUI
llassert(response_data.isArray());
LL_DEBUGS("Materials") << "response has "<< response_data.size() << " materials" << LL_ENDL;
for (LLSD::array_const_iterator itMaterial = response_data.beginArray(); itMaterial != response_data.endArray(); ++itMaterial)
for (auto const& material_data : response_data.array())
{
const LLSD& material_data = *itMaterial;
llassert(material_data.isMap());
llassert(material_data.has(MATERIALS_CAP_OBJECT_ID_FIELD));
@@ -465,9 +464,8 @@ void LLMaterialMgr::onGetAllResponse(bool success, const LLSD& content, const LL
llassert(response_data.isArray());
LL_DEBUGS("Materials") << "response has "<< response_data.size() << " materials" << LL_ENDL;
for (LLSD::array_const_iterator itMaterial = response_data.beginArray(); itMaterial != response_data.endArray(); ++itMaterial)
for (auto const& material_data : response_data.array())
{
const LLSD& material_data = *itMaterial;
llassert(material_data.isMap());
llassert(material_data.has(MATERIALS_CAP_OBJECT_ID_FIELD));
@@ -531,11 +529,9 @@ void LLMaterialMgr::onPutResponse(bool success, const LLSD& content)
{
llassert(response_data.isArray());
LL_DEBUGS("Materials") << "response has "<< response_data.size() << " materials" << LL_ENDL;
for (LLSD::array_const_iterator faceIter = response_data.beginArray(); faceIter != response_data.endArray(); ++faceIter)
#ifdef SHOW_ASSERT
for (auto const& face_data : response_data.array())
{
# ifndef LL_RELEASE_FOR_DOWNLOAD
const LLSD& face_data = *faceIter; // conditional to avoid unused variable warning
# endif
llassert(face_data.isMap());
llassert(face_data.has(MATERIALS_CAP_OBJECT_ID_FIELD));
@@ -552,6 +548,7 @@ void LLMaterialMgr::onPutResponse(bool success, const LLSD& content)
// *TODO: do we really still need to process this?
}
#endif
}
}

View File

@@ -104,12 +104,12 @@ void LLPanelExperienceListEditor::addExperienceIds( const uuid_vec_t& experience
void LLPanelExperienceListEditor::setExperienceIds( const LLSD& experience_ids )
{
mExperienceIds.clear();
for_each(experience_ids.beginArray(), experience_ids.endArray(), [this] (const LLUUID& id)
for (const auto& id : experience_ids.array())
{
// Using insert(range) doesn't work here because the conversion from
// LLSD to LLUUID is ambiguous: have to specify asUUID() for each entry.
mExperienceIds.insert(id);
});
mExperienceIds.insert(id.asUUID());
}
onItems();
}

View File

@@ -41,6 +41,8 @@
#include "llfloaterreporter.h"
#include "llinventoryfunctions.h"
#include <boost/range/adaptor/reversed.hpp>
#define BTN_PROFILE_XP "btn_profile_xp"
#define BTN_REPORT_XP "btn_report_xp"
@@ -120,16 +122,14 @@ void LLPanelExperienceLog::refresh()
if (!events.emptyMap())
{
LLSD::map_const_iterator day = events.endMap();
do
for (const auto& day : boost::adaptors::reverse(events.map()))
{
--day;
const std::string& date = day->first;
const std::string& date = day.first;
if (LLExperienceLog::instance().isExpired(date))
{
continue;
}
const LLSD& dayArray = day->second;
const LLSD& dayArray = day.second;
U32 size = dayArray.size();
if(itemsToSkip > size)
{
@@ -161,7 +161,7 @@ void LLPanelExperienceLog::refresh()
LLSD& columns = item["columns"];
columns[0]["column"] = "time";
columns[0]["value"] = day->first+event["Time"].asString();
columns[0]["value"] = day.first+event["Time"].asString();
columns[1]["column"] = "event";
columns[1]["value"] = LLExperienceLog::getPermissionString(event, "ExperiencePermissionShort");
columns[2]["column"] = "experience_name";
@@ -172,7 +172,7 @@ void LLPanelExperienceLog::refresh()
}
++items;
}
} while (day != events.beginMap());
}
}
if (waiting)
{

View File

@@ -326,11 +326,8 @@ void LLPanelExperiencePicker::filterContent()
search_results->deleteAllItems();
LLSD item;
LLSD::array_const_iterator it = experiences.beginArray();
for ( ; it != experiences.endArray(); ++it)
for (const auto& experience : experiences.array())
{
const LLSD& experience = *it;
if (isExperienceHidden(experience))
continue;

View File

@@ -88,10 +88,9 @@ void LLPanelExperiences::setExperienceList( const LLSD& experiences )
mExperiencesList->clear();
auto& cache = LLExperienceCache::instance();
LLSD::array_const_iterator it = experiences.beginArray();
for( /**/ ; it != experiences.endArray(); ++it)
for(const auto& exp : experiences.array())
{
LLUUID public_key = it->asUUID();
LLUUID public_key = exp.asUUID();
if (public_key.notNull())
cache.get(public_key, boost::bind(addExperienceToList, _1, mExperiencesList));
}
@@ -113,10 +112,9 @@ LLPanelExperiences* LLPanelExperiences::create(const std::string& name)
void LLPanelExperiences::removeExperiences( const LLSD& ids )
{
LLSD::array_const_iterator it = ids.beginArray();
for( /**/ ; it != ids.endArray(); ++it)
for (const auto& id : ids.array())
{
removeExperience(it->asUUID());
removeExperience(id.asUUID());
}
}

View File

@@ -106,10 +106,9 @@ void LLPanelGroupExperiences::setExperienceList(const LLSD& experiences)
mExperiencesList->clear();
auto& cache = LLExperienceCache::instance();
LLSD::array_const_iterator it = experiences.beginArray();
for ( /**/ ; it != experiences.endArray(); ++it)
{
LLUUID public_key = it->asUUID();
for (const auto& exp : experiences.array())
{
LLUUID public_key = exp.asUUID();
if (public_key.notNull())
cache.get(public_key, boost::bind(addExperienceToList, _1, mExperiencesList));
}

View File

@@ -139,8 +139,8 @@ public:
virtual void performAction(LLInventoryModel* model, std::string action);
virtual BOOL isUpToDate() const { return TRUE; }
virtual bool hasChildren() const { return FALSE; }
virtual LLInventoryType::EType getInventoryType() const { return LLInventoryType::IT_NONE; }
virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; }
virtual LLInventoryType::EType getInventoryType() const { return LLInventoryType::EType::IT_NONE; }
virtual LLWearableType::EType getWearableType() const { return LLWearableType::EType::WT_NONE; }
// LLDragAndDropBridge functionality
virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const;
@@ -161,7 +161,7 @@ LLTaskInvFVBridge::LLTaskInvFVBridge(
mPanel(panel),
mFlags(flags),
mAssetType(LLAssetType::AT_NONE),
mInventoryType(LLInventoryType::IT_NONE)
mInventoryType(LLInventoryType::EType::IT_NONE)
{
const LLInventoryItem *item = findItem();
if (item)
@@ -479,12 +479,9 @@ bool remove_task_inventory_callback(const LLSD& notification, const LLSD& respon
if(option == 0 && object)
{
// yes
LLSD::array_const_iterator list_end = notification["payload"]["inventory_ids"].endArray();
for (LLSD::array_const_iterator list_it = notification["payload"]["inventory_ids"].beginArray();
list_it != list_end;
++list_it)
for (auto const& entry : notification["payload"]["inventory_ids"].array())
{
object->removeInventory(list_it->asUUID());
object->removeInventory(entry.asUUID());
}
// refresh the UI.

View File

@@ -316,13 +316,13 @@ public:
void drawObjectBox(LLColor4 col);
LLSpatialPartition* getSpatialPartition() {return (LLSpatialPartition*)mSpatialPartition;}
LLSpatialPartition* getSpatialPartition() const {return (LLSpatialPartition*)mSpatialPartition;}
//LISTENER FUNCTIONS
virtual void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* face);
virtual void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* face);
virtual void handleDestruction(const TreeNode* node);
virtual void handleChildAddition(const OctreeNode* parent, OctreeNode* child);
void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* face) final override;
void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* face) final override;
void handleDestruction(const TreeNode* node) final override;
void handleChildAddition(const OctreeNode* parent, OctreeNode* child) final override;
LL_ALIGN_16(LLVector4a mViewAngle);

View File

@@ -776,19 +776,17 @@ void LLIMSpeakerMgr::setSpeakers(const LLSD& speakers)
std::vector<speaker_entry_t> speakerentries;
if ( speakers.has("agent_info") && speakers["agent_info"].isMap() )
{
for(LLSD::map_const_iterator speaker_it = speakers["agent_info"].beginMap();
speaker_it != speakers["agent_info"].endMap();
++speaker_it)
for (const auto& speaker : speakers["agent_info"].map())
{
boost::optional<bool> moderator;
boost::optional<bool> moderator_muted;
if (speaker_it->second.isMap())
if (speaker.second.isMap())
{
moderator = speaker_it->second["is_moderator"];
moderator_muted = speaker_it->second["mutes"]["text"];
moderator = speaker.second["is_moderator"];
moderator_muted = speaker.second["mutes"]["text"];
}
speakerentries.emplace_back(
LLUUID(speaker_it->first),
LLUUID(speaker.first),
LLSpeaker::SPEAKER_AGENT,
LLSpeaker::STATUS_TEXT_ONLY,
moderator,
@@ -800,11 +798,9 @@ void LLIMSpeakerMgr::setSpeakers(const LLSD& speakers)
{
//older, more decprecated way. Need here for
//using older version of servers
for(LLSD::array_const_iterator speaker_it = speakers["agents"].beginArray();
speaker_it != speakers["agents"].endArray();
++speaker_it)
for (auto const& entry : speakers["agents"].array())
{
speakerentries.emplace_back((*speaker_it).asUUID());
speakerentries.emplace_back(entry.asUUID());
}
}
LLSpeakerMgr::setSpeakers(speakerentries);
@@ -817,18 +813,16 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
std::vector<speaker_entry_t> speakerentries;
if ( update.has("agent_updates") && update["agent_updates"].isMap() )
{
for(LLSD::map_const_iterator update_it = update["agent_updates"].beginMap();
update_it != update["agent_updates"].endMap();
++update_it)
for (const auto& update : update["agent_updates"].map())
{
LLUUID agent_id(update_it->first);
LLUUID agent_id(update.first);
LLPointer<LLSpeaker> speakerp = findSpeaker(agent_id);
bool new_speaker = false;
boost::optional<bool> moderator;
boost::optional<bool> moderator_muted_text;
LLSD agent_data = update_it->second;
LLSD agent_data = update.second;
if (agent_data.isMap() && agent_data.has("transition"))
{
if (agent_data["transition"].asString() == "LEAVE")
@@ -875,14 +869,12 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
}
else if ( update.has("updates") && update["updates"].isMap() )
{
for (LLSD::map_const_iterator update_it = update["updates"].beginMap();
update_it != update["updates"].endMap();
++update_it)
for (const auto& update : update["updates"].map())
{
LLUUID agent_id(update_it->first);
LLUUID agent_id(update.first);
LLPointer<LLSpeaker> speakerp = findSpeaker(agent_id);
std::string agent_transition = update_it->second.asString();
std::string agent_transition = update.second.asString();
if (agent_transition == "LEAVE")
{
setSpeakerNotInChannel(speakerp);

View File

@@ -255,7 +255,6 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
//----------------------------------------------------------------
llassert( !(mTexture.notNull() && mLayerSet) ); // mutually exclusive
LLTexUnit::eTextureAddressMode old_mode = LLTexUnit::TAM_WRAP;
LLViewerTexLayerSet *layerset = dynamic_cast<LLViewerTexLayerSet*>(mLayerSet);
if (mTestImageName)
{
@@ -292,19 +291,13 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
else
if ( !is_dummy && mTexture.notNull() )
{
if(mTexture->hasGLTexture())
{
old_mode = mTexture->getAddressMode();
}
gGL.getTexUnit(diffuse_channel)->bind(mTexture);
gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
}
else
{
gGL.getTexUnit(diffuse_channel)->bind(LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT));
}
U32 mask = sRenderMask;
U32 start = mMesh->mFaceVertexOffset;
@@ -349,12 +342,6 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
gGL.getTexUnit(diffuse_channel)->setTextureBlendType(LLTexUnit::TB_MULT);
}
if (mTexture.notNull() && !is_dummy)
{
gGL.getTexUnit(diffuse_channel)->bind(mTexture);
gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(old_mode);
}
return triangle_count;
}

View File

@@ -474,7 +474,7 @@ class LLFileUploadBulk : public view_listener_t
asset_name,
0,
LLFolderType::FT_NONE,
LLInventoryType::IT_NONE,
LLInventoryType::EType::IT_NONE,
LLFloaterPerms::getNextOwnerPerms("Uploads"),
LLFloaterPerms::getGroupPerms("Uploads"),
LLFloaterPerms::getEveryonePerms("Uploads"),
@@ -963,10 +963,10 @@ void upload_new_resource(const std::string& src_filename, std::string name,
// <edit> hack to create scripts and gestures
if(exten == "lsl" || exten == "gesture" || exten == "notecard") // added notecard Oct 15 2009
{
LLInventoryType::EType inv_type = LLInventoryType::IT_GESTURE;
if (exten == "lsl") inv_type = LLInventoryType::IT_LSL;
else if(exten == "gesture") inv_type = LLInventoryType::IT_GESTURE;
else if(exten == "notecard") inv_type = LLInventoryType::IT_NOTECARD;
LLInventoryType::EType inv_type = LLInventoryType::EType::IT_GESTURE;
if (exten == "lsl") inv_type = LLInventoryType::EType::IT_LSL;
else if(exten == "gesture") inv_type = LLInventoryType::EType::IT_GESTURE;
else if(exten == "notecard") inv_type = LLInventoryType::EType::IT_NOTECARD;
create_inventory_item( gAgent.getID(),
gAgent.getSessionID(),
gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(asset_type)),
@@ -1354,7 +1354,7 @@ void assign_defaults_and_show_upload_message(LLAssetType::EType asset_type,
const std::string& display_name,
std::string& description)
{
if (LLInventoryType::IT_NONE == inventory_type)
if (LLInventoryType::EType::IT_NONE == inventory_type)
{
inventory_type = LLInventoryType::defaultForAssetType(asset_type);
}
@@ -1412,9 +1412,9 @@ void NewResourceItemCallback::fire(const LLUUID& new_item_id)
std::string type("Uploads");
switch(new_item->getInventoryType())
{
case LLInventoryType::IT_LSL: type = "Scripts"; break;
case LLInventoryType::IT_GESTURE: type = "Gestures"; break;
case LLInventoryType::IT_NOTECARD: type = "Notecard"; break;
case LLInventoryType::EType::IT_LSL: type = "Scripts"; break;
case LLInventoryType::EType::IT_GESTURE: type = "Gestures"; break;
case LLInventoryType::EType::IT_NOTECARD: type = "Notecard"; break;
default: break;
}
LLPermissions perms = new_item->getPermissions();

View File

@@ -1312,7 +1312,7 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam
if (gSavedSettings.getBOOL("ShowInInventory") &&
objects.size() == 1 && item != NULL &&
asset_type != LLAssetType::AT_CALLINGCARD &&
item->getInventoryType() != LLInventoryType::IT_ATTACHMENT &&
item->getInventoryType() != LLInventoryType::EType::IT_ATTACHMENT &&
!from_name.empty())
{
LLPanelMainInventory::showAgentInventory(TRUE);
@@ -6570,10 +6570,9 @@ void send_lures(const LLSD& notification, const LLSD& response)
if ( (RlvActions::hasBehaviour(RLV_BHVR_SENDIM)) || (RlvActions::hasBehaviour(RLV_BHVR_SENDIMTO)) )
{
// Filter the lure message if one of the recipients of the lure can't be sent an IM to
for (LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray();
it != notification["payload"]["ids"].endArray(); ++it)
for (auto const& entry : notification["payload"]["ids"].array())
{
if (!RlvActions::canSendIM(it->asUUID()))
if (!RlvActions::canSendIM(entry.asUUID()))
{
text = rlv_hidden;
break;
@@ -6594,11 +6593,9 @@ void send_lures(const LLSD& notification, const LLSD& response)
bool fRlvHideName = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES);
bool fRlvNoNearbyNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS);
// [/RLVa:KB]
for (LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray();
it != notification["payload"]["ids"].endArray();
++it)
for (auto const& entry : notification["payload"]["ids"].array())
{
LLUUID target_id = it->asUUID();
LLUUID target_id = entry.asUUID();
msg->nextBlockFast(_PREHASH_TargetData);
msg->addUUIDFast(_PREHASH_TargetID, target_id);

View File

@@ -1123,11 +1123,9 @@ void LLObjectBackup::importObject_continued(AIFilePicker* filepicker)
mRezCount = 0;
updateImportNumbers();
for (LLSD::array_const_iterator prim_arr_it = mLLSD["data"].beginArray(),
prim_arr_end = mLLSD["data"].endArray();
prim_arr_it != prim_arr_end; ++prim_arr_it)
for (auto const& entry : mLLSD["data"].array())
{
LLSD llsd2 = (*prim_arr_it)["group_body"];
LLSD llsd2 = entry["group_body"];
for (LLSD::map_const_iterator prim_it = llsd2.beginMap(),
prim_end = llsd2.endMap();

View File

@@ -746,12 +746,9 @@ public:
void clear_object_list_pending_requests()
{
// TODO*: No more hard coding
for (
LLSD::array_iterator iter = mObjectIDs.beginArray();
iter != mObjectIDs.endArray();
++iter)
for (auto const& id : mObjectIDs.array())
{
gObjectList.onObjectCostFetchFailure(iter->asUUID());
gObjectList.onObjectCostFetchFailure(id.asUUID());
}
}
@@ -789,23 +786,20 @@ public:
// Success, grab the resource cost and linked set costs
// for an object if one was returned
for (
LLSD::array_iterator iter = mObjectIDs.beginArray();
iter != mObjectIDs.endArray();
++iter)
for (auto const& entry : mObjectIDs.array())
{
LLUUID object_id = iter->asUUID();
LLUUID object_id = entry.asUUID();
// Check to see if the request contains data for the object
if ( mContent.has(iter->asString()) )
if ( mContent.has(entry.asString()) )
{
F32 link_cost =
mContent[iter->asString()]["linked_set_resource_cost"].asReal();
mContent[entry.asString()]["linked_set_resource_cost"].asReal();
F32 object_cost =
mContent[iter->asString()]["resource_cost"].asReal();
mContent[entry.asString()]["resource_cost"].asReal();
F32 physics_cost = mContent[iter->asString()]["physics_cost"].asReal();
F32 link_physics_cost = mContent[iter->asString()]["linked_set_physics_cost"].asReal();
F32 physics_cost = mContent[entry.asString()]["physics_cost"].asReal();
F32 link_physics_cost = mContent[entry.asString()]["linked_set_physics_cost"].asReal();
gObjectList.updateObjectCost(object_id, object_cost, link_cost, physics_cost, link_physics_cost);
}
@@ -837,12 +831,9 @@ public:
void clear_object_list_pending_requests()
{
// TODO*: No more hard coding
for (
LLSD::array_iterator iter = mObjectIDs.beginArray();
iter != mObjectIDs.endArray();
++iter)
for (auto const& id : mObjectIDs.array())
{
gObjectList.onPhysicsFlagsFetchFailure(iter->asUUID());
gObjectList.onPhysicsFlagsFetchFailure(id.asUUID());
}
}
@@ -880,17 +871,14 @@ public:
// Success, grab the resource cost and linked set costs
// for an object if one was returned
for (
LLSD::array_iterator iter = mObjectIDs.beginArray();
iter != mObjectIDs.endArray();
++iter)
for (auto const& entry : mObjectIDs.array())
{
LLUUID object_id = iter->asUUID();
LLUUID object_id = entry.asUUID();
// Check to see if the request contains data for the object
if (mContent.has(iter->asString()))
if (mContent.has(entry.asString()))
{
const LLSD& data = mContent[iter->asString()];
const LLSD& data = mContent[entry.asString()];
S32 shape_type = data["PhysicsShapeType"].asInteger();

View File

@@ -467,6 +467,11 @@ LLViewerOctreeGroup::LLViewerOctreeGroup(OctreeNode* node) :
mBounds[1] = node->getSize();
mOctreeNode->addListener(this);
for (U32 i = 0; i < sizeof(mVisible) / sizeof(mVisible[0]); i++)
{
mVisible[i] = 0;
}
}
bool LLViewerOctreeGroup::hasElement(LLViewerOctreeEntryData* data)
@@ -632,17 +637,6 @@ void LLViewerOctreeGroup::handleDestruction(const TreeNode* node)
mOctreeNode = NULL;
}
//virtual
void LLViewerOctreeGroup::handleStateChange(const TreeNode* node)
{
//drop bounding box upon state change
if (mOctreeNode != node)
{
mOctreeNode = (OctreeNode*) node;
}
unbound();
}
//virtual
void LLViewerOctreeGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* child)
{
@@ -813,7 +807,7 @@ U32 LLOcclusionCullingGroup::getNewOcclusionQueryObjectName()
return sQueryPool.allocate();
}
void LLOcclusionCullingGroup::releaseOcclusionQueryObjectName(GLuint name)
void LLOcclusionCullingGroup::releaseOcclusionQueryObjectName(U32 name)
{
sQueryPool.release(name);
}

View File

@@ -222,12 +222,11 @@ public:
void clearState(U32 state) {mState &= ~state;}
//LISTENER FUNCTIONS
virtual void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* obj);
virtual void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* obj);
virtual void handleDestruction(const TreeNode* node);
virtual void handleStateChange(const TreeNode* node);
virtual void handleChildAddition(const OctreeNode* parent, OctreeNode* child);
virtual void handleChildRemoval(const OctreeNode* parent, const OctreeNode* child);
void handleInsertion(const TreeNode* node, LLViewerOctreeEntry* obj) override;
void handleRemoval(const TreeNode* node, LLViewerOctreeEntry* obj) override;
void handleDestruction(const TreeNode* node) override;
void handleChildAddition(const OctreeNode* parent, OctreeNode* child) override;
void handleChildRemoval(const OctreeNode* parent, const OctreeNode* child) final override;
OctreeNode* getOctreeNode() {return mOctreeNode;}
LLViewerOctreeGroup* getParent();
@@ -308,11 +307,11 @@ public:
U32 getLastOcclusionIssuedTime();
//virtual
void handleChildAddition(const OctreeNode* parent, OctreeNode* child);
void handleChildAddition(const OctreeNode* parent, OctreeNode* child) override;
//virtual
BOOL isRecentlyVisible() const;
LLViewerOctreePartition* getSpatialPartition()const {return mSpatialPartition;}
//LLViewerOctreePartition* getSpatialPartition()const {return mSpatialPartition;}
BOOL isAnyRecentlyVisible() const;
static U32 getNewOcclusionQueryObjectName();
@@ -350,7 +349,7 @@ public:
public:
U32 mPartitionType;
U32 mDrawableType;
OctreeNode* mOctree;
OctreeRoot* mOctree;
LLViewerRegion* mRegionp; // the region this partition belongs to.
BOOL mOcclusionEnabled; // if TRUE, occlusion culling is performed
U32 mLODSeed;

View File

@@ -76,7 +76,7 @@ LLViewerTexLayerSetBuffer::LLViewerTexLayerSetBuffer(LLTexLayerSet* const owner,
S32 width, S32 height) :
// ORDER_LAST => must render these after the hints are created.
LLTexLayerSetBuffer(owner),
LLViewerDynamicTexture( width, height, 4, LLViewerDynamicTexture::ORDER_LAST, TRUE ),
LLViewerDynamicTexture( width, height, 4, LLViewerDynamicTexture::ORDER_LAST, FALSE ),
mUploadPending(FALSE), // Not used for any logic here, just to sync sending of updates
mNeedsUpload(FALSE),
mNumLowresUploads(0),

View File

@@ -2533,12 +2533,10 @@ void LLVOVolume::updateObjectMediaData(const LLSD &media_data_array, const std::
mLastFetchedMediaVersion = fetched_version;
//LL_INFOS() << "updating:" << this->getID() << " " << ll_pretty_print_sd(media_data_array) << LL_ENDL;
LLSD::array_const_iterator iter = media_data_array.beginArray();
LLSD::array_const_iterator end = media_data_array.endArray();
U8 texture_index = 0;
for (; iter != end; ++iter, ++texture_index)
for (auto const& entry : media_data_array.array())
{
syncMediaData(texture_index, *iter, false/*merge*/, false/*ignore_agent*/);
syncMediaData(texture_index++, entry, false/*merge*/, false/*ignore_agent*/);
}
}
}

View File

@@ -2273,8 +2273,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
BOOL to_texture = LLPipeline::sUseOcclusion > 1 &&
!hasRenderType(LLPipeline::RENDER_TYPE_HUD) &&
LLViewerCamera::sCurCameraID == LLViewerCamera::CAMERA_WORLD &&
LLGLSLShader::sNoFixedFunction &&
sRenderGlow;
LLGLSLShader::sNoFixedFunction;
if (to_texture)
{