[asterisk-commits] tilghman: branch 1.4 r166509 - /branches/1.4/main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Dec 22 22:05:26 CST 2008


Author: tilghman
Date: Mon Dec 22 22:05:25 2008
New Revision: 166509

URL: http://svn.digium.com/view/asterisk?view=rev&rev=166509
Log:
Use the integer form of condition for integer comparisons.
(closes issue #14127)
 Reported by: andrew

Modified:
    branches/1.4/main/channel.c

Modified: branches/1.4/main/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/channel.c?view=diff&rev=166509&r1=166508&r2=166509
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Mon Dec 22 22:05:25 2008
@@ -2512,7 +2512,10 @@
 	/* The channel driver does not support this indication, let's fake
 	 * it by doing our own tone generation if applicable. */
 
-	if (condition < 0) {
+	/*!\note If we compare the enumeration type, which does not have any
+	 * negative constants, the compiler may optimize this code away.
+	 * Therefore, we must perform an integer comparison here. */
+	if (_condition < 0) {
 		/* Stop any tones that are playing */
 		ast_playtones_stop(chan);
 		return 0;




More information about the asterisk-commits mailing list