[svn-commits] seanbright: branch seanbright/resolve-shadow-warnings r136401 - in /team/sean...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Aug 7 09:29:28 CDT 2008


Author: seanbright
Date: Thu Aug  7 09:29:28 2008
New Revision: 136401

URL: http://svn.digium.com/view/asterisk?view=rev&rev=136401
Log:
Merged revisions 136298,136300,136302,136305,136349 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r136298 | seanbright | 2008-08-06 20:44:55 -0400 (Wed, 06 Aug 2008) | 5 lines

Start moving in changes from my resolve-shadow-warnings branch.  Going to do
this in pieces so the diffs are a little bit smaller and more reviewable.

pbx/ and formats/ first.

................
r136300 | seanbright | 2008-08-06 20:52:23 -0400 (Wed, 06 Aug 2008) | 2 lines

More from the resolve-shadow-warnings branch.  This time the cdr/ directory.

................
r136302 | seanbright | 2008-08-06 21:07:40 -0400 (Wed, 06 Aug 2008) | 2 lines

Continue merging in changes from resolve-shadow-warnings.  funcs/ this time.

................
r136305 | tilghman | 2008-08-06 21:18:03 -0400 (Wed, 06 Aug 2008) | 10 lines

Blocked revisions 136304 via svnmerge

........
r136304 | tilghman | 2008-08-06 20:17:14 -0500 (Wed, 06 Aug 2008) | 3 lines

For backwards compatibility with previous 1.4 versions which used "zapchan"
in users.conf, ensure that we still support it.

........

................
r136349 | tilghman | 2008-08-06 21:32:10 -0400 (Wed, 06 Aug 2008) | 10 lines

Blocked revisions 136348 via svnmerge

........
r136348 | tilghman | 2008-08-06 20:31:27 -0500 (Wed, 06 Aug 2008) | 3 lines

Also, parse useincomingcalleridonzaptransfer (and add appropriate deprecation
warnings).

........

................

Modified:
    team/seanbright/resolve-shadow-warnings/   (props changed)
    team/seanbright/resolve-shadow-warnings/cdr/cdr_csv.c
    team/seanbright/resolve-shadow-warnings/cdr/cdr_pgsql.c
    team/seanbright/resolve-shadow-warnings/cdr/cdr_radius.c
    team/seanbright/resolve-shadow-warnings/cdr/cdr_tds.c
    team/seanbright/resolve-shadow-warnings/funcs/func_strings.c
    team/seanbright/resolve-shadow-warnings/pbx/pbx_config.c

Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/seanbright/resolve-shadow-warnings/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Aug  7 09:29:28 2008
@@ -1,1 +1,1 @@
-/trunk:1-136295
+/trunk:1-136356

Modified: team/seanbright/resolve-shadow-warnings/cdr/cdr_csv.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/cdr/cdr_csv.c?view=diff&rev=136401&r1=136400&r2=136401
==============================================================================
--- team/seanbright/resolve-shadow-warnings/cdr/cdr_csv.c (original)
+++ team/seanbright/resolve-shadow-warnings/cdr/cdr_csv.c Thu Aug  7 09:29:28 2008
@@ -178,7 +178,7 @@
 	return 0;
 }
 
