[asterisk-commits] murf: branch murf/macrogosub r41807 - in /team/murf/macrogosub/pbx: ./ ael/ae...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Sep 2 09:36:05 MST 2006


Author: murf
Date: Sat Sep  2 11:36:04 2006
New Revision: 41807

URL: http://svn.digium.com/view/asterisk?rev=41807&view=rev
Log:
On second thought, I pulled macroExit out of the list of flow control apps that should
be converted to native AEL statements, and have a warning issued. Instead, I convert
them to return statements, and issue a warning. This should allow dialplan programmers
to implement things a little quicker.


Modified:
    team/murf/macrogosub/pbx/ael/ael-test/ref.ael-test2
    team/murf/macrogosub/pbx/ael/ael-test/ref.ael-test4
    team/murf/macrogosub/pbx/pbx_ael.c

Modified: team/murf/macrogosub/pbx/ael/ael-test/ref.ael-test2
URL: http://svn.digium.com/view/asterisk/team/murf/macrogosub/pbx/ael/ael-test/ref.ael-test2?rev=41807&r1=41806&r2=41807&view=diff
==============================================================================
--- team/murf/macrogosub/pbx/ael/ael-test/ref.ael-test2 (original)
+++ team/murf/macrogosub/pbx/ael/ael-test/ref.ael-test2 Sat Sep  2 11:36:04 2006
@@ -2,25 +2,25 @@
 (If you find progress and other non-error messages irritating, you can use -q to suppress them)
 
 (You can use the -w option to dump extensions.conf format to extensions.conf.aeldump)
-LOG: lev:2 file:../pbx/pbx_ael.c  line:4057 func: pbx_load_module  Starting AEL load process.
-LOG: lev:2 file:../pbx/pbx_ael.c  line:4064 func: pbx_load_module  AEL load process: calculated config file name './extensions.ael'.
+LOG: lev:2 file:../pbx/pbx_ael.c  line:3856 func: pbx_load_module  Starting AEL load process.
+LOG: lev:2 file:../pbx/pbx_ael.c  line:3863 func: pbx_load_module  AEL load process: calculated config file name './extensions.ael'.
 LOG: lev:2 file:ael.flex  line:429 func: ael_yylex    --Read in included file ./apptest.ael2, 3474 chars
 LOG: lev:3 file:ael.y  line:523 func: ael_yyparse  ==== File: ./apptest.ael2, Line 46, Cols: 8-11: Suggestion: Use the goto statement instead of the Goto() application call in AEL.
-LOG: lev:2 file:../pbx/pbx_ael.c  line:4067 func: pbx_load_module  AEL load process: parsed config file name './extensions.ael'.
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 35-35: application call to EndWhile affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 37-37: application call to ExecIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 38-38: application call to ExecIfTime affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 44-44: application call to Gosub affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 45-45: application call to GosubIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:4 file:../pbx/pbx_ael.c  line:1503 func: check_goto  Error: file ./apptest.ael2, line 46-46: goto:  no context cont could be found that matches the goto target!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 47-47: application call to GotoIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 48-48: application call to GotoIfTime affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 58-58: application call to Macro affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 59-59: application call to MacroExit affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 60-60: application call to MacroIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 85-85: application call to Random affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 94-94: application call to Return affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 119-119: application call to StackPop affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 141-141: application call to While affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:4 file:../pbx/pbx_ael.c  line:4080 func: pbx_load_module  Sorry, but 0 syntax errors and 1 semantic errors were detected. It doesn't make sense to compile.
+LOG: lev:2 file:../pbx/pbx_ael.c  line:3866 func: pbx_load_module  AEL load process: parsed config file name './extensions.ael'.
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 35-35: application call to EndWhile affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 37-37: application call to ExecIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 38-38: application call to ExecIfTime affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 44-44: application call to Gosub affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 45-45: application call to GosubIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:4 file:../pbx/pbx_ael.c  line:1302 func: check_goto  Error: file ./apptest.ael2, line 46-46: goto:  no context cont could be found that matches the goto target!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 47-47: application call to GotoIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 48-48: application call to GotoIfTime affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 58-58: application call to Macro affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2373 func: check_pval_item  Warning: file ./apptest.ael2, line 59-59: I am converting the MacroExit call here to a return statement.
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 60-60: application call to MacroIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 85-85: application call to Random affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 94-94: application call to Return affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 119-119: application call to StackPop affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 141-141: application call to While affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:4 file:../pbx/pbx_ael.c  line:3879 func: pbx_load_module  Sorry, but 0 syntax errors and 1 semantic errors were detected. It doesn't make sense to compile.
 LOG: lev:4 file:ael2_parse  line:479 func: main  0 contexts, 0 extensions, 0 priorities

