aboutsummaryrefslogtreecommitdiffhomepage
path: root/util.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-28 17:49:46 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-08-04 11:34:45 -0700
commit2e1b3325c63cd6c43a10a08acfc54d1fb29a5c03 (patch)
treebf02e8d37f7ea5ffe28d293ad7bd3b690cc7dae6 /util.h
parent1b8f1650dc9959ace0df2037f751682e73b5bb1d (diff)
Warning cleanup
Diffstat (limited to 'util.h')
-rw-r--r--util.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/util.h b/util.h
index 4354d52d..b3893cb1 100644
--- a/util.h
+++ b/util.h
@@ -29,12 +29,20 @@ buffer_t;
/**
Returns the larger of two ints
*/
-int maxi( int a, int b );
+template<typename T>
+static inline T maxi( T a, T b )
+{
+ return a>b?a:b;
+}
/**
Returns the smaller of two ints
*/
-int mini( int a, int b );
+template<typename T>
+static inline T mini( T a, T b )
+{
+ return a<b?a:b;
+}
/**
Compares two wide character strings with an (arguably) intuitive