-static int append_date(char *buf, struct timeval calldate, size_t bufsize)
+static int append_date(char *buf, struct timeval when, size_t bufsize)
 {
 	char tmp[80] = "";
 	struct ast_tm tm;
@@ -186,12 +186,12 @@
 	if (strlen(buf) > bufsize - 3)
 		return -1;
 
-	if (ast_tvzero(calldate)) {
+	if (ast_tvzero(when)) {
 		strncat(buf, ",", bufsize - strlen(buf) - 1);
 		return 0;
 	}
 
-	ast_localtime(&calldate, &tm, usegmtime ? "GMT" : NULL);
+	ast_localtime(&when, &tm, usegmtime ? "GMT" : NULL);
 	ast_strftime(tmp, sizeof(tmp), DATE_FORMAT, &tm);
 
 	return append_string(buf, tmp, bufsize);

Modified: team/seanbright/resolve-shadow-warnings/cdr/cdr_pgsql.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/cdr/cdr_pgsql.c?view=diff&rev=136401&r1=136400&r2=136401
==============================================================================
--- team/seanbright/resolve-shadow-warnings/cdr/cdr_pgsql.c (original)
+++ team/seanbright/resolve-shadow-warnings/cdr/cdr_pgsql.c Thu Aug  7 09:29:28 2008
@@ -204,14 +204,14 @@
 					LENGTHEN_BUF2(12);
 					lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%s", value);
 				} else if (strncmp(cur->type, "float", 5) == 0) {
-					struct timeval *val = cur->name[0] == 'd' ? &cdr->start : &cdr->answer;
-					LENGTHEN_BUF2(30);
-					lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%f", (double)cdr->end.tv_sec - val->tv_sec + cdr->end.tv_usec / 1000000.0 - val->tv_usec / 1000000.0);
+					struct timeval *when = cur->name[0] == 'd' ? &cdr->start : &cdr->answer;
+					LENGTHEN_BUF2(30);
+					lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "%f", (double)cdr->end.tv_sec - when->tv_sec + cdr->end.tv_usec / 1000000.0 - when->tv_usec / 1000000.0);
 				} else {
 					/* Char field, probably */
-					struct timeval *val = cur->name[0] == 'd' ? &cdr->start : &cdr->answer;
-					LENGTHEN_BUF2(30);
-					lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "'%f'", (double)cdr->end.tv_sec - val->tv_sec + cdr->end.tv_usec / 1000000.0 - val->tv_usec / 1000000.0);
+					struct timeval *when = cur->name[0] == 'd' ? &cdr->start : &cdr->answer;
+					LENGTHEN_BUF2(30);
+					lensql2 += snprintf(sql2 + lensql2, sizesql2 - lensql2, "'%f'", (double)cdr->end.tv_sec - when->tv_sec + cdr->end.tv_usec / 1000000.0 - when->tv_usec / 1000000.0);
 				}
 			} else if (strcmp(cur->name, "disposition") == 0 || strcmp(cur->name, "amaflags") == 0) {
 				if (strncmp(cur->type, "int", 3) == 0) {

Modified: team/seanbright/resolve-shadow-warnings/cdr/cdr_radius.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/cdr/cdr_radius.c?view=diff&rev=136401&r1=136400&r2=136401
==============================================================================
--- team/seanbright/resolve-shadow-warnings/cdr/cdr_radius.c (original)
+++ team/seanbright/resolve-shadow-warnings/cdr/cdr_radius.c Thu Aug  7 09:29:28 2008
@@ -87,50 +87,50 @@
 
 static rc_handle *rh = NULL;
 
-static int build_radius_record(VALUE_PAIR **to_send, struct ast_cdr *cdr)
+static int build_radius_record(VALUE_PAIR **tosend, struct ast_cdr *cdr)
 {
 	int recordtype = PW_STATUS_STOP;
 	struct ast_tm tm;
 	char timestr[128];
 	char *tmp;
 
-	if (!rc_avpair_add(rh, to_send, PW_ACCT_STATUS_TYPE, &recordtype, 0, 0))
+	if (!rc_avpair_add(rh, tosend, PW_ACCT_STATUS_TYPE, &recordtype, 0, 0))
 		return -1;
 
 	/* Account code */
-	if (!rc_avpair_add(rh, to_send, PW_AST_ACCT_CODE, &cdr->accountcode, strlen(cdr->accountcode), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_ACCT_CODE, &cdr->accountcode, strlen(cdr->accountcode), VENDOR_CODE))
 		return -1;
 
  	/* Source */
-	if (!rc_avpair_add(rh, to_send, PW_AST_SRC, &cdr->src, strlen(cdr->src), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_SRC, &cdr->src, strlen(cdr->src), VENDOR_CODE))
 		return -1;
 
  	/* Destination */
-	if (!rc_avpair_add(rh, to_send, PW_AST_DST, &cdr->dst, strlen(cdr->dst), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_DST, &cdr->dst, strlen(cdr->dst), VENDOR_CODE))
 		return -1;
 
  	/* Destination context */
-	if (!rc_avpair_add(rh, to_send, PW_AST_DST_CTX, &cdr->dcontext, strlen(cdr->dcontext), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_DST_CTX, &cdr->dcontext, strlen(cdr->dcontext), VENDOR_CODE))
 		return -1;
 
 	/* Caller ID */
-	if (!rc_avpair_add(rh, to_send, PW_AST_CLID, &cdr->clid, strlen(cdr->clid), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_CLID, &cdr->clid, strlen(cdr->clid), VENDOR_CODE))
 		return -1;
 
 	/* Channel */
-	if (!rc_avpair_add(rh, to_send, PW_AST_CHAN, &cdr->channel, strlen(cdr->channel), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_CHAN, &cdr->channel, strlen(cdr->channel), VENDOR_CODE))
 		return -1;
 
 	/* Destination Channel */
-	if (!rc_avpair_add(rh, to_send, PW_AST_DST_CHAN, &cdr->dstchannel, strlen(cdr->dstchannel), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_DST_CHAN, &cdr->dstchannel, strlen(cdr->dstchannel), VENDOR_CODE))
 		return -1;
 
 	/* Last Application */
-	if (!rc_avpair_add(rh, to_send, PW_AST_LAST_APP, &cdr->lastapp, strlen(cdr->lastapp), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_LAST_APP, &cdr->lastapp, strlen(cdr->lastapp), VENDOR_CODE))
 		return -1;
 
 	/* Last Data */
-	if (!rc_avpair_add(rh, to_send, PW_AST_LAST_DATA, &cdr->lastdata, strlen(cdr->lastdata), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_LAST_DATA, &cdr->lastdata, strlen(cdr->lastdata), VENDOR_CODE))
 		return -1;
 
 
@@ -138,61 +138,61 @@
 	ast_strftime(timestr, sizeof(timestr), DATE_FORMAT, 
 		ast_localtime(&cdr->start, &tm,
 			ast_test_flag(&global_flags, RADIUS_FLAG_USEGMTIME) ? "GMT" : NULL));
-	if (!rc_avpair_add(rh, to_send, PW_AST_START_TIME, timestr, strlen(timestr), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_START_TIME, timestr, strlen(timestr), VENDOR_CODE))
 		return -1;
 
 	/* Answer Time */
 	ast_strftime(timestr, sizeof(timestr), DATE_FORMAT, 
 		ast_localtime(&cdr->answer, &tm,
 			ast_test_flag(&global_flags, RADIUS_FLAG_USEGMTIME) ? "GMT" : NULL));
-	if (!rc_avpair_add(rh, to_send, PW_AST_ANSWER_TIME, timestr, strlen(timestr), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_ANSWER_TIME, timestr, strlen(timestr), VENDOR_CODE))
 		return -1;
 
 	/* End Time */
 	ast_strftime(timestr, sizeof(timestr), DATE_FORMAT, 
 		ast_localtime(&cdr->end, &tm,
 			ast_test_flag(&global_flags, RADIUS_FLAG_USEGMTIME) ? "GMT" : NULL));
-	if (!rc_avpair_add(rh, to_send, PW_AST_END_TIME, timestr, strlen(timestr), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_END_TIME, timestr, strlen(timestr), VENDOR_CODE))
 		return -1;
 
  	/* Duration */ 
-	if (!rc_avpair_add(rh, to_send, PW_AST_DURATION, &cdr->duration, 0, VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_DURATION, &cdr->duration, 0, VENDOR_CODE))
 		return -1;
 
 	/* Billable seconds */
-	if (!rc_avpair_add(rh, to_send, PW_AST_BILL_SEC, &cdr->billsec, 0, VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_BILL_SEC, &cdr->billsec, 0, VENDOR_CODE))
 		return -1;
 
 	/* Disposition */
 	tmp = ast_cdr_disp2str(cdr->disposition);
-	if (!rc_avpair_add(rh, to_send, PW_AST_DISPOSITION, tmp, strlen(tmp), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_DISPOSITION, tmp, strlen(tmp), VENDOR_CODE))
 		return -1;
 
 	/* AMA Flags */
 	tmp = ast_cdr_flags2str(cdr->amaflags);
-	if (!rc_avpair_add(rh, to_send, PW_AST_AMA_FLAGS, tmp, strlen(tmp), VENDOR_CODE))
+	if (!rc_avpair_add(rh, tosend, PW_AST_AMA_FLAGS, tmp, strlen(tmp), VENDOR_CODE))
 		return -1;
 
 	if (ast_test_flag(&global_flags, RADIUS_FLAG_LOGUNIQUEID)) {
 		/* Unique ID */
-		if (!rc_avpair_add(rh, to_send, PW_AST_UNIQUE_ID, &cdr->uniqueid, strlen(cdr->uniqueid), VENDOR_CODE))
+		if (!rc_avpair_add(rh, tosend, PW_AST_UNIQUE_ID, &cdr->uniqueid, strlen(cdr->uniqueid), VENDOR_CODE))
 			return -1;
 	}
 
 	if (ast_test_flag(&global_flags, RADIUS_FLAG_LOGUSERFIELD)) {
 		/* append the user field */
-		if (!rc_avpair_add(rh, to_send, PW_AST_USER_FIELD, &cdr->userfield, strlen(cdr->userfield), VENDOR_CODE))
+		if (!rc_avpair_add(rh, tosend, PW_AST_USER_FIELD, &cdr->userfield, strlen(cdr->userfield), VENDOR_CODE))
 			return -1;
 	}
 
 	/* Setting Acct-Session-Id & User-Name attributes for proper generation
 	   of Acct-Unique-Session-Id on server side */ 
 	/* Channel */
-	if (!rc_avpair_add(rh, to_send, PW_USER_NAME, &cdr->channel, strlen(cdr->channel), 0))
+	if (!rc_avpair_add(rh, tosend, PW_USER_NAME, &cdr->channel, strlen(cdr->channel), 0))
 		return -1;
 
 	/* Unique ID */
-	if (!rc_avpair_add(rh, to_send, PW_ACCT_SESSION_ID, &cdr->uniqueid, strlen(cdr->uniqueid), 0))
+	if (!rc_avpair_add(rh, tosend, PW_ACCT_SESSION_ID, &cdr->uniqueid, strlen(cdr->uniqueid), 0))
 		return -1;
 
 	return 0;
@@ -201,14 +201,14 @@
 static int radius_log(struct ast_cdr *cdr)
 {
 	int result = ERROR_RC;
-	VALUE_PAIR *to_send = NULL;
-
-	if (build_radius_record(&to_send, cdr)) {
+	VALUE_PAIR *tosend = NULL;
+
+	if (build_radius_record(&tosend, cdr)) {
 		ast_debug(1, "Unable to create RADIUS record. CDR not recorded!\n");
 		return result;
 	}
 	
-	result = rc_acct(rh, 0, to_send);
+	result = rc_acct(rh, 0, tosend);
 	if (result != OK_RC)
 		ast_log(LOG_ERROR, "Failed to record Radius CDR record!\n");
 

Modified: team/seanbright/resolve-shadow-warnings/cdr/cdr_tds.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/cdr/cdr_tds.c?view=diff&rev=136401&r1=136400&r2=136401
==============================================================================
--- team/seanbright/resolve-shadow-warnings/cdr/cdr_tds.c (original)
+++ team/seanbright/resolve-shadow-warnings/cdr/cdr_tds.c Thu Aug  7 09:29:28 2008
@@ -265,12 +265,12 @@
 	return buf;
 }
 
-static void get_date(char *dateField, size_t len, struct timeval calldate)
+static void get_date(char *dateField, size_t len, struct timeval when)
 {
 	/* To make sure we have date variable if not insert null to SQL */
 	if (!ast_tvzero(tv)) {
 		struct ast_tm tm;
-		ast_localtime(&calldate, &tm, NULL);
+		ast_localtime(&when, &tm, NULL);
 		ast_strftime(dateField, len, "'" DATE_FORMAT "'", &tm);
 	} else {
 		ast_copy_string(dateField, "null", len);

Modified: team/seanbright/resolve-shadow-warnings/funcs/func_strings.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/funcs/func_strings.c?view=diff&rev=136401&r1=136400&r2=136401
==============================================================================
--- team/seanbright/resolve-shadow-warnings/funcs/func_strings.c (original)
+++ team/seanbright/resolve-shadow-warnings/funcs/func_strings.c Thu Aug  7 09:29:28 2008
@@ -629,7 +629,7 @@
 };
 
 static int acf_strftime(struct ast_channel *chan, const char *cmd, char *parse,
-			char *buf, size_t length)
+			char *buf, size_t buflen)
 {
 	AST_DECLARE_APP_ARGS(args,
 			     AST_APP_ARG(epoch);
@@ -649,10 +649,10 @@
 	if (!args.format)
 		args.format = "%c";
 
-	if (ast_strftime(buf, length, args.format, &tm) <= 0)
+	if (ast_strftime(buf, buflen, args.format, &tm) <= 0)
 		ast_log(LOG_WARNING, "C function strftime() output nothing?!!\n");
 
-	buf[length - 1] = '\0';
+	buf[buflen - 1] = '\0';
 
 	return 0;
 }
@@ -673,7 +673,7 @@
 };
 
 static int acf_strptime(struct ast_channel *chan, const char *cmd, char *data,
-			char *buf, size_t length)
+			char *buf, size_t buflen)
 {
 	AST_DECLARE_APP_ARGS(args,
 			     AST_APP_ARG(timestring);
@@ -708,7 +708,7 @@
 		/* Since strptime(3) does not check DST, force ast_mktime() to calculate it. */
 		t.atm.tm_isdst = -1;
 		when = ast_mktime(&t.atm, args.timezone);
-		snprintf(buf, length, "%d", (int) when.tv_sec);
+		snprintf(buf, buflen, "%d", (int) when.tv_sec);
 	}
 
 	return 0;
@@ -730,7 +730,7 @@
 };
 
 static int function_eval(struct ast_channel *chan, const char *cmd, char *data,
-			 char *buf, size_t length)
+			 char *buf, size_t buflen)
 {
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "EVAL requires an argument: EVAL(<string>)\n");
@@ -739,7 +739,7 @@
 
 	if (chan)
 		ast_autoservice_start(chan);
-	pbx_substitute_variables_helper(chan, data, buf, length - 1);
+	pbx_substitute_variables_helper(chan, data, buf, buflen - 1);
 	if (chan)
 		ast_autoservice_stop(chan);
 
@@ -762,11 +762,11 @@
 	.read = function_eval,
 };
 
-static int keypadhash(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t length)
+static int keypadhash(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
 {
 	char *bufptr, *dataptr;
 
-	for (bufptr = buf, dataptr = data; bufptr < buf + length - 1; dataptr++) {
+	for (bufptr = buf, dataptr = data; bufptr < buf + buflen - 1; dataptr++) {
 		if (*dataptr == '1') {
 			*bufptr++ = '1';
 		} else if (strchr("AaBbCc2", *dataptr)) {
@@ -792,7 +792,7 @@
 			break;
 		}
 	}
-	buf[length - 1] = '\0';
+	buf[buflen - 1] = '\0';
 
 	return 0;
 }
@@ -805,11 +805,11 @@
 	.desc = "Example:  ${KEYPADHASH(Les)} returns \"537\"\n",
 };
 
-static int string_toupper(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t length)
+static int string_toupper(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
 {
 	char *bufptr = buf, *dataptr = data;
 
-	while ((bufptr < buf + length - 1) && (*bufptr++ = toupper(*dataptr++)));
+	while ((bufptr < buf + buflen - 1) && (*bufptr++ = toupper(*dataptr++)));
 
 	return 0;
 }
@@ -822,11 +822,11 @@
 	.desc = "Example: ${TOUPPER(Example)} returns \"EXAMPLE\"\n",
 };
 
-static int string_tolower(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t length)
+static int string_tolower(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
 {
 	char *bufptr = buf, *dataptr = data;
 
-	while ((bufptr < buf + length - 1) && (*bufptr++ = tolower(*dataptr++)));
+	while ((bufptr < buf + buflen - 1) && (*bufptr++ = tolower(*dataptr++)));
 
 	return 0;
 }

Modified: team/seanbright/resolve-shadow-warnings/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/pbx/pbx_config.c?view=diff&rev=136401&r1=136400&r2=136401
==============================================================================
--- team/seanbright/resolve-shadow-warnings/pbx/pbx_config.c (original)
+++ team/seanbright/resolve-shadow-warnings/pbx/pbx_config.c Thu Aug  7 09:29:28 2008
@@ -654,7 +654,6 @@
 	} else if (a->pos == 4) { /* dialplan add include CTX _X_ */
 		/* complete  as 'into' if context exists or we are unable to check */
 		char *context, *dupline;
-		struct ast_context *ctx;
 		const char *s = skip_words(a->line, 3); /* should not fail */
 
 		if (a->n != 0)	/* only once */
@@ -674,6 +673,7 @@
 			/* our fault, we can't check, so complete 'into' ... */
 			ret = strdup("into");
 		} else {
+			struct ast_context *ctx;
 			for (ctx = NULL; !ret && (ctx = ast_walk_contexts(ctx)); )
 				if (!strcmp(context, ast_get_context_name(ctx)))
 					ret = strdup("into"); /* found */




More information about the svn-commits mailing list