[svn-commits] kpfleming: trunk r569 - /trunk/menuselect_curses.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Aug 6 10:53:00 CDT 2009


Author: kpfleming
Date: Thu Aug  6 10:52:56 2009
New Revision: 569

URL: http://svn.asterisk.org/svn-view/menuselect?view=rev&rev=569
Log:
use side-effect-safe MIN and MAX macros here too

Modified:
    trunk/menuselect_curses.c

Modified: trunk/menuselect_curses.c
URL: http://svn.asterisk.org/svn-view/menuselect/trunk/menuselect_curses.c?view=diff&rev=569&r1=568&r2=569
==============================================================================
--- trunk/menuselect_curses.c (original)
+++ trunk/menuselect_curses.c Thu Aug  6 10:52:56 2009
@@ -49,8 +49,8 @@
 
 #define SCROLL_DOWN_INDICATOR "... More ..."
 
-#define MIN(x,y) ((x)<(y)?(x):(y))
-#define MAX(x,y) ((x)<(y)?(y):(x))
+#define MIN(a, b) ({ typeof(a) __a = (a); typeof(b) __b = (b); ((__a > __b) ? __b : __a)})
+#define MAX(a, b) ({ typeof(a) __a = (a); typeof(b) __b = (b); ((__a < __b) ? __b : __a)})
 
 extern int changes_made;
 




More information about the svn-commits mailing list