[asterisk-commits] russell: branch russell/indications r174842 - /team/russell/indications/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 10 21:16:59 CST 2009


Author: russell
Date: Tue Feb 10 21:16:59 2009
New Revision: 174842

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=174842
Log:
Use simple if statements instead of the case range C extension

I had no good reason to use it there.  :-)

Modified:
    team/russell/indications/main/indications.c

Modified: team/russell/indications/main/indications.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/indications/main/indications.c?view=diff&rev=174842&r1=174841&r2=174842
==============================================================================
--- team/russell/indications/main/indications.c (original)
+++ team/russell/indications/main/indications.c Tue Feb 10 21:16:59 2009
@@ -340,19 +340,15 @@
 		if (tone_data.midinote) {
 			/* midi notes must be between 0 and 127 */
 
-			switch (tone_data.freq1) {
-			case 0 ... 127:
+			if (tone_data.freq1 >= 0 && tone_data.freq1 <= 127) {
 				tone_data.freq1 = midi_tohz[tone_data.freq1];
-				break;
-			default:
+			} else {
 				tone_data.freq1 = 0;
 			}
 
-			switch (tone_data.freq2) {
-			case 0 ... 127:
+			if (tone_data.freq2 >= 0 && tone_data.freq2 <= 127) {
 				tone_data.freq2 = midi_tohz[tone_data.freq2];
-				break;
-			default:
+			} else {
 				tone_data.freq2 = 0;
 			}
 		}




More information about the asterisk-commits mailing list