]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Use the integer form of condition for integer comparisons.
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 23 Dec 2008 04:05:25 +0000 (04:05 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 23 Dec 2008 04:05:25 +0000 (04:05 +0000)
(closes issue #14127)
 Reported by: andrew

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@166509 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index 1c82c154dcf1b5dcc6e6d9d2b3e79beb7d04590d..48ad052868261686828965710681fe9d75fa811a 100644 (file)
@@ -2512,7 +2512,10 @@ int ast_indicate_data(struct ast_channel *chan, int _condition,
        /* 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;