Modified: team/murf/macrogosub/pbx/ael/ael-test/ref.ael-test4
URL: http://svn.digium.com/view/asterisk/team/murf/macrogosub/pbx/ael/ael-test/ref.ael-test4?rev=41807&r1=41806&r2=41807&view=diff
==============================================================================
--- team/murf/macrogosub/pbx/ael/ael-test/ref.ael-test4 (original)
+++ team/murf/macrogosub/pbx/ael/ael-test/ref.ael-test4 Sat Sep  2 11:36:04 2006
@@ -2,25 +2,25 @@
 (If you find progress and other non-error messages irritating, you can use -q to suppress them)
 
 (You can use the -w option to dump extensions.conf format to extensions.conf.aeldump)
-LOG: lev:2 file:../pbx/pbx_ael.c  line:4057 func: pbx_load_module  Starting AEL load process.
-LOG: lev:2 file:../pbx/pbx_ael.c  line:4064 func: pbx_load_module  AEL load process: calculated config file name './extensions.ael'.
+LOG: lev:2 file:../pbx/pbx_ael.c  line:3856 func: pbx_load_module  Starting AEL load process.
+LOG: lev:2 file:../pbx/pbx_ael.c  line:3863 func: pbx_load_module  AEL load process: calculated config file name './extensions.ael'.
 LOG: lev:2 file:ael.flex  line:429 func: ael_yylex    --Read in included file ./apptest.ael2, 3474 chars
 LOG: lev:3 file:ael.y  line:523 func: ael_yyparse  ==== File: ./apptest.ael2, Line 46, Cols: 8-11: Suggestion: Use the goto statement instead of the Goto() application call in AEL.
-LOG: lev:2 file:../pbx/pbx_ael.c  line:4067 func: pbx_load_module  AEL load process: parsed config file name './extensions.ael'.
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 35-35: application call to EndWhile affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 37-37: application call to ExecIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 38-38: application call to ExecIfTime affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 44-44: application call to Gosub affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 45-45: application call to GosubIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:4 file:../pbx/pbx_ael.c  line:1503 func: check_goto  Error: file ./apptest.ael2, line 46-46: goto:  no context cont could be found that matches the goto target!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 47-47: application call to GotoIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 48-48: application call to GotoIfTime affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 58-58: application call to Macro affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 59-59: application call to MacroExit affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 60-60: application call to MacroIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 85-85: application call to Random affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 94-94: application call to Return affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 119-119: application call to StackPop affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:3 file:../pbx/pbx_ael.c  line:2577 func: check_pval_item  Warning: file ./apptest.ael2, line 141-141: application call to While affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
-LOG: lev:4 file:../pbx/pbx_ael.c  line:4080 func: pbx_load_module  Sorry, but 0 syntax errors and 1 semantic errors were detected. It doesn't make sense to compile.
+LOG: lev:2 file:../pbx/pbx_ael.c  line:3866 func: pbx_load_module  AEL load process: parsed config file name './extensions.ael'.
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 35-35: application call to EndWhile affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 37-37: application call to ExecIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 38-38: application call to ExecIfTime affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 44-44: application call to Gosub affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 45-45: application call to GosubIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:4 file:../pbx/pbx_ael.c  line:1302 func: check_goto  Error: file ./apptest.ael2, line 46-46: goto:  no context cont could be found that matches the goto target!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 47-47: application call to GotoIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 48-48: application call to GotoIfTime affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 58-58: application call to Macro affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2373 func: check_pval_item  Warning: file ./apptest.ael2, line 59-59: I am converting the MacroExit call here to a return statement.
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 60-60: application call to MacroIf affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 85-85: application call to Random affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 94-94: application call to Return affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 119-119: application call to StackPop affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:3 file:../pbx/pbx_ael.c  line:2368 func: check_pval_item  Warning: file ./apptest.ael2, line 141-141: application call to While affects flow of control, and needs to be re-written using AEL if, while, goto, etc. keywords instead!
+LOG: lev:4 file:../pbx/pbx_ael.c  line:3879 func: pbx_load_module  Sorry, but 0 syntax errors and 1 semantic errors were detected. It doesn't make sense to compile.
 LOG: lev:4 file:ael2_parse  line:479 func: main  0 contexts, 0 extensions, 0 priorities

