summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/lltoolbar.h4
-rw-r--r--indra/llui/llui.h57
-rw-r--r--indra/win_crash_logger/StdAfx.h1
3 files changed, 26 insertions, 36 deletions
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 8cec1a16f4..28e84fa444 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -41,6 +41,7 @@
#include <boost/signals2.hpp>
#include "lllazyvalue.h"
#include "llframetimer.h"
+#include <limits>
// LLUIFactory
#include "llsd.h"
@@ -151,47 +152,42 @@ public:
// Classes
//
- template <typename T>
- struct Range
+ struct RangeS32
{
- typedef Range<T> self_t;
-
struct Params : public LLInitParam::Block<Params>
{
- typename Optional<T> minimum,
- maximum;
+ Optional<S32> minimum,
+ maximum;
Params()
: minimum("min", 0),
maximum("max", S32_MAX)
- {
-
- }
+ {}
};
// correct for inverted params
- Range(const Params& p = Params())
- : 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;
@@ -201,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;
@@ -219,16 +215,13 @@ 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, typename range_t::Params>
+ struct Params : public LLInitParam::Block<Params, RangeS32::Params>
{
Mandatory<S32> value;
@@ -239,40 +232,38 @@ public:
}
};
- 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/win_crash_logger/StdAfx.h b/indra/win_crash_logger/StdAfx.h
index ce70fe2994..35976658ac 100644
--- a/indra/win_crash_logger/StdAfx.h
+++ b/indra/win_crash_logger/StdAfx.h
@@ -38,7 +38,6 @@
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-
// Windows Header Files:
#include <windows.h>