[asterisk-commits] seanbright: trunk r136302 - /trunk/funcs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Aug 6 20:07:40 CDT 2008


Author: seanbright
Date: Wed Aug  6 20:07:40 2008
New Revision: 136302

URL: http://svn.digium.com/view/asterisk?view=rev&rev=136302
Log:
Continue merging in changes from resolve-shadow-warnings.  funcs/ this time.

Modified:
    trunk/funcs/func_config.c
    trunk/funcs/func_odbc.c
    trunk/funcs/func_strings.c
    trunk/funcs/func_timeout.c

Modified: trunk/funcs/func_config.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_config.c?view=diff&rev=136302&r1=136301&r2=136302
==============================================================================
--- trunk/funcs/func_config.c (original)
+++ trunk/funcs/func_config.c Wed Aug  6 20:07:40 2008
@@ -170,13 +170,13 @@
 
 static int unload_module(void)
 {
-	struct config_item *cur;
+	struct config_item *current;
 	int res = ast_custom_function_unregister(&config_function);
 
 	AST_RWLIST_WRLOCK(&configs);
-	while ((cur = AST_RWLIST_REMOVE_HEAD(&configs, entry))) {
-		ast_config_destroy(cur->cfg);
-		ast_free(cur);
+	while ((current = AST_RWLIST_REMOVE_HEAD(&configs, entry))) {
+		ast_config_destroy(current->cfg);
+		ast_free(current);
 	}
 	AST_RWLIST_UNLOCK(&configs);
 

Modified: trunk/funcs/func_odbc.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_odbc.c?view=diff&rev=136302&r1=136301&r2=136302
==============================================================================
--- trunk/funcs/func_odbc.c (original)
+++ trunk/funcs/func_odbc.c Wed Aug  6 20:07:40 2008
@@ -626,25 +626,25 @@
 
 	if (((tmp = ast_variable_retrieve(cfg, catg, "writehandle"))) || ((tmp = ast_variable_retrieve(cfg, catg, "dsn")))) {
 		char *tmp2 = ast_strdupa(tmp);
-		AST_DECLARE_APP_ARGS(write,
+		AST_DECLARE_APP_ARGS(writeconf,
 			AST_APP_ARG(dsn)[5];
 		);
-		AST_STANDARD_APP_ARGS(write, tmp2);
+		AST_STANDARD_APP_ARGS(writeconf, tmp2);
 		for (i = 0; i < 5; i++) {
-			if (!ast_strlen_zero(write.dsn[i]))
-				ast_copy_string((*query)->writehandle[i], write.dsn[i], sizeof((*query)->writehandle[i]));
+			if (!ast_strlen_zero(writeconf.dsn[i]))
+				ast_copy_string((*query)->writehandle[i], writeconf.dsn[i], sizeof((*query)->writehandle[i]));
 		}
 	}
 
 	if ((tmp = ast_variable_retrieve(cfg, catg, "readhandle"))) {
 		char *tmp2 = ast_strdupa(tmp);
-		AST_DECLARE_APP_ARGS(read,
+		AST_DECLARE_APP_ARGS(readconf,
 			AST_APP_ARG(dsn)[5];
 		);
-		AST_STANDARD_APP_ARGS(read, tmp2);
+		AST_STANDARD_APP_ARGS(readconf, tmp2);
 		for (i = 0; i < 5; i++) {
-			if (!ast_strlen_zero(read.dsn[i]))
-				ast_copy_string((*query)->readhandle[i], read.dsn[i], sizeof((*query)->readhandle[i]));
+			if (!ast_strlen_zero(readconf.dsn[i]))
+				ast_copy_string((*query)->readhandle[i], readconf.dsn[i], sizeof((*query)->readhandle[i]));
 		}
 	} else {
 		/* If no separate readhandle, then use the writehandle for reading */

Modified: trunk/funcs/func_strings.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_strings.c?view=diff&rev=136302&r1=136301&r2=136302
==============================================================================
--- trunk/funcs/func_strings.c (original)
+++ trunk/funcs/func_strings.c Wed Aug  6 20:07:40 2008
@@ -609,14 +609,14 @@
 
 
 static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf,
-	       size_t len)
+	       size_t buflen)
 {
 	int length = 0;
 
 	if (data)
 		length = strlen(data);
 
-	snprintf(buf, len, "%d", length);
+	snprintf(buf, buflen, "%d", length);
 
 	return 0;
 }
@@ -629,30 +629,30 @@
 };
 
 static int acf_strftime(struct ast_channel *chan, const char *cmd, char *parse,
-			char *buf, size_t len)
+			char *buf, size_t buflen)
 {
 	AST_DECLARE_APP_ARGS(args,
 			     AST_APP_ARG(epoch);
 			     AST_APP_ARG(timezone);
 			     AST_APP_ARG(format);
 	);
-	struct timeval tv;
+	struct timeval when;
 	struct ast_tm tm;
 
 	buf[0] = '\0';
 
 	AST_STANDARD_APP_ARGS(args, parse);
 
-	ast_get_timeval(args.epoch, &tv, ast_tvnow(), NULL);
-	ast_localtime(&tv, &tm, args.timezone);
+	ast_get_timeval(args.epoch, &when, ast_tvnow(), NULL);
+	ast_localtime(&when, &tm, args.timezone);
 
 	if (!args.format)
 		args.format = "%c";
 
-	if (ast_strftime(buf, len, args.format, &tm) <= 0)
+	if (ast_strftime(buf, buflen, args.format, &tm) <= 0)
 		ast_log(LOG_WARNING, "C function strftime() output nothing?!!\n");
 
-	buf[len - 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 len)
+			char *buf, size_t buflen)
 {
 	AST_DECLARE_APP_ARGS(args,
 			     AST_APP_ARG(timestring);
@@ -704,11 +704,11 @@
 	if (!strptime(args.timestring, args.format, &t.time)) {
 		ast_log(LOG_WARNING, "C function strptime() output nothing?!!\n");
 	} else {
-		struct timeval tv;
+		struct timeval when;
 		/* Since strptime(3) does not check DST, force ast_mktime() to calculate it. */
 		t.atm.tm_isdst = -1;
-		tv = ast_mktime(&t.atm, args.timezone);
-		snprintf(buf, len, "%d", (int) tv.tv_sec);
+		when = ast_mktime(&t.atm, args.timezone);
+		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 len)
+			 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, len - 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 len)
+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 + len - 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[len - 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 len)
+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 + len - 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 len)
+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 + len - 1) && (*bufptr++ = tolower(*dataptr++)));
+	while ((bufptr < buf + buflen - 1) && (*bufptr++ = tolower(*dataptr++)));
 
 	return 0;
 }

