[asterisk-commits] twilson: branch group/srtp_reboot r253024 - in /team/group/srtp_reboot: ./ ap...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 16 19:27:32 CDT 2010


Author: twilson
Date: Tue Mar 16 19:27:28 2010
New Revision: 253024

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=253024
Log:
Merged revisions 252976,252980,253004 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r252976 | tilghman | 2010-03-16 18:49:35 -0500 (Tue, 16 Mar 2010) | 8 lines
  
  Mask out previous arguments on each nested invocation of Gosub.
  (closes issue #16758)
   Reported by: wdoekes
   Patches: 
         20100316__issue16758.diff.txt uploaded by tilghman (license 14)
   
  Review: https://reviewboard.asterisk.org/r/561/
........
  r252980 | tilghman | 2010-03-16 19:14:29 -0500 (Tue, 16 Mar 2010) | 2 lines
  
  Fix bamboo compile error by calculating an integer with the same size as a pointer.
........
  r253004 | tilghman | 2010-03-16 19:23:12 -0500 (Tue, 16 Mar 2010) | 2 lines
  
  Argh.
........

Added:
    team/group/srtp_reboot/tests/test_gosub.c
      - copied unchanged from r253004, trunk/tests/test_gosub.c
Modified:
    team/group/srtp_reboot/   (props changed)
    team/group/srtp_reboot/apps/app_stack.c
    team/group/srtp_reboot/configure
    team/group/srtp_reboot/configure.ac

Propchange: team/group/srtp_reboot/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/srtp_reboot/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Mar 16 19:27:28 2010
@@ -1,1 +1,1 @@
-/trunk:1-252860
+/trunk:1-253010

Modified: team/group/srtp_reboot/apps/app_stack.c
URL: http://svnview.digium.com/svn/asterisk/team/group/srtp_reboot/apps/app_stack.c?view=diff&rev=253024&r1=253023&r2=253024
==============================================================================
--- team/group/srtp_reboot/apps/app_stack.c (original)
+++ team/group/srtp_reboot/apps/app_stack.c Tue Mar 16 19:27:28 2010
@@ -344,9 +344,9 @@
 {
 	struct ast_datastore *stack_store = ast_channel_datastore_find(chan, &stack_info, NULL);
 	AST_LIST_HEAD(, gosub_stack_frame) *oldlist;
-	struct gosub_stack_frame *newframe;
+	struct gosub_stack_frame *newframe, *lastframe;
 	char argname[15], *tmp = ast_strdupa(data), *label, *endparen;
-	int i;
+	int i, max_argc = 0;
 	AST_DECLARE_APP_ARGS(args2,
 		AST_APP_ARG(argval)[100];
 	);
@@ -374,6 +374,12 @@
 		stack_store->data = oldlist;
 		AST_LIST_HEAD_INIT(oldlist);
 		ast_channel_datastore_add(chan, stack_store);
+	} else {
+		oldlist = stack_store->data;
+	}
+
+	if ((lastframe = AST_LIST_FIRST(oldlist))) {
+		max_argc = lastframe->arguments;
 	}
 
 	/* Separate the arguments from the label */
@@ -389,8 +395,13 @@
 	} else
 		args2.argc = 0;
 
+	/* Mask out previous arguments in this invocation */
+	if (args2.argc > max_argc) {
+		max_argc = args2.argc;
+	}
+
 	/* Create the return address, but don't save it until we know that the Gosub destination exists */
-	newframe = gosub_allocate_frame(chan->context, chan->exten, chan->priority + 1, args2.argc);
+	newframe = gosub_allocate_frame(chan->context, chan->exten, chan->priority + 1, max_argc);
 
 	if (!newframe) {
 		return -1;
@@ -413,10 +424,10 @@
 	}
 
 	/* Now that we know for certain that we're going to a new location, set our arguments */
-	for (i = 0; i < args2.argc; i++) {
+	for (i = 0; i < max_argc; i++) {
 		snprintf(argname, sizeof(argname), "ARG%d", i + 1);
-		frame_set_var(chan, newframe, argname, args2.argval[i]);
-		ast_debug(1, "Setting '%s' to '%s'\n", argname, args2.argval[i]);
+		frame_set_var(chan, newframe, argname, i < args2.argc ? args2.argval[i] : "");
+		ast_debug(1, "Setting '%s' to '%s'\n", argname, i < args2.argc ? args2.argval[i] : "");
 	}
 	snprintf(argname, sizeof(argname), "%d", args2.argc);
 	frame_set_var(chan, newframe, "ARGC", argname);

Modified: team/group/srtp_reboot/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/group/srtp_reboot/configure.ac?view=diff&rev=253024&r1=253023&r2=253024
==============================================================================
--- team/group/srtp_reboot/configure.ac (original)
+++ team/group/srtp_reboot/configure.ac Tue Mar 16 19:27:28 2010
@@ -781,7 +781,10 @@
 AC_CHECK_HEADER([libkern/OSAtomic.h],
                 [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
 
-AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF([int])
+AC_CHECK_SIZEOF([long])
+AC_CHECK_SIZEOF([long long])
+AC_CHECK_SIZEOF([char *])
 
 # do the package library checks now
 




More information about the asterisk-commits mailing list