Modified: team/murf/macrogosub/pbx/pbx_ael.c
URL: http://svn.digium.com/view/asterisk/team/murf/macrogosub/pbx/pbx_ael.c?rev=41807&r1=41806&r2=41807&view=diff
==============================================================================
--- team/murf/macrogosub/pbx/pbx_ael.c (original)
+++ team/murf/macrogosub/pbx/pbx_ael.c Sat Sep  2 11:36:04 2006
@@ -705,9 +705,8 @@
 	}
 	for (i=macro->u3.macro_statements; i; i=i->next) {
 		/* if the last statement in the list is not return, then insert a return there */
-		if( i->next == NULL ) {
-			if( i->type != PV_RETURN )
-			{
+		if (i->next == NULL) {
+			if (i->type != PV_RETURN) {
 				pval *z = calloc(1, sizeof(struct pval));
 				ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: The macro %s does not end with a return; I will insert one.\n",
 						macro->filename, macro->startline, macro->endline, macro->u1.str);
@@ -735,10 +734,10 @@
 	regex_t preg;
 	
 	/* simple case, they match exactly, the pattern and exten name */
-	if( !strcmp(pattern,exten) == 0 )
+	if (!strcmp(pattern,exten) == 0)
 		return 1;
 	
-	if ( pattern[0] == '_' ) {
+	if (pattern[0] == '_') {
 		char reg1[2000];
 		const char *p;
 		char *r = reg1;
@@ -2363,7 +2362,6 @@
 			|| strcasecmp(item->u1.str,"goto") == 0
 			|| strcasecmp(item->u1.str,"macro") == 0
 			|| strcasecmp(item->u1.str,"macroexclusive") == 0
-			|| strcasecmp(item->u1.str,"macroexit") == 0
 			|| strcasecmp(item->u1.str,"macroif") == 0
 			|| strcasecmp(item->u1.str,"stackpop") == 0
 			|| strcasecmp(item->u1.str,"execIf") == 0 ) {
@@ -2371,6 +2369,14 @@
 					item->filename, item->startline, item->endline, item->u1.str);
 			warns++;
 		}
+		if (strcasecmp(item->u1.str,"macroexit") == 0) {
+				ast_log(LOG_WARNING, "Warning: file %s, line %d-%d: I am converting the MacroExit call here to a return statement.\n",
+						item->filename, item->startline, item->endline);
+				item->type = PV_RETURN;
+				free(item->u1.str);
+				item->u1.str = 0;
+		}
+		
 #ifdef AAL_ARGCHECK
 		found = 0;
 		for (app=apps; app; app=app->next) {



More information about the asterisk-commits mailing list