From 31cf29f51faf2cadcdff56a62e1051f227765db7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2010 19:52:14 -0600 Subject: [PATCH] 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);