diff options
author | Uwe Klotz <uwe_klotz@web.de> | 2014-11-12 10:35:58 +0100 |
---|---|---|
committer | Uwe Klotz <uwe_klotz@web.de> | 2014-11-15 19:42:51 +0100 |
commit | f56be466481f38305576b3f5365c8a88394dd5fd (patch) | |
tree | ddd569fc92456173d7509f13086a0c155d4cef48 /src/util/math.h | |
parent | d6597ebaeadf55e548bb64185cb9cf32c40233e4 (diff) |
Use pass-by-value for math types
Diffstat (limited to 'src/util/math.h')
-rw-r--r-- | src/util/math.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/math.h b/src/util/math.h index aeec6ed72b..1ea352b048 100644 --- a/src/util/math.h +++ b/src/util/math.h @@ -17,7 +17,7 @@ using std::fabs; #define math_max3(a, b, c) math_max(math_max((a), (b)), (c)) template <typename T> -inline T math_clamp(const T& value, const T& min, const T& max) { +inline T math_clamp(T value, T min, T max) { // XXX: If max < min, behavior is undefined, and has been causing problems. // if debugging is on, assert when this happens. if (max < min) { @@ -37,7 +37,7 @@ inline T math_clamp(const T& value, const T& min, const T& max) { // hack this to support floating point values! The programmer should be required // to manually convert so they are aware of the conversion. template <typename T> -inline bool even(const T& value) { +inline bool even(T value) { return value % 2 == 0; } |