diff options
-rw-r--r-- | indra/llcommon/llapr.h | 3 | ||||
-rw-r--r-- | indra/llcommon/llprocesslauncher.h | 1 | ||||
-rw-r--r-- | indra/llrender/llglheaders.h | 1 | ||||
-rw-r--r-- | indra/llui/lltoolbar.h | 4 | ||||
-rw-r--r-- | indra/llui/llui.h | 72 | ||||
-rw-r--r-- | indra/llwindow/lldragdropwin32.h | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowwin32.h | 1 | ||||
-rw-r--r-- | indra/win_crash_logger/StdAfx.h | 1 |
8 files changed, 34 insertions, 51 deletions
diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index 286fc43a77..3f846f1314 100644 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -37,9 +37,6 @@ // If you get undefined symbols, find the appropriate // Windows header file and include that in your .cpp file. #define WIN32_LEAN_AND_MEAN - // do not define min() and max() macros, which collide with - // things like numeric_limits<T> - #define NOMINMAX #include <winsock2.h> #include <windows.h> #endif diff --git a/indra/llcommon/llprocesslauncher.h b/indra/llcommon/llprocesslauncher.h index 23e48b1823..954c249147 100644 --- a/indra/llcommon/llprocesslauncher.h +++ b/indra/llcommon/llprocesslauncher.h @@ -28,7 +28,6 @@ #define LL_LLPROCESSLAUNCHER_H #if LL_WINDOWS -#define NOMINMAX #include <windows.h> #endif diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index b936fd30f8..851a75629e 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -520,7 +520,6 @@ extern PFNGLSAMPLEMASKIPROC glSampleMaski; // windows gl headers depend on things like APIENTRY, so include windows. #define WIN32_LEAN_AND_MEAN -#define NOMINMAX #include <winsock2.h> #include <windows.h> diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 407cbde7d2..3c317e10a2 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -45,7 +45,7 @@ class LLToolBarButton : public LLButton public: struct Params : public LLInitParam::Block<Params, LLButton::Params> { - Optional<LLUI::Range<S32> > button_width; + Optional<LLUI::RangeS32> button_width; Optional<S32> desired_height; Params() @@ -67,7 +67,7 @@ private: LLCommandId mId; S32 mMouseDownX; S32 mMouseDownY; - LLUI::Range<S32> mWidthRange; + LLUI::RangeS32 mWidthRange; S32 mDesiredHeight; bool mIsDragged; startdrag_callback_t mStartDragItemCallback; diff --git a/indra/llui/llui.h b/indra/llui/llui.h index af8f239657..28e84fa444 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -151,46 +151,43 @@ public: // // Classes // - template <typename T> - struct RangeParams : public LLInitParam::Block<RangeParams<T> > - { - Optional<T> minimum, - maximum; - RangeParams() - : minimum("min", T()), - maximum("max", std::numeric_limits<T>::max()) - {} - }; - - template <typename T> - struct Range + struct RangeS32 { - typedef Range<T> self_t; + struct Params : public LLInitParam::Block<Params> + { + Optional<S32> minimum, + maximum; + + Params() + : minimum("min", 0), + maximum("max", S32_MAX) + {} + }; // correct for inverted params - Range(const RangeParams<T>& p = RangeParams<T>()) - : mMin(p.minimum), + RangeS32(const Params& p = Params()) + : mMin(p.minimum), mMax(p.maximum) { sanitizeRange(); } - Range(T minimum, T maximum) - : mMin(minimum), + RangeS32(S32 minimum, S32 maximum) + : mMin(minimum), mMax(maximum) { sanitizeRange(); } - S32 clamp(T input) + S32 clamp(S32 input) { if (input < mMin) return mMin; if (input > mMax) return mMax; return input; } - void setRange(T minimum, T maximum) + void setRange(S32 minimum, S32 maximum) { mMin = minimum; mMax = maximum; @@ -200,7 +197,7 @@ public: S32 getMin() { return mMin; } S32 getMax() { return mMax; } - bool operator==(const self_t& other) const + bool operator==(const RangeS32& other) const { return mMin == other.mMin && mMax == other.mMax; @@ -218,60 +215,55 @@ public: } - T mMin, + S32 mMin, mMax; }; - template<typename T> - struct ClampedValue : public Range<T> + struct ClampedS32 : public RangeS32 { - typedef Range<T> range_t; - - struct Params : public LLInitParam::Block<Params, RangeParams<T> > + struct Params : public LLInitParam::Block<Params, RangeS32::Params> { - Mandatory<T> value; + Mandatory<S32> value; Params() - : value("", T()) + : value("", 0) { addSynonym(value, "value"); } }; - ClampedValue(const Params& p) - : range_t(p) + ClampedS32(const Params& p) + : RangeS32(p) {} - ClampedValue(const range_t& range) - : range_t(range) + ClampedS32(const RangeS32& range) + : RangeS32(range) { // set value here, after range has been sanitized mValue = clamp(0); } - ClampedValue(T value, const range_t& range = range_t()) - : range_t(range) + ClampedS32(S32 value, const RangeS32& range = RangeS32()) + : RangeS32(range) { mValue = clamp(value); } - T get() + S32 get() { return mValue; } - void set(T value) + void set(S32 value) { mValue = clamp(value); } private: - T mValue; + S32 mValue; }; - typedef ClampedValue<S32> ClampedS32; - // // Methods // diff --git a/indra/llwindow/lldragdropwin32.h b/indra/llwindow/lldragdropwin32.h index 63054bffec..929e7f9e37 100644 --- a/indra/llwindow/lldragdropwin32.h +++ b/indra/llwindow/lldragdropwin32.h @@ -31,7 +31,6 @@ #ifndef LL_LLDRAGDROP32_H #define LL_LLDRAGDROP32_H -#define NOMINMAX #include <windows.h> #include <ole2.h> @@ -55,7 +54,6 @@ class LLDragDropWin32 #ifndef LL_LLDRAGDROP32_H #define LL_LLDRAGDROP32_H -#define NOMINMAX #include <windows.h> #include <ole2.h> diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index dc1950fb31..387e4cbdb6 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -29,7 +29,6 @@ // Limit Windows API to small and manageable set. #define WIN32_LEAN_AND_MEAN -#define NOMINMAX #include <winsock2.h> #include <windows.h> diff --git a/indra/win_crash_logger/StdAfx.h b/indra/win_crash_logger/StdAfx.h index 71faf88bad..35976658ac 100644 --- a/indra/win_crash_logger/StdAfx.h +++ b/indra/win_crash_logger/StdAfx.h @@ -37,7 +37,6 @@ #endif // _MSC_VER > 1000 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers -#define NOMINMAX // don't define min and max macros // Windows Header Files: #include <windows.h> |