Modified: trunk/funcs/func_timeout.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_timeout.c?view=diff&rev=136302&r1=136301&r2=136302
==============================================================================
--- trunk/funcs/func_timeout.c (original)
+++ trunk/funcs/func_timeout.c Wed Aug  6 20:07:40 2008
@@ -87,7 +87,7 @@
 	long sec;
 	char timestr[64];
 	struct ast_tm myt;
-	struct timeval tv;
+	struct timeval when;
 
 	if (!chan)
 		return -1;
@@ -101,21 +101,21 @@
 		return -1;
 
 	if ((sscanf(value, "%ld%lf", &sec, &x) == 0) || sec < 0)
-		tv.tv_sec = 0;
+		when.tv_sec = 0;
 	else {
-		tv.tv_sec = sec;
-		tv.tv_usec = x * 1000000;
+		when.tv_sec = sec;
+		when.tv_usec = x * 1000000;
 	}
 
 	switch (*data) {
 	case 'a':
 	case 'A':
-		ast_channel_setwhentohangup_tv(chan, tv);
+		ast_channel_setwhentohangup_tv(chan, when);
 		if (VERBOSITY_ATLEAST(3)) {
 			if (!ast_tvzero(chan->whentohangup)) {
-				tv = ast_tvadd(tv, ast_tvnow());
+				when = ast_tvadd(when, ast_tvnow());
 				ast_strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S.%3q %Z",
-					ast_localtime(&tv, &myt, NULL));
+					ast_localtime(&when, &myt, NULL));
 				ast_verbose("Channel will hangup at %s.\n", timestr);
 			} else {
 				ast_verbose("Channel hangup cancelled.\n");
@@ -126,7 +126,7 @@
 	case 'r':
 	case 'R':
 		if (chan->pbx) {
-			chan->pbx->rtimeoutms = tv.tv_sec * 1000 + tv.tv_usec / 1000.0;
+			chan->pbx->rtimeoutms = when.tv_sec * 1000 + when.tv_usec / 1000.0;
 			ast_verb(3, "Response timeout set to %.3f\n", chan->pbx->rtimeoutms / 1000.0);
 		}
 		break;
@@ -134,7 +134,7 @@
 	case 'd':
 	case 'D':
 		if (chan->pbx) {
-			chan->pbx->dtimeoutms = tv.tv_sec * 1000 + tv.tv_usec / 1000.0;
+			chan->pbx->dtimeoutms = when.tv_sec * 1000 + when.tv_usec / 1000.0;
 			ast_verb(3, "Digit timeout set to %.3f\n", chan->pbx->dtimeoutms / 1000.0);
 		}
 		break;




More information about the asterisk-commits mailing list