[asterisk-commits] seanbright: branch seanbright/resolve-shadow-warnings r114311 - /team/seanbri...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Apr 19 16:36:17 CDT 2008


Author: seanbright
Date: Sat Apr 19 16:36:16 2008
New Revision: 114311

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114311
Log:
funcs/

Modified:
    team/seanbright/resolve-shadow-warnings/funcs/func_config.c
    team/seanbright/resolve-shadow-warnings/funcs/func_odbc.c
    team/seanbright/resolve-shadow-warnings/funcs/func_strings.c
    team/seanbright/resolve-shadow-warnings/funcs/func_timeout.c

Modified: team/seanbright/resolve-shadow-warnings/funcs/func_config.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/funcs/func_config.c?view=diff&rev=114311&r1=114310&r2=114311
==============================================================================
--- team/seanbright/resolve-shadow-warnings/funcs/func_config.c (original)
+++ team/seanbright/resolve-shadow-warnings/funcs/func_config.c Sat Apr 19 16:36:16 2008
@@ -169,13 +169,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: team/seanbright/resolve-shadow-warnings/funcs/func_odbc.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/funcs/func_odbc.c?view=diff&rev=114311&r1=114310&r2=114311
==============================================================================
--- team/seanbright/resolve-shadow-warnings/funcs/func_odbc.c (original)
+++ team/seanbright/resolve-shadow-warnings/funcs/func_odbc.c Sat Apr 19 16:36:16 2008
@@ -603,25 +603,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: 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=114311&r1=114310&r2=114311
==============================================================================
--- team/seanbright/resolve-shadow-warnings/funcs/func_strings.c (original)
+++ team/seanbright/resolve-shadow-warnings/funcs/func_strings.c Sat Apr 19 16:36:16 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 length)
 {
 	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, length, args.format, &tm) <= 0)
 		ast_log(LOG_WARNING, "C function strftime() output nothing?!!\n");
 
-	buf[len - 1] = '\0';
+	buf[length - 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 length)
 {
 	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, length, "%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 length)
 {
 	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, length - 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 length)
 {
 	char *bufptr, *dataptr;
 
-	for (bufptr = buf, dataptr = data; bufptr < buf + len - 1; dataptr++) {
+	for (bufptr = buf, dataptr = data; bufptr < buf + length - 1; dataptr++) {
 		if (*dataptr == '1') {
 			*bufptr++ = '1';
 		} else if (strchr("AaBbCc2", *dataptr)) {
@@ -792,7 +792,7 @@
 			break;
 		}
 	}
-	buf[len - 1] = '\0';
+	buf[length - 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 length)
 {
 	char *bufptr = buf, *dataptr = data;
 
-	while ((bufptr < buf + len - 1) && (*bufptr++ = toupper(*dataptr++)));
+	while ((bufptr < buf + length - 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 length)
 {
 	char *bufptr = buf, *dataptr = data;
 
-	while ((bufptr < buf + len - 1) && (*bufptr++ = tolower(*dataptr++)));
+	while ((bufptr < buf + length - 1) && (*bufptr++ = tolower(*dataptr++)));
 
 	return 0;
 }

Modified: team/seanbright/resolve-shadow-warnings/funcs/func_timeout.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/funcs/func_timeout.c?view=diff&rev=114311&r1=114310&r2=114311
==============================================================================
--- team/seanbright/resolve-shadow-warnings/funcs/func_timeout.c (original)
+++ team/seanbright/resolve-shadow-warnings/funcs/func_timeout.c Sat Apr 19 16:36:16 2008
@@ -108,9 +108,9 @@
 		ast_channel_setwhentohangup(chan, x);
 		if (VERBOSITY_ATLEAST(3)) {
 			if (chan->whentohangup) {
-				struct timeval tv = { chan->whentohangup, 0 };
+				struct timeval whentohangup = { chan->whentohangup, 0 };
 				ast_strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%S.%3q %Z",
-					ast_localtime(&tv, &myt, NULL));
+					ast_localtime(&whentohangup, &myt, NULL));
 				ast_verbose("Channel will hangup at %s.\n", timestr);
 			} else {
 				ast_verbose("Channel hangup cancelled.\n");




More information about the asterisk-commits mailing list