[asterisk-commits] tilghman: branch 1.6.2 r238499 - in /branches/1.6.2: ./ channels/ include/ast...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 7 15:17:48 CST 2010


Author: tilghman
Date: Thu Jan  7 15:17:43 2010
New Revision: 238499

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=238499
Log:
Merged revisions 209400 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r209400 | kpfleming | 2009-07-28 08:49:46 -0500 (Tue, 28 Jul 2009) | 3 lines
  
  Define side-effect-safe MIN and MAX macros and remove duplicate definitions from various files.
  (closes issue #16251)
  Reported by: asgaroth
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/channels/chan_alsa.c
    branches/1.6.2/channels/chan_console.c
    branches/1.6.2/channels/chan_oss.c
    branches/1.6.2/channels/chan_sip.c
    branches/1.6.2/channels/chan_usbradio.c
    branches/1.6.2/include/asterisk/utils.h
    branches/1.6.2/main/poll.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/channels/chan_alsa.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_alsa.c?view=diff&rev=238499&r1=238498&r2=238499
==============================================================================
--- branches/1.6.2/channels/chan_alsa.c (original)
+++ branches/1.6.2/channels/chan_alsa.c Thu Jan  7 15:17:43 2010
@@ -591,9 +591,6 @@
 
 static char *autoanswer_complete(const char *line, const char *word, int pos, int state)
 {
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
 	switch (state) {
 		case 0:
 			if (!ast_strlen_zero(word) && !strncasecmp(word, "on", MIN(strlen(word), 2)))

Modified: branches/1.6.2/channels/chan_console.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_console.c?view=diff&rev=238499&r1=238498&r2=238499
==============================================================================
--- branches/1.6.2/channels/chan_console.c (original)
+++ branches/1.6.2/channels/chan_console.c Thu Jan  7 15:17:43 2010
@@ -100,13 +100,6 @@
  *       that defines the maximum length of a text message.
  */
 #define TEXT_SIZE	256
-
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
-#ifndef MAX
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-#endif
 
 /*! \brief Dance, Kirby, Dance! @{ */
 #define V_BEGIN " --- <(\"<) --- "

Modified: branches/1.6.2/channels/chan_oss.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_oss.c?view=diff&rev=238499&r1=238498&r2=238499
==============================================================================
--- branches/1.6.2/channels/chan_oss.c (original)
+++ branches/1.6.2/channels/chan_oss.c Thu Jan  7 15:17:43 2010
@@ -227,13 +227,6 @@
 #define DEV_DSP "/dev/audio"
 #else
 #define DEV_DSP "/dev/dsp"
-#endif
-
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
-#ifndef MAX
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
 #endif
 
 static char *config = "oss.conf";	/* default config file */

Modified: branches/1.6.2/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_sip.c?view=diff&rev=238499&r1=238498&r2=238499
==============================================================================
--- branches/1.6.2/channels/chan_sip.c (original)
+++ branches/1.6.2/channels/chan_sip.c Thu Jan  7 15:17:43 2010
@@ -479,10 +479,6 @@
 
 #ifndef TRUE
 #define TRUE     1
-#endif
-
-#ifndef MAX
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
 #endif
 
 /* Arguments for find_peer */

Modified: branches/1.6.2/channels/chan_usbradio.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_usbradio.c?view=diff&rev=238499&r1=238498&r2=238499
==============================================================================
--- branches/1.6.2/channels/chan_usbradio.c (original)
+++ branches/1.6.2/channels/chan_usbradio.c Thu Jan  7 15:17:43 2010
@@ -349,13 +349,6 @@
 #define DEV_DSP "/dev/audio"
 #else
 #define DEV_DSP "/dev/dsp"
-#endif
-
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
-#ifndef MAX
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
 #endif
 
 static const char *config = "usbradio.conf";	/* default config file */

Modified: branches/1.6.2/include/asterisk/utils.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/include/asterisk/utils.h?view=diff&rev=238499&r1=238498&r2=238499
==============================================================================
--- branches/1.6.2/include/asterisk/utils.h (original)
+++ branches/1.6.2/include/asterisk/utils.h Thu Jan  7 15:17:43 2010
@@ -219,6 +219,11 @@
 void ast_sha1_hash(char *output, char *input);
 
 int ast_base64encode_full(char *dst, const unsigned char *src, int srclen, int max, int linebreaks);
+
+#undef MIN
+#define MIN(a, b) ({ typeof(a) __a = (a); typeof(b) __b = (b); ((__a > __b) ? __b : __a);})
+#undef MAX
+#define MAX(a, b) ({ typeof(a) __a = (a); typeof(b) __b = (b); ((__a < __b) ? __b : __a);})
 
 /*!
  * \brief Encode data in base64

Modified: branches/1.6.2/main/poll.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/poll.c?view=diff&rev=238499&r1=238498&r2=238499
==============================================================================
--- branches/1.6.2/main/poll.c (original)
+++ branches/1.6.2/main/poll.c Thu Jan  7 15:17:43 2010
@@ -82,14 +82,6 @@
 #include "asterisk/poll-compat.h"                            /* this package */
 
 #ifdef AST_POLL_COMPAT
-
-/*---------------------------------------------------------------------------*\
-				  Macros
-\*---------------------------------------------------------------------------*/
-
-#ifndef MAX
-#define MAX(a,b)	((a) > (b) ? (a) : (b))
-#endif
 
 /*---------------------------------------------------------------------------*\
 			     Private Functions




More information about the asterisk-commits mailing list