[asterisk-commits] russell: branch russell/issue_13747 r163713 - /team/russell/issue_13747/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Dec 12 13:29:53 CST 2008


Author: russell
Date: Fri Dec 12 13:29:52 2008
New Revision: 163713

URL: http://svn.digium.com/view/asterisk?view=rev&rev=163713
Log:
Use an enum to ensure that the compilers complains if we don't handle all possible values

Modified:
    team/russell/issue_13747/main/channel.c

Modified: team/russell/issue_13747/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/russell/issue_13747/main/channel.c?view=diff&rev=163713&r1=163712&r2=163713
==============================================================================
--- team/russell/issue_13747/main/channel.c (original)
+++ team/russell/issue_13747/main/channel.c Fri Dec 12 13:29:52 2008
@@ -2511,9 +2511,13 @@
 			}
 		}
 	} else {
+		/* Use an enum so that the following switch statement warns us if it doesn't
+		 * handle a control frame type. */
+		enum ast_control_frame_type control = condition;
+
 		/* There are some conditions where we don't want to store them off as
 		 * visible indications.  List them here. */
-		switch (condition) {
+		switch (control) {
 		case AST_CONTROL_PROGRESS:
 		case AST_CONTROL_PROCEEDING:
 		case AST_CONTROL_VIDUPDATE:
@@ -2528,7 +2532,12 @@
 		case AST_CONTROL_ANSWER:
 		case AST_CONTROL_HANGUP:
 			break;
-		default:
+		case AST_CONTROL_CONGESTION:
+		case AST_CONTROL_BUSY:
+		case AST_CONTROL_RINGING:
+		case AST_CONTROL_RING:
+		case AST_CONTROL_HOLD:
+		case AST_CONTROL_UNHOLD:
 			chan->visible_indication = condition;
 		}
 	}




More information about the asterisk-commits mailing list