From 59aaab03753e2e95e84493c0f712c297d5c0cfe8 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Mon, 27 Mar 2006 10:59:13 +0000 Subject: [PATCH] assert( l < h ) in CLAMP --- stepmania/src/RageUtil.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index 43f8abe9eb..e9eb22a512 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -41,18 +41,21 @@ inline U lerp( T x, U l, U h ) inline bool CLAMP( int &x, int l, int h ) { + ASSERT( l <= h ); if (x > h) { x = h; return true; } else if (x < l) { x = l; return true; } return false; } inline bool CLAMP( unsigned &x, unsigned l, unsigned h ) { + ASSERT( l <= h ); if (x > h) { x = h; return true; } else if (x < l) { x = l; return true; } return false; } inline bool CLAMP( float &x, float l, float h ) { + ASSERT( l <= h ); if (x > h) { x = h; return true; } else if (x < l) { x = l; return true; } return false;