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

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


Author: seanbright
Date: Sat Apr 19 17:16:29 2008
New Revision: 114312

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114312
Log:
res/

Modified:
    team/seanbright/resolve-shadow-warnings/res/res_adsi.c
    team/seanbright/resolve-shadow-warnings/res/res_agi.c
    team/seanbright/resolve-shadow-warnings/res/res_config_ldap.c
    team/seanbright/resolve-shadow-warnings/res/res_config_pgsql.c
    team/seanbright/resolve-shadow-warnings/res/res_musiconhold.c
    team/seanbright/resolve-shadow-warnings/res/res_odbc.c
    team/seanbright/resolve-shadow-warnings/res/res_phoneprov.c
    team/seanbright/resolve-shadow-warnings/res/res_smdi.c

Modified: team/seanbright/resolve-shadow-warnings/res/res_adsi.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/res/res_adsi.c?view=diff&rev=114312&r1=114311&r2=114312
==============================================================================
--- team/seanbright/resolve-shadow-warnings/res/res_adsi.c (original)
+++ team/seanbright/resolve-shadow-warnings/res/res_adsi.c Sat Apr 19 17:16:29 2008
@@ -114,7 +114,7 @@
 
 }
 
-static int adsi_careful_send(struct ast_channel *chan, unsigned char *buf, int len, int *remainder)
+static int adsi_careful_send(struct ast_channel *chan, unsigned char *buf, int len, int *remain)
 {
 	/* Sends carefully on a full duplex channel by using reading for
 	   timing */
@@ -124,14 +124,14 @@
 	/* Zero out our outgoing frame */
 	memset(&outf, 0, sizeof(outf));
 
-	if (remainder && *remainder) {
+	if (remain && *remain) {
 		amt = len;
 
 		/* Send remainder if provided */
-		if (amt > *remainder)
-			amt = *remainder;
+		if (amt > *remain)
+			amt = *remain;
 		else
-			*remainder = *remainder - amt;
+			*remain = *remain - amt;
 		outf.frametype = AST_FRAME_VOICE;
 		outf.subclass = AST_FORMAT_ULAW;
 		outf.data = buf;
@@ -170,8 +170,8 @@
 		/* Send no more than they sent us */
 		if (amt > inf->datalen)
 			amt = inf->datalen;
-		else if (remainder)
-			*remainder = inf->datalen - amt;
+		else if (remain)
+			*remain = inf->datalen - amt;
 		outf.frametype = AST_FRAME_VOICE;
 		outf.subclass = AST_FORMAT_ULAW;
 		outf.data = buf;
@@ -914,13 +914,13 @@
 
 }
 
-static int _ast_adsi_print(struct ast_channel *chan, char **lines, int *aligns, int voice)
+static int _ast_adsi_print(struct ast_channel *chan, char **lines, int *alignments, int voice)
 {
 	unsigned char buf[4096];
 	int bytes = 0, res, x;
 
 	for(x = 0; lines[x]; x++) 
-		bytes += ast_adsi_display(buf + bytes, ADSI_INFO_PAGE, x+1, aligns[x], 0, lines[x], "");
+		bytes += ast_adsi_display(buf + bytes, ADSI_INFO_PAGE, x+1, alignments[x], 0, lines[x], "");
 	bytes += ast_adsi_set_line(buf + bytes, ADSI_INFO_PAGE, 1);
 	if (voice)
 		bytes += ast_adsi_voice_mode(buf + bytes, 0);

Modified: team/seanbright/resolve-shadow-warnings/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/res/res_agi.c?view=diff&rev=114312&r1=114311&r2=114312
==============================================================================
--- team/seanbright/resolve-shadow-warnings/res/res_agi.c (original)
+++ team/seanbright/resolve-shadow-warnings/res/res_agi.c Sat Apr 19 17:16:29 2008
@@ -517,7 +517,7 @@
 	int s, flags, res, port = AGI_PORT;
 	struct pollfd pfds[1];
 	char *host, *c, *script = "";
-	struct sockaddr_in sin;
+	struct sockaddr_in addr_in;
 	struct hostent *hp;
 	struct ast_hostent ahp;
 
@@ -556,11 +556,11 @@
 		close(s);
 		return -1;
 	}
-	memset(&sin, 0, sizeof(sin));
-	sin.sin_family = AF_INET;
-	sin.sin_port = htons(port);
-	memcpy(&sin.sin_addr, hp->h_addr, sizeof(sin.sin_addr));
-	if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) && (errno != EINPROGRESS)) {
+	memset(&addr_in, 0, sizeof(addr_in));
+	addr_in.sin_family = AF_INET;
+	addr_in.sin_port = htons(port);
+	memcpy(&addr_in.sin_addr, hp->h_addr, sizeof(addr_in.sin_addr));
+	if (connect(s, (struct sockaddr *)&addr_in, sizeof(addr_in)) && (errno != EINPROGRESS)) {
 		ast_log(LOG_WARNING, "Connect failed with unexpected error: %s\n", strerror(errno));
 		close(s);
 		return AGI_RESULT_FAILURE;
@@ -879,7 +879,7 @@
 static int handle_controlstreamfile(struct ast_channel *chan, AGI *agi, int argc, char *argv[])
 {
 	int res = 0, skipms = 3000;
-	char *fwd = NULL, *rev = NULL, *pause = NULL, *stop = NULL;
+	char *fwd = NULL, *rev = NULL, *suspend = NULL, *stop = NULL;
 
 	if (argc < 5 || argc > 9)
 		return RESULT_SHOWUSAGE;
@@ -903,11 +903,11 @@
 		rev = "*";
 	
 	if (argc > 8 && !ast_strlen_zero(argv[8]))
-		pause = argv[8];
+		suspend = argv[8];
 	else
-		pause = NULL;
-	
-	res = ast_control_streamfile(chan, argv[3], fwd, rev, stop, pause, NULL, skipms, NULL);
+		suspend = NULL;
+	
+	res = ast_control_streamfile(chan, argv[3], fwd, rev, stop, suspend, NULL, skipms, NULL);
 	
 	ast_agi_fdprintf(chan, agi->fd, "200 result=%d\n", res);
 
@@ -1444,15 +1444,15 @@
 static int handle_exec(struct ast_channel *chan, AGI *agi, int argc, char **argv)
 {
 	int res;
-	struct ast_app *app;
+	struct ast_app *app_to_exec;
 
 	if (argc < 2)
 		return RESULT_SHOWUSAGE;
 
 	ast_verb(3, "AGI Script Executing Application: (%s) Options: (%s)\n", argv[1], argv[2]);
 
-	if ((app = pbx_findapp(argv[1]))) {
-		res = pbx_exec(chan, app, argv[2]);
+	if ((app_to_exec = pbx_findapp(argv[1]))) {
+		res = pbx_exec(chan, app_to_exec, argv[2]);
 	} else {
 		ast_log(LOG_WARNING, "Could not find application (%s)\n", argv[1]);
 		res = -2;

Modified: team/seanbright/resolve-shadow-warnings/res/res_config_ldap.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/res/res_config_ldap.c?view=diff&rev=114312&r1=114311&r2=114312
==============================================================================
--- team/seanbright/resolve-shadow-warnings/res/res_config_ldap.c (original)
+++ team/seanbright/resolve-shadow-warnings/res/res_config_ldap.c Sat Apr 19 17:16:29 2008
@@ -65,7 +65,7 @@
 static char url[512];
 static char user[512];
 static char pass[50];
-static char basedn[512];
+static char base_distinguised_name[512];
 static int version = 3;
 static time_t connect_time;
 
@@ -342,7 +342,7 @@
  * \return \a vars - an array of ast_variable variables terminated with a null.
  **/
 static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_config *table_config,
-	LDAPMessage *ldap_result, unsigned int *entries_count_ptr)
+	LDAPMessage *ldap_result_msg, unsigned int *entries_count_ptr)
 {
 	struct ast_variable **vars;
 	int i = 0;
@@ -358,7 +358,7 @@
 	int delim_count = 0;
 
 	/* First find the total count */
-	ldap_entry = ldap_first_entry(ldapConn, ldap_result);
+	ldap_entry = ldap_first_entry(ldapConn, ldap_result_msg);
 
 	for (tot_count = 0; ldap_entry; tot_count++){ 
 		tot_count += semicolon_count_var(realtime_ldap_entry_to_var(table_config, ldap_entry));
@@ -374,7 +374,7 @@
 	 * This memory must be freed outside of this function. */
 	vars = ast_calloc(sizeof(struct ast_variable *), tot_count + 1);
 
-	ldap_entry = ldap_first_entry(ldapConn, ldap_result);
+	ldap_entry = ldap_first_entry(ldapConn, ldap_result_msg);
 
 	i = 0;
 
@@ -544,14 +544,14 @@
 		struct ast_variable **vars = NULL;
 		struct ast_variable *var = NULL;
 		int result = -1;
-		LDAPMessage *ldap_result = NULL;
+		LDAPMessage *ldap_result_msg = NULL;
 		int tries = 0;
 
 		ast_debug(2, "ldap_loadentry dn=%s\n", dn);
 
 		do {
 			result = ldap_search_ext_s(ldapConn, dn, LDAP_SCOPE_BASE,
-					   "(objectclass=*)", NULL, 0, NULL, NULL, NULL, LDAP_NO_LIMIT, &ldap_result);
+					   "(objectclass=*)", NULL, 0, NULL, NULL, NULL, LDAP_NO_LIMIT, &ldap_result_msg);
 			if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {
 				ast_log(LOG_WARNING,
 					"Failed to query database. Try %d/3\n",
@@ -580,17 +580,17 @@
 		} else {
 			int num_entry = 0;
 			unsigned int *entries_count_ptr = NULL; /*!< not using this */
-			if ((num_entry = ldap_count_entries(ldapConn, ldap_result)) > 0) {
+			if ((num_entry = ldap_count_entries(ldapConn, ldap_result_msg)) > 0) {
 				ast_debug(3, "num_entry: %d\n", num_entry);
 
-				vars = realtime_ldap_result_to_vars(table_config, ldap_result, entries_count_ptr);
+				vars = realtime_ldap_result_to_vars(table_config, ldap_result_msg, entries_count_ptr);
 				if (num_entry > 1)
 					ast_log(LOG_WARNING, "More than one entry for dn=%s. Take only 1st one\n", dn);
 			} else {
 				ast_log(LOG_WARNING, "Could not find any entry dn=%s.\n", dn);
 			}
 		}
-		ldap_msgfree(ldap_result);
+		ldap_msgfree(ldap_result_msg);
 
 		/* Chopping \a vars down to one variable */
 		if (vars != NULL) {
@@ -719,7 +719,7 @@
 	struct ast_str *filter = NULL;
 	int tries = 0;
 	int result = 0;
-	LDAPMessage *ldap_result = NULL;
+	LDAPMessage *ldap_result_msg = NULL;
 
 	if (!table_name) {
 		ast_log(LOG_WARNING, "No table_name specified.\n");
@@ -783,10 +783,10 @@
 	ast_str_append(&filter, 0, ")");
 
 	do {
-		/* freeing ldap_result further down */
+		/* freeing ldap_result_msg further down */
 		result = ldap_search_ext_s(ldapConn, clean_basedn,
 				  LDAP_SCOPE_SUBTREE, filter->str, NULL, 0, NULL, NULL, NULL, LDAP_NO_LIMIT,
-				  &ldap_result);
+				  &ldap_result_msg);
 		if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {
 			ast_log(LOG_DEBUG, "Failed to query database. Try %d/10\n",
 				tries + 1);
@@ -809,15 +809,15 @@
 	} else {
 		/* this is where we create the variables from the search result 
 		 * freeing this \a vars outside this function */
-		if (ldap_count_entries(ldapConn, ldap_result) > 0) {
+		if (ldap_count_entries(ldapConn, ldap_result_msg) > 0) {
 			/* is this a static var or some other? they are handled different for delimited values */
-			vars = realtime_ldap_result_to_vars(table_config, ldap_result, entries_count_ptr);
+			vars = realtime_ldap_result_to_vars(table_config, ldap_result_msg, entries_count_ptr);
 		} else {
 			ast_log(LOG_WARNING, "Could not find any entry matching %s in base dn %s.\n",
 				filter->str, clean_basedn);
 		}
 
-		ldap_msgfree(ldap_result);
+		ldap_msgfree(ldap_result_msg);
 
 		/* TODO: get the default variables from the accountBaseDN, not implemented with delimited values */
 		if (vars) {
@@ -1087,8 +1087,8 @@
 
 	for (i = 0; i < vars_count; i++) {
 		if (!strcmp(categories[i].variable_name, "#include")) {
-			struct ast_flags config_flags = { 0 };
-			if (!ast_config_internal_load(categories[i].variable_value, cfg, config_flags, "", who_asked))
+			struct ast_flags flags = { 0 };
+			if (!ast_config_internal_load(categories[i].variable_value, cfg, flags, "", who_asked))
 				break;
 			continue;
 		}
@@ -1136,7 +1136,7 @@
 	struct ast_str *filter = NULL;
 	int tries = 0;
 	int result = 0;
-	LDAPMessage *ldap_result = NULL;
+	LDAPMessage *ldap_result_msg = NULL;
 
 	if (!table_name) {
 		ast_log(LOG_WARNING, "No table_name specified.\n");
@@ -1240,10 +1240,10 @@
 	/* freeing ldap_mods further down */
 
 	do {
-		/* freeing ldap_result further down */
+		/* freeing ldap_result_msg further down */
 		result = ldap_search_ext_s(ldapConn, clean_basedn,
 				  LDAP_SCOPE_SUBTREE, filter->str, NULL, 0, NULL, NULL, NULL, LDAP_NO_LIMIT,
-				  &ldap_result);
+				  &ldap_result_msg);
 		if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {
 			ast_log(LOG_WARNING, "Failed to query database. Try %d/3\n",
 				tries + 1);
@@ -1271,17 +1271,17 @@
 			free(filter);
 		if (clean_basedn)
 			free(clean_basedn);
-		ldap_msgfree(ldap_result);
+		ldap_msgfree(ldap_result_msg);
 		ldap_mods_free(ldap_mods, 0);
 		return -1;
 	}
 	/* Ready to update */
-	if ((num_entries = ldap_count_entries(ldapConn, ldap_result)) > 0) {
+	if ((num_entries = ldap_count_entries(ldapConn, ldap_result_msg)) > 0) {
 		ast_debug(3, "LINE(%d) Modifying %s=%s hits: %d\n", __LINE__, attribute, lookup, num_entries);
 		for (i = 0; option_debug > 2 && i < mods_size - 1; i++)
 			ast_debug(3, "LINE(%d) %s=%s \n", __LINE__, ldap_mods[i]->mod_type, ldap_mods[i]->mod_values[0]);
 
-		ldap_entry = ldap_first_entry(ldapConn, ldap_result);
+		ldap_entry = ldap_first_entry(ldapConn, ldap_result_msg);
 
 		for (i = 0; ldap_entry; i++) { 
 			dn = ldap_get_dn(ldapConn, ldap_entry);
@@ -1297,7 +1297,7 @@
 		free(filter);
 	if (clean_basedn)
 		free(clean_basedn);
-	ldap_msgfree(ldap_result);
+	ldap_msgfree(ldap_result_msg);
 	ldap_mods_free(ldap_mods, 0);
 	return num_entries;
 }
@@ -1424,9 +1424,9 @@
 
 	if (!(s = ast_variable_retrieve(config, "_general", "basedn"))) {
 		ast_log(LOG_ERROR, "No LDAP base dn found, using 'asterisk' as default.\n");
-		basedn[0] = '\0';
+		base_distinguised_name[0] = '\0';
 	} else 
-		ast_copy_string(basedn, s, sizeof(basedn));
+		ast_copy_string(base_distinguised_name, s, sizeof(base_distinguised_name));
 
 	if (!(s = ast_variable_retrieve(config, "_general", "version")) || !(s = ast_variable_retrieve(config, "_general", "protocol"))) {
 		ast_log(LOG_NOTICE, "No explicit LDAP version found, using 3 as default.\n");
@@ -1517,7 +1517,7 @@
 static char *realtime_ldap_status(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	char status[256], status2[100] = "";
-	int ctime = time(NULL) - connect_time;
+	int ctimesec = time(NULL) - connect_time;
 
 	switch (cmd) {
 	case CLI_INIT:
@@ -1534,29 +1534,29 @@
 		return CLI_FAILURE;
 
 	if (!ast_strlen_zero(url)) 
-		snprintf(status, sizeof(status), "Connected to '%s', baseDN %s", url, basedn);
+		snprintf(status, sizeof(status), "Connected to '%s', baseDN %s", url, base_distinguised_name);
 
 	if (!ast_strlen_zero(user))
 		snprintf(status2, sizeof(status2), " with username %s", user);
 
-	if (ctime > 31536000) {
+	if (ctimesec > 31536000) {
 		ast_cli(a->fd, "%s%s for %d years, %d days, %d hours, %d minutes, %d seconds.\n",
-				status, status2, ctime / 31536000,
-				(ctime % 31536000) / 86400, (ctime % 86400) / 3600,
-				(ctime % 3600) / 60, ctime % 60);
-	} else if (ctime > 86400) {
+				status, status2, ctimesec / 31536000,
+				(ctimesec % 31536000) / 86400, (ctimesec % 86400) / 3600,
+				(ctimesec % 3600) / 60, ctimesec % 60);
+	} else if (ctimesec > 86400) {
 		ast_cli(a->fd, "%s%s for %d days, %d hours, %d minutes, %d seconds.\n",
-				status, status2, ctime / 86400, (ctime % 86400) / 3600,
-				(ctime % 3600) / 60, ctime % 60);
-	} else if (ctime > 3600) {
+				status, status2, ctimesec / 86400, (ctimesec % 86400) / 3600,
+				(ctimesec % 3600) / 60, ctimesec % 60);
+	} else if (ctimesec > 3600) {
 		ast_cli(a->fd, "%s%s for %d hours, %d minutes, %d seconds.\n",
-				status, status2, ctime / 3600, (ctime % 3600) / 60,
-				ctime % 60);
-	} else if (ctime > 60) {
+				status, status2, ctimesec / 3600, (ctimesec % 3600) / 60,
+				ctimesec % 60);
+	} else if (ctimesec > 60) {
 		ast_cli(a->fd, "%s%s for %d minutes, %d seconds.\n", status, status2,
-					ctime / 60, ctime % 60);
+					ctimesec / 60, ctimesec % 60);
 	} else {
-		ast_cli(a->fd, "%s%s for %d seconds.\n", status, status2, ctime);
+		ast_cli(a->fd, "%s%s for %d seconds.\n", status, status2, ctimesec);
 	}
 
 	return CLI_SUCCESS;

Modified: team/seanbright/resolve-shadow-warnings/res/res_config_pgsql.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/res/res_config_pgsql.c?view=diff&rev=114312&r1=114311&r2=114312
==============================================================================
--- team/seanbright/resolve-shadow-warnings/res/res_config_pgsql.c (original)
+++ team/seanbright/resolve-shadow-warnings/res/res_config_pgsql.c Sat Apr 19 17:16:29 2008
@@ -801,11 +801,11 @@
 	return 0;
 }
 
-static int parse_config(int reload)
+static int parse_config(int do_reload)
 {
 	struct ast_config *config;
 	const char *s;
-	struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
+	struct ast_flags config_flags = { do_reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
 
 	if ((config = ast_config_load(RES_CONFIG_PGSQL_CONF, config_flags)) == CONFIG_STATUS_FILEUNCHANGED)
 		return 0;
@@ -947,7 +947,7 @@
 static char *handle_cli_realtime_pgsql_status(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	char status[256], status2[100] = "";
-	int ctime = time(NULL) - connect_time;
+	int ctimesec = time(NULL) - connect_time;
 
 	switch (cmd) {
 	case CLI_INIT:
@@ -974,22 +974,22 @@
 		if (!ast_strlen_zero(dbuser))
 			snprintf(status2, 99, " with username %s", dbuser);
 
-		if (ctime > 31536000)
+		if (ctimesec > 31536000)
 			ast_cli(a->fd, "%s%s for %d years, %d days, %d hours, %d minutes, %d seconds.\n",
-					status, status2, ctime / 31536000, (ctime % 31536000) / 86400,
-					(ctime % 86400) / 3600, (ctime % 3600) / 60, ctime % 60);
-		else if (ctime > 86400)
+					status, status2, ctimesec / 31536000, (ctimesec % 31536000) / 86400,
+					(ctimesec % 86400) / 3600, (ctimesec % 3600) / 60, ctimesec % 60);
+		else if (ctimesec > 86400)
 			ast_cli(a->fd, "%s%s for %d days, %d hours, %d minutes, %d seconds.\n", status,
-					status2, ctime / 86400, (ctime % 86400) / 3600, (ctime % 3600) / 60,
-					ctime % 60);
-		else if (ctime > 3600)
+					status2, ctimesec / 86400, (ctimesec % 86400) / 3600, (ctimesec % 3600) / 60,
+					ctimesec % 60);
+		else if (ctimesec > 3600)
 			ast_cli(a->fd, "%s%s for %d hours, %d minutes, %d seconds.\n", status, status2,
-					ctime / 3600, (ctime % 3600) / 60, ctime % 60);
-		else if (ctime > 60)
-			ast_cli(a->fd, "%s%s for %d minutes, %d seconds.\n", status, status2, ctime / 60,
-					ctime % 60);
+					ctimesec / 3600, (ctimesec % 3600) / 60, ctimesec % 60);
+		else if (ctimesec > 60)
+			ast_cli(a->fd, "%s%s for %d minutes, %d seconds.\n", status, status2, ctimesec / 60,
+					ctimesec % 60);
 		else
-			ast_cli(a->fd, "%s%s for %d seconds.\n", status, status2, ctime);
+			ast_cli(a->fd, "%s%s for %d seconds.\n", status, status2, ctimesec);
 
 		return CLI_SUCCESS;
 	} else {

Modified: team/seanbright/resolve-shadow-warnings/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/res/res_musiconhold.c?view=diff&rev=114312&r1=114311&r2=114312
==============================================================================
--- team/seanbright/resolve-shadow-warnings/res/res_musiconhold.c (original)
+++ team/seanbright/resolve-shadow-warnings/res/res_musiconhold.c Sat Apr 19 17:16:29 2008
@@ -541,10 +541,10 @@
 	short sbuf[8192];
 	int res, res2;
 	int len;
-	struct timeval tv, tv_tmp;
-
-	tv.tv_sec = 0;
-	tv.tv_usec = 0;
+	struct timeval deadline, tv_tmp;
+
+	deadline.tv_sec = 0;
+	deadline.tv_usec = 0;
 	for(;/* ever */;) {
 		pthread_testcancel();
 		/* Spawn mp3 player if it's not there */
@@ -567,16 +567,16 @@
 			long delta;
 			/* Reliable sleep */
 			tv_tmp = ast_tvnow();
-			if (ast_tvzero(tv))
-				tv = tv_tmp;
-			delta = ast_tvdiff_ms(tv_tmp, tv);
+			if (ast_tvzero(deadline))
+				deadline = tv_tmp;
+			delta = ast_tvdiff_ms(tv_tmp, deadline);
 			if (delta < MOH_MS_INTERVAL) {	/* too early */
-				tv = ast_tvadd(tv, ast_samp2tv(MOH_MS_INTERVAL, 1000));	/* next deadline */
+				deadline = ast_tvadd(deadline, ast_samp2tv(MOH_MS_INTERVAL, 1000));	/* next deadline */
 				usleep(1000 * (MOH_MS_INTERVAL - delta));
 				pthread_testcancel();
 			} else {
 				ast_log(LOG_NOTICE, "Request to schedule in the past?!?!\n");
-				tv = tv_tmp;
+				deadline = tv_tmp;
 			}
 			res = 8 * MOH_MS_INTERVAL;	/* 8 samples per millisecond */
 		}
@@ -982,7 +982,7 @@
 	return 0;
 }
 
-static int moh_register(struct mohclass *moh, int reload)
+static int moh_register(struct mohclass *moh, int do_reload)
 {
 #ifdef HAVE_ZAPTEL
 	int x;
@@ -992,7 +992,7 @@
 	AST_RWLIST_WRLOCK(&mohclasses);
 	if ((mohclass = get_mohbyname(moh->name, 0)) && !moh_diff(mohclass, moh)) {
 		mohclass->delete = 0;
-		if (reload) {
+		if (do_reload) {
 			ast_debug(1, "Music on Hold class '%s' left alone from initial load.\n", moh->name);
 		} else {
 			ast_log(LOG_WARNING, "Music on Hold class '%s' already exists\n", moh->name);
@@ -1308,21 +1308,21 @@
 	}
 }
 
-static int load_moh_classes(int reload)
+static int load_moh_classes(int do_reload)
 {
 	struct ast_config *cfg;
 	struct ast_variable *var;
 	struct mohclass *class;	
 	char *cat;
 	int numclasses = 0;
-	struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
+	struct ast_flags config_flags = { do_reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
 
 	cfg = ast_config_load("musiconhold.conf", config_flags);
 
 	if (cfg == NULL || cfg == CONFIG_STATUS_FILEUNCHANGED)
 		return 0;
 
-	if (reload) {
+	if (do_reload) {
 		AST_RWLIST_WRLOCK(&mohclasses);
 		AST_RWLIST_TRAVERSE(&mohclasses, class, list) {
 			class->delete = 1;
@@ -1399,7 +1399,7 @@
 			}
 
 			/* Don't leak a class when it's already registered */
-			moh_register(class, reload);
+			moh_register(class, do_reload);
 
 			numclasses++;
 		}
@@ -1413,12 +1413,12 @@
 static int ast_moh_destroy_one(struct mohclass *moh)
 {
 	char buff[8192];
-	int bytes, tbytes = 0, stime = 0, pid = 0;
+	int bytes, tbytes = 0, stop_time = 0, pid = 0;
 
 	if (moh) {
 		if (moh->pid > 1) {
 			ast_debug(1, "killing %d!\n", moh->pid);
-			stime = time(NULL) + 2;
+			stop_time = time(NULL) + 2;
 			pid = moh->pid;
 			moh->pid = 0;
 			/* Back when this was just mpg123, SIGKILL was fine.  Now we need
@@ -1429,7 +1429,7 @@
 			kill(pid, SIGTERM);
 			usleep(100000);
 			kill(pid, SIGKILL);
-			while ((ast_wait_for_input(moh->srcfd, 100) > 0) && (bytes = read(moh->srcfd, buff, 8192)) && time(NULL) < stime)
+			while ((ast_wait_for_input(moh->srcfd, 100) > 0) && (bytes = read(moh->srcfd, buff, 8192)) && time(NULL) < stop_time)
 				tbytes = tbytes + bytes;
 			ast_debug(1, "mpg123 pid %d and child died after %d bytes read\n", pid, tbytes);
 			close(moh->srcfd);
@@ -1551,16 +1551,16 @@
 	AST_CLI_DEFINE(handle_cli_moh_show_files,   "List MusicOnHold file-based classes")
 };
 
-static int init_classes(int reload) 
+static int init_classes(int do_reload) 
 {
 	struct mohclass *moh;
     
-	if (!load_moh_classes(reload)) 		/* Load classes from config */
+	if (!load_moh_classes(do_reload)) 		/* Load classes from config */
 		return 0;			/* Return if nothing is found */
 
 	AST_RWLIST_WRLOCK(&mohclasses);
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&mohclasses, moh, list) {
-		if (reload && moh->delete) {
+		if (do_reload && moh->delete) {
 			AST_RWLIST_REMOVE_CURRENT(list);
 			if (!moh->inuse)
 				ast_moh_destroy_one(moh);

Modified: team/seanbright/resolve-shadow-warnings/res/res_odbc.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/res/res_odbc.c?view=diff&rev=114312&r1=114311&r2=114312
==============================================================================
--- team/seanbright/resolve-shadow-warnings/res/res_odbc.c (original)
+++ team/seanbright/resolve-shadow-warnings/res/res_odbc.c Sat Apr 19 17:16:29 2008
@@ -234,7 +234,7 @@
 	const char *dsn, *username, *password, *sanitysql;
 	int enabled, pooling, limit, bse;
 	unsigned int idlecheck;
-	int connect = 0, res = 0;
+	int preconnect = 0, res = 0;
 	struct ast_flags config_flags = { 0 };
 
 	struct odbc_class *new;
@@ -254,7 +254,7 @@
 			/* Reset all to defaults for each class of odbc connections */
 			dsn = username = password = sanitysql = NULL;
 			enabled = 1;
-			connect = idlecheck = 0;
+			preconnect = idlecheck = 0;
 			pooling = 0;
 			limit = 0;
 			bse = 1;
@@ -281,7 +281,7 @@
 				} else if (!strcasecmp(v->name, "enabled")) {
 					enabled = ast_true(v->value);
 				} else if (!strcasecmp(v->name, "pre-connect")) {
-					connect = ast_true(v->value);
+					preconnect = ast_true(v->value);
 				} else if (!strcasecmp(v->name, "dsn")) {
 					dsn = v->value;
 				} else if (!strcasecmp(v->name, "username")) {
@@ -336,7 +336,7 @@
 				new->backslash_is_escape = bse ? 1 : 0;
 				new->idlecheck = idlecheck;
 
-				odbc_register_class(new, connect);
+				odbc_register_class(new, preconnect);
 				ast_log(LOG_NOTICE, "Registered ODBC class '%s' dsn->[%s]\n", cat, dsn);
 			}
 		}
@@ -411,7 +411,7 @@
 	AST_CLI_DEFINE(handle_cli_odbc_show, "List ODBC DSN(s)")
 };
 
-static int odbc_register_class(struct odbc_class *class, int connect)
+static int odbc_register_class(struct odbc_class *class, int preconnect)
 {
 	struct odbc_obj *obj;
 	if (class) {
@@ -419,7 +419,7 @@
 		AST_LIST_INSERT_HEAD(&odbc_list, class, list);
 		AST_LIST_UNLOCK(&odbc_list);
 
-		if (connect) {
+		if (preconnect) {
 			/* Request and release builds a connection */
 			obj = ast_odbc_request_obj(class->name, 0);
 			if (obj)
@@ -549,7 +549,7 @@
 	int res;
 	SQLINTEGER err;
 	short int mlen;
-	unsigned char msg[200], stat[10];
+	unsigned char msg[200], state[10];
 #ifdef NEEDTRACE
 	SQLINTEGER enable = 1;
 	char *tracefile = "/tmp/odbc.trace";
@@ -583,7 +583,7 @@
 		   (SQLCHAR *) obj->parent->password, SQL_NTS);
 
 	if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
-		SQLGetDiagRec(SQL_HANDLE_DBC, obj->con, 1, stat, &err, msg, 100, &mlen);
+		SQLGetDiagRec(SQL_HANDLE_DBC, obj->con, 1, state, &err, msg, 100, &mlen);
 		ast_mutex_unlock(&obj->lock);
 		ast_log(LOG_WARNING, "res_odbc: Error SQLConnect=%d errno=%d %s\n", res, (int)err, msg);
 		return ODBC_FAIL;
@@ -606,7 +606,7 @@
 	const char *dsn, *username, *password, *sanitysql;
 	int enabled, pooling, limit, bse;
 	unsigned int idlecheck;
-	int connect = 0, res = 0;
+	int preconnect = 0, res = 0;
 	struct ast_flags config_flags = { CONFIG_FLAG_FILEUNCHANGED };
 
 	struct odbc_class *new, *class;
@@ -631,7 +631,7 @@
 				/* Reset all to defaults for each class of odbc connections */
 				dsn = username = password = sanitysql = NULL;
 				enabled = 1;
-				connect = idlecheck = 0;
+				preconnect = idlecheck = 0;
 				pooling = 0;
 				limit = 0;
 				bse = 1;
@@ -658,7 +658,7 @@
 					} else if (!strcasecmp(v->name, "enabled")) {
 						enabled = ast_true(v->value);
 					} else if (!strcasecmp(v->name, "pre-connect")) {
-						connect = ast_true(v->value);
+						preconnect = ast_true(v->value);
 					} else if (!strcasecmp(v->name, "dsn")) {
 						dsn = v->value;
 					} else if (!strcasecmp(v->name, "username")) {
@@ -748,7 +748,7 @@
 					if (class) {
 						ast_log(LOG_NOTICE, "Refreshing ODBC class '%s' dsn->[%s]\n", cat, dsn);
 					} else {
-						odbc_register_class(new, connect);
+						odbc_register_class(new, preconnect);
 						ast_log(LOG_NOTICE, "Registered ODBC class '%s' dsn->[%s]\n", cat, dsn);
 					}
 				}

Modified: team/seanbright/resolve-shadow-warnings/res/res_phoneprov.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/res/res_phoneprov.c?view=diff&rev=114312&r1=114311&r2=114312
==============================================================================
--- team/seanbright/resolve-shadow-warnings/res/res_phoneprov.c (original)
+++ team/seanbright/resolve-shadow-warnings/res/res_phoneprov.c Sat Apr 19 17:16:29 2008
@@ -349,7 +349,7 @@
 	int tzoffset;
 	char buffer[21];
 	struct ast_var_t *var;
-	struct timeval tv;
+	struct timeval when;
 
 	time(&utc_time);
 	ast_get_dst_info(&utc_time, &dstenable, &dststart, &dstend, &tzoffset, zone);
@@ -364,8 +364,8 @@
 	if ((var = ast_var_assign("DST_ENABLE", "1")))
 		AST_LIST_INSERT_TAIL(headp, var, entries);
 
-	tv.tv_sec = dststart; 
-	ast_localtime(&tv, &tm_info, zone);
+	when.tv_sec = dststart; 
+	ast_localtime(&when, &tm_info, zone);
 
 	snprintf(buffer, sizeof(buffer), "%d", tm_info.tm_mon+1);
 	if ((var = ast_var_assign("DST_START_MONTH", buffer)))
@@ -379,8 +379,8 @@
 	if ((var = ast_var_assign("DST_START_HOUR", buffer)))
 		AST_LIST_INSERT_TAIL(headp, var, entries);
 
-	tv.tv_sec = dstend;
-	ast_localtime(&tv, &tm_info, zone);
+	when.tv_sec = dstend;
+	ast_localtime(&when, &tm_info, zone);
 
 	snprintf(buffer, sizeof(buffer), "%d", tm_info.tm_mon + 1);
 	if ((var = ast_var_assign("DST_END_MONTH", buffer)))
@@ -408,7 +408,7 @@
 	int len;
 	int fd;
 	char buf[256];
-	struct timeval tv = ast_tvnow();
+	struct timeval now = ast_tvnow();
 	struct ast_tm tm;
 
 	if (!(route = ao2_find(http_routes, &search_route, OBJ_POINTER))) {
@@ -432,7 +432,7 @@
 			goto out500;
 		}
 
-		ast_strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S %Z", ast_localtime(&tv, &tm, "GMT"));
+		ast_strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S %Z", ast_localtime(&now, &tm, "GMT"));
 		fprintf(ser->f, "HTTP/1.1 200 OK\r\n"
 			"Server: Asterisk/%s\r\n"
 			"Date: %s\r\n"
@@ -595,7 +595,7 @@
 		if (!strcasecmp(v->name, "mime_type")) {
 			ast_string_field_set(profile, default_mime_type, v->value);
 		} else if (!strcasecmp(v->name, "setvar")) {
-			struct ast_var_t *var;
+			struct ast_var_t *variable;
 			char *value_copy = ast_strdupa(v->value);
 
 			AST_DECLARE_APP_ARGS(args,
@@ -611,8 +611,8 @@
 				args.varval = ast_strip(args.varval);
 				if (ast_strlen_zero(args.varname) || ast_strlen_zero(args.varval))
 					break;
-				if ((var = ast_var_assign(args.varname, args.varval)))
-					AST_LIST_INSERT_TAIL(profile->headp, var, entries);
+				if ((variable = ast_var_assign(args.varname, args.varval)))
+					AST_LIST_INSERT_TAIL(profile->headp, variable, entries);
 			} while (0);
 		} else if (!strcasecmp(v->name, "staticdir")) {
 			ast_string_field_set(profile, staticdir, v->value);

Modified: team/seanbright/resolve-shadow-warnings/res/res_smdi.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/res/res_smdi.c?view=diff&rev=114312&r1=114311&r2=114312
==============================================================================
--- team/seanbright/resolve-shadow-warnings/res/res_smdi.c (original)
+++ team/seanbright/resolve-shadow-warnings/res/res_smdi.c Sat Apr 19 17:16:29 2008
@@ -392,7 +392,7 @@
 
 	while (diff < timeout) {
 		struct timespec ts = { 0, };
-		struct timeval tv;
+		struct timeval wait;
 
 		lock_msg_q(iface, type);
 
@@ -401,9 +401,9 @@
 			return msg;
 		}
 
-		tv = ast_tvadd(start, ast_tv(0, timeout));
-		ts.tv_sec = tv.tv_sec;
-		ts.tv_nsec = tv.tv_usec * 1000;
+		wait = ast_tvadd(start, ast_tv(0, timeout));
+		ts.tv_sec = wait.tv_sec;
+		ts.tv_nsec = wait.tv_usec * 1000;
 
 		/* If there were no messages in the queue, then go to sleep until one
 		 * arrives. */
@@ -730,7 +730,7 @@
 {
 	while (!mwi_monitor.stop) {
 		struct timespec ts = { 0, };
-		struct timeval tv;
+		struct timeval polltime;
 		struct mailbox_mapping *mm;
 
 		ast_mutex_lock(&mwi_monitor.lock);
@@ -742,9 +742,9 @@
 
 		/* Sleep up to the configured polling interval.  Allow unload_module()
 		 * to signal us to wake up and exit. */
-		tv = ast_tvadd(mwi_monitor.last_poll, ast_tv(mwi_monitor.polling_interval, 0));
-		ts.tv_sec = tv.tv_sec;
-		ts.tv_nsec = tv.tv_usec * 1000;
+		polltime = ast_tvadd(mwi_monitor.last_poll, ast_tv(mwi_monitor.polling_interval, 0));
+		ts.tv_sec = polltime.tv_sec;
+		ts.tv_nsec = polltime.tv_usec * 1000;
 		ast_cond_timedwait(&mwi_monitor.cond, &mwi_monitor.lock, &ts);
 
 		ast_mutex_unlock(&mwi_monitor.lock);




More information about the asterisk-commits mailing list