diff dmlib.h @ 118:c36e0316de9f

Move DM_SWAP() macro to dmlib.h
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 04 Oct 2012 03:38:04 +0300
parents 72813cece1ba
children 459a1be2bd0f
line wrap: on
line diff
--- a/dmlib.h	Thu Oct 04 03:28:06 2012 +0300
+++ b/dmlib.h	Thu Oct 04 03:38:04 2012 +0300
@@ -164,6 +164,10 @@
 typedef float DMFloat;
 
 
+// Macro for swapping two lvalues of same type
+#define DM_SWAP(T, A, B) { if ((B) < (A)) { T swtmp = (B); B = (A); A = swtmp; } }
+
+
 /* Drawing modes used by blitting and some other functions.
  */
 enum