From 31cf29f51faf2cadcdff56a62e1051f227765db7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2010 19:52:14 -0600 Subject: [PATCH 1/2] Dear GCC: :( Sincerely, Shyotl --- indra/llxml/llcontrol.cpp | 7 ++----- indra/llxml/llcontrol.h | 22 +++++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 7d9bfddae..7bd36f595 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -303,11 +303,8 @@ LLPointer LLControlGroup::getControl(const std::string& name) gSettingsCallMap.push_back(std::pair(name.c_str(),1)); } #endif //PROF_CTRL_CALLS - //return iter == mNameTable.end() ? LLPointer() : iter->second; - - LLControlVariable *pFoundVar = (iter != mNameTable.end()) ? iter->second : NULL; - if(pFoundVar) - return pFoundVar->getCOAActive(); + if(iter != mNameTable.end()) + return iter->second->getCOAActive(); else return LLPointer(); } diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h index b3b6153fd..4da054595 100644 --- a/indra/llxml/llcontrol.h +++ b/indra/llxml/llcontrol.h @@ -38,6 +38,8 @@ #include "llmap.h" #include "llstring.h" #include "llrect.h" +#include "v4color.h" +#include "v4coloru.h" #include "llcontrolgroupreader.h" @@ -376,20 +378,13 @@ private: group.declareControl(name, type, init_value, comment, FALSE); } } - template void setValue(const LLSD& newvalue) //default behavior + void setValue(const LLSD& newvalue) //default behavior { mCachedValue = (const T &)newvalue; } - template <> void setValue(const LLSD& newvalue) - { - if(mControl->isType(TYPE_COL4U)) - mCachedValue.set(LLColor4U(newvalue)); //a color4u LLSD cannot be auto-converted to color4.. so do it manually. - else - mCachedValue = (const T &)newvalue; - } bool handleValueChange(const LLSD& newvalue) { - setValue(newvalue); + setValue(newvalue); return true; } @@ -400,6 +395,15 @@ private: } }; +template <> inline void LLCachedControl::setValue(const LLSD& newvalue) +{ + if(this->mControl->isType(TYPE_COL4U)) + this->mCachedValue.set(LLColor4U(newvalue)); //a color4u LLSD cannot be auto-converted to color4.. so do it manually. + else + this->mCachedValue = (const LLColor4 &)newvalue; +} + + //Following is actually defined in newview/llviewercontrol.cpp, but extern access is fine (Unless GCC bites me) template <> eControlType get_control_type(const U32& in, LLSD& out); template <> eControlType get_control_type(const S32& in, LLSD& out); From 3604f987345e5432822ebbe28f96d2fafe8f3362 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2010 00:26:17 -0600 Subject: [PATCH 2/2] Forgot something, apparently! Also, Boolean + Real = bad. --- indra/llxml/llcontrol.cpp | 1 + indra/newview/app_settings/settings_ascent.xml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp index 7bd36f595..76fb3fc6f 100644 --- a/indra/llxml/llcontrol.cpp +++ b/indra/llxml/llcontrol.cpp @@ -1094,6 +1094,7 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v { if(mIncludedFiles.find(filename) != mIncludedFiles.end()) return 0; //Already included this file. + mIncludedFiles.insert(filename); std::string name; LLSD settings; diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index 05df2dd9b..c55daaa62 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -166,7 +166,7 @@ Type Boolean Value - 0 + 0 AscentUseStatusColors @@ -177,7 +177,7 @@ Type Boolean Value - 0 + 0 AscentAvatarXModifier