summaryrefslogtreecommitdiff
path: root/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'common.c')
-rw-r--r--common.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/common.c b/common.c
index 524e614..d457a6a 100644
--- a/common.c
+++ b/common.c
@@ -78,3 +78,19 @@ MsTime msNow()
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}
+
+//***************************************************************************
+//
+//***************************************************************************
+
+int minMax(int x, int min, int max)
+{
+ if (x < min)
+ return min;
+
+ if (max < x)
+ return max;
+
+ return x;
+}
+