From 18e07935ed78c972f3db1cac3220f76e5c782fe5 Mon Sep 17 00:00:00 2001
From: Tilghman Lesher <tilghman@meg.abyt.es>
Date: Tue, 23 Dec 2008 04:32:15 +0000
Subject: [PATCH] Merged revisions 166509 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r166509 | tilghman | 2008-12-22 22:05:25 -0600 (Mon, 22 Dec 2008) | 4 lines

  Use the integer form of condition for integer comparisons.
  (closes issue #14127)
   Reported by: andrew
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 main/channel.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/main/channel.c b/main/channel.c
index ea13054119..78c1caf602 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2923,7 +2923,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;
-- 
GitLab