[asterisk-commits] seanbright: branch seanbright/resolve-shadow-warnings r114291 - in /team/sean...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 18 18:14:13 CDT 2008


Author: seanbright
Date: Fri Apr 18 18:14:12 2008
New Revision: 114291

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114291
Log:
First small batch of changes.

Modified:
    team/seanbright/resolve-shadow-warnings/channels/chan_agent.c
    team/seanbright/resolve-shadow-warnings/channels/chan_alsa.c
    team/seanbright/resolve-shadow-warnings/utils/astman.c
    team/seanbright/resolve-shadow-warnings/utils/extconf.c
    team/seanbright/resolve-shadow-warnings/utils/frame.c
    team/seanbright/resolve-shadow-warnings/utils/muted.c
    team/seanbright/resolve-shadow-warnings/utils/smsq.c

Modified: team/seanbright/resolve-shadow-warnings/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/chan_agent.c?view=diff&rev=114291&r1=114290&r2=114291
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/chan_agent.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/chan_agent.c Fri Apr 18 18:14:12 2008
@@ -1282,7 +1282,7 @@
 	int groupoff;
 	int waitforagent=0;
 	int hasagent = 0;
-	struct timeval tv;
+	struct timeval now;
 
 	s = data;
 	if ((s[0] == '@') && (sscanf(s + 1, "%d", &groupoff) == 1)) {
@@ -1301,8 +1301,8 @@
 		    ast_strlen_zero(p->loginchan)) {
 			if (p->chan)
 				hasagent++;
-			tv = ast_tvnow();
-			if (!p->lastdisc.tv_sec || (tv.tv_sec >= p->lastdisc.tv_sec)) {
+			now = ast_tvnow();
+			if (!p->lastdisc.tv_sec || (now.tv_sec >= p->lastdisc.tv_sec)) {
 				p->lastdisc = ast_tv(0, 0);
 				/* Agent must be registered, but not have any active call, and not be in a waiting state */
 				if (!p->owner && p->chan) {
@@ -1323,11 +1323,11 @@
 			if (!p->pending && ((groupmatch && (p->group & groupmatch)) || !strcmp(data, p->agent))) {
 				if (p->chan || !ast_strlen_zero(p->loginchan))
 					hasagent++;
-				tv = ast_tvnow();
+				now = ast_tvnow();
 #if 0
-				ast_log(LOG_NOTICE, "Time now: %ld, Time of lastdisc: %ld\n", tv.tv_sec, p->lastdisc.tv_sec);
+				ast_log(LOG_NOTICE, "Time now: %ld, Time of lastdisc: %ld\n", now.tv_sec, p->lastdisc.tv_sec);
 #endif
-				if (!p->lastdisc.tv_sec || (tv.tv_sec >= p->lastdisc.tv_sec)) {
+				if (!p->lastdisc.tv_sec || (now.tv_sec >= p->lastdisc.tv_sec)) {
 					p->lastdisc = ast_tv(0, 0);
 					/* Agent must be registered, but not have any active call, and not be in a waiting state */
 					if (!p->owner && p->chan) {
@@ -1648,7 +1648,7 @@
 	char username[AST_MAX_BUF];
 	char location[AST_MAX_BUF] = "";
 	char talkingto[AST_MAX_BUF] = "";
-	char moh[AST_MAX_BUF];
+	char music[AST_MAX_BUF];
 	int count_agents = 0;		/*!< Number of agents configured */
 	int online_agents = 0;		/*!< Number of online agents */
 	int offline_agents = 0;		/*!< Number of offline agents */
@@ -1702,9 +1702,9 @@
 				offline_agents++;
 			}
 			if (!ast_strlen_zero(p->moh))
-				snprintf(moh, sizeof(moh), " (musiconhold is '%s')", p->moh);
+				snprintf(music, sizeof(music), " (musiconhold is '%s')", p->moh);
 			ast_cli(a->fd, "%-12.12s %s%s%s%s\n", p->agent, 
-				username, location, talkingto, moh);
+				username, location, talkingto, music);
 			count_agents++;
 		}
 		ast_mutex_unlock(&p->lock);
@@ -1726,7 +1726,7 @@
 	char username[AST_MAX_BUF];
 	char location[AST_MAX_BUF] = "";
 	char talkingto[AST_MAX_BUF] = "";
-	char moh[AST_MAX_BUF];
+	char music[AST_MAX_BUF];
 	int count_agents = 0;           /* Number of agents configured */
 	int online_agents = 0;          /* Number of online agents */
 	int agent_status = 0;           /* 0 means offline, 1 means online */
@@ -1770,9 +1770,9 @@
 				strncat(location, " (Confirmed)", sizeof(location) - strlen(location) - 1);
 		}
 		if (!ast_strlen_zero(p->moh))
-			snprintf(moh, sizeof(moh), " (musiconhold is '%s')", p->moh);
+			snprintf(music, sizeof(music), " (musiconhold is '%s')", p->moh);
 		if (agent_status)
-			ast_cli(a->fd, "%-12.12s %s%s%s%s\n", p->agent, username, location, talkingto, moh);
+			ast_cli(a->fd, "%-12.12s %s%s%s%s\n", p->agent, username, location, talkingto, music);
 		count_agents++;
 		ast_mutex_unlock(&p->lock);
 	}

Modified: team/seanbright/resolve-shadow-warnings/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/channels/chan_alsa.c?view=diff&rev=114291&r1=114290&r2=114291
==============================================================================
--- team/seanbright/resolve-shadow-warnings/channels/chan_alsa.c (original)
+++ team/seanbright/resolve-shadow-warnings/channels/chan_alsa.c Fri Apr 18 18:14:12 2008
@@ -563,12 +563,12 @@
 	return tmp;
 }
 
-static struct ast_channel *alsa_request(const char *type, int format, void *data, int *cause)
-{
-	int oldformat = format;
+static struct ast_channel *alsa_request(const char *type, int fmt, void *data, int *cause)
+{
+	int oldformat = fmt;
 	struct ast_channel *tmp = NULL;
 
-	if (!(format &= AST_FORMAT_SLINEAR)) {
+	if (!(fmt &= AST_FORMAT_SLINEAR)) {
 		ast_log(LOG_NOTICE, "Asked to get a channel of format '%d'\n", oldformat);
 		return NULL;
 	}

Modified: team/seanbright/resolve-shadow-warnings/utils/astman.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/utils/astman.c?view=diff&rev=114291&r1=114290&r2=114291
==============================================================================
--- team/seanbright/resolve-shadow-warnings/utils/astman.c (original)
+++ team/seanbright/resolve-shadow-warnings/utils/astman.c Fri Apr 18 18:14:12 2008
@@ -625,7 +625,7 @@
 	return 0;
 }
 
-static int login(char *hostname)
+static int manager_login(char *hostname)
 {
 	newtComponent form;
 	newtComponent cancel;
@@ -755,7 +755,7 @@
 	newtCls();
 	newtDrawRootText(0, 0, "Asterisk Manager (C)2002, Linux Support Services, Inc.");
 	newtPushHelpLine("Welcome to the Asterisk Manager!");
-	if (login(argv[1])) {
+	if (manager_login(argv[1])) {
 		newtFinished();
 		exit(1);
 	}

Modified: team/seanbright/resolve-shadow-warnings/utils/extconf.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/utils/extconf.c?view=diff&rev=114291&r1=114290&r2=114291
==============================================================================
--- team/seanbright/resolve-shadow-warnings/utils/extconf.c (original)
+++ team/seanbright/resolve-shadow-warnings/utils/extconf.c Fri Apr 18 18:14:12 2008
@@ -1247,7 +1247,7 @@
 static void *safe_system_prev_handler;
 
 /*! \brief NULL handler so we can collect the child exit status */
-static void null_sig_handler(int signal)
+static void null_sig_handler(int sig)
 {
 
 }
@@ -2639,8 +2639,8 @@
 };
 
 
-static char *config = "extensions.conf";
-static char *registrar = "conf2ael";
+static char *config_filename = "extensions.conf";
+static char *global_registrar = "conf2ael";
 static char userscontext[AST_MAX_EXTENSION] = "default";
 static int static_config = 0;
 static int write_protect_config = 1;
@@ -3791,9 +3791,9 @@
 				}
 				
 				if (process_buf) {
-					char *buf = ast_strip(process_buf);
-					if (!ast_strlen_zero(buf)) {
-						if (process_text_line(cfg, &cat, buf, lineno, filename, withcomments, suggested_include_file)) {
+					char *stripped_process_buf = ast_strip(process_buf);
+					if (!ast_strlen_zero(stripped_process_buf)) {
+						if (process_text_line(cfg, &cat, stripped_process_buf, lineno, filename, withcomments, suggested_include_file)) {
 							cfg = NULL;
 							break;
 						}
@@ -5249,16 +5249,16 @@
 
 static struct ast_context *__ast_context_create(struct ast_context **extcontexts, const char *name, const char *registrar, int existsokay)
 {
-	struct ast_context *tmp, **local_contexts;
+	struct ast_context *tmp, **global_local_contexts;
 	int length = sizeof(struct ast_context) + strlen(name) + 1;
 
 	if (!extcontexts) {
 		ast_wrlock_contexts();
-		local_contexts = &contexts;
+		global_local_contexts = &contexts;
 	} else
-		local_contexts = extcontexts;
-
-	for (tmp = *local_contexts; tmp; tmp = tmp->next) {
+		global_local_contexts = extcontexts;
+
+	for (tmp = *global_local_contexts; tmp; tmp = tmp->next) {
 		if (!strcasecmp(tmp->name, name)) {
 			if (!existsokay) {
 				ast_log(LOG_WARNING, "Tried to register context '%s', already in use\n", name);
@@ -5275,10 +5275,10 @@
 		strcpy(tmp->name, name);
 		tmp->root = NULL;
 		tmp->registrar = registrar;
-		tmp->next = *local_contexts;
+		tmp->next = *global_local_contexts;
 		tmp->includes = NULL;
 		tmp->ignorepats = NULL;
-		*local_contexts = tmp;
+		*global_local_contexts = tmp;
 		if (option_debug)
 			ast_log(LOG_DEBUG, "Registered context '%s'\n", tmp->name);
 		if (option_verbose > 2)
@@ -5916,7 +5916,7 @@
 		/* All categories but "general" or "globals" are considered contexts */
 		if (!strcasecmp(cxt, "general") || !strcasecmp(cxt, "globals"))
 			continue;
-		con=ast_context_find_or_create(&local_contexts,NULL,cxt, registrar);
+		con=ast_context_find_or_create(&local_contexts,NULL,cxt, global_registrar);
 		if (con == NULL)
 			continue;
 
@@ -6004,7 +6004,7 @@
 						lastpri = ipri;
 						if (!ast_opt_dont_warn && !strcmp(realext, "_."))
 							ast_log(LOG_WARNING, "The use of '_.' for an extension is strongly discouraged and can have unexpected behavior.  Please use '_X.' instead at line %d\n", v->lineno);
-						if (ast_add_extension2(con, 0, realext, ipri, label, cidmatch, appl, strdup(data), ast_free, registrar)) {
+						if (ast_add_extension2(con, 0, realext, ipri, label, cidmatch, appl, strdup(data), ast_free, global_registrar)) {
 							ast_log(LOG_WARNING, "Unable to register extension at line %d\n", v->lineno);
 						}
 					}
@@ -6013,12 +6013,12 @@
 			} else if (!strcasecmp(v->name, "include")) {
 				memset(realvalue, 0, sizeof(realvalue));
 				pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
-				if (ast_context_add_include2(con, realvalue, registrar))
+				if (ast_context_add_include2(con, realvalue, global_registrar))
 					ast_log(LOG_WARNING, "Unable to include context '%s' in context '%s'\n", v->value, cxt);
 			} else if (!strcasecmp(v->name, "ignorepat")) {
 				memset(realvalue, 0, sizeof(realvalue));
 				pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
-				if (ast_context_add_ignorepat2(con, realvalue, registrar))
+				if (ast_context_add_ignorepat2(con, realvalue, global_registrar))
 					ast_log(LOG_WARNING, "Unable to include ignorepat '%s' in context '%s'\n", v->value, cxt);
 			} else if (!strcasecmp(v->name, "switch") || !strcasecmp(v->name, "lswitch") || !strcasecmp(v->name, "eswitch")) {
 				char *stringp= realvalue;
@@ -6033,7 +6033,7 @@
 				data = strsep(&stringp, ""); /* XXX what for ? */
 				if (!data)
 					data = "";
-				if (ast_context_add_switch2(con, appl, data, !strcasecmp(v->name, "eswitch"), registrar))
+				if (ast_context_add_switch2(con, appl, data, !strcasecmp(v->name, "eswitch"), global_registrar))
 					ast_log(LOG_WARNING, "Unable to include switch '%s' in context '%s'\n", v->value, cxt);
 			} else {
 				ast_log(LOG_WARNING, "==!!== Unknown directive: %s at line %d -- IGNORING!!!\n", v->name, v->lineno);
@@ -6108,7 +6108,7 @@
 void localized_context_destroy(struct ast_context *con, const char *registrar)
 {
 	ast_wrlock_contexts();
-	__ast_context_destroy(con,registrar);
+	__ast_context_destroy(con,global_registrar);
 	ast_unlock_contexts();
 }
 
@@ -6193,12 +6193,12 @@
 {
 	struct ast_context *con;
 
-	if(!pbx_load_config(config))
+	if(!pbx_load_config(config_filename))
 		return -1 /* AST_MODULE_LOAD_DECLINE*/;
 
 	/* pbx_load_users(); */ /* does this affect the dialplan? */
 
-	ast_merge_contexts_and_delete(&local_contexts, registrar);
+	ast_merge_contexts_and_delete(&local_contexts, global_registrar);
 
 	for (con = NULL; (con = ast_walk_contexts(con));)
 		ast_context_verify_includes(con);

Modified: team/seanbright/resolve-shadow-warnings/utils/frame.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/utils/frame.c?view=diff&rev=114291&r1=114290&r2=114291
==============================================================================
--- team/seanbright/resolve-shadow-warnings/utils/frame.c (original)
+++ team/seanbright/resolve-shadow-warnings/utils/frame.c Fri Apr 18 18:14:12 2008
@@ -1008,7 +1008,7 @@
   return 6.0 * log( value / 32767) / log( 2);
 }
 
-void readawaysamples( FILE *in, size_t size)
+void readawaysamples( FILE *input, size_t size)
 {
   short *buffer;
   int samplesread, count;
@@ -1023,8 +1023,8 @@
       else
 	count = size;
 
-      samplesread = fread( buffer, sizeof(*buffer), count, in);
-      if (ferror( in) != 0)
+      samplesread = fread( buffer, sizeof(*buffer), count, input);
+      if (ferror( input) != 0)
 	fatalperror("Error reading input file");
       size -= samplesread;
     }

Modified: team/seanbright/resolve-shadow-warnings/utils/muted.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/utils/muted.c?view=diff&rev=114291&r1=114290&r2=114291
==============================================================================
--- team/seanbright/resolve-shadow-warnings/utils/muted.c (original)
+++ team/seanbright/resolve-shadow-warnings/utils/muted.c Fri Apr 18 18:14:12 2008
@@ -410,19 +410,19 @@
 #endif
 
 #ifndef __Darwin__
-static int mutedlevel(int orig, int mutelevel)
+static int mutedlevel(int orig, int level)
 {
 	int l = orig >> 8;
 	int r = orig & 0xff;
-	l = (float)(mutelevel) * (float)(l) / 100.0;
-	r = (float)(mutelevel) * (float)(r) / 100.0;
+	l = (float)(level) * (float)(l) / 100.0;
+	r = (float)(level) * (float)(r) / 100.0;
 
 	return (l << 8) | r;
 #else
-static float mutedlevel(float orig, float mutelevel)
+static float mutedlevel(float orig, float level)
 {
 	float master = orig;
-	master = mutelevel * master / 100.0;
+	master = level * master / 100.0;
 	return master;
 #endif
 	

Modified: team/seanbright/resolve-shadow-warnings/utils/smsq.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/utils/smsq.c?view=diff&rev=114291&r1=114290&r2=114291
==============================================================================
--- team/seanbright/resolve-shadow-warnings/utils/smsq.c (original)
+++ team/seanbright/resolve-shadow-warnings/utils/smsq.c Fri Apr 18 18:14:12 2008
@@ -321,83 +321,83 @@
          fclose (f);
          /* set up user data variables */
          {
-            char temp[481];
+            char tmp[481];
             int n,
-              p;
-            for (n = 0, p = 0; p < udl; p++)
+              x;
+            for (n = 0, x = 0; x < udl; x++)
             {
-               unsigned short v = ud[p];
+               unsigned short v = ud[x];
                if (v)
                {
                   if (v < 0x80)
-                     temp[n++] = v;
+                     tmp[n++] = v;
                   else if (v < 0x800)
                   {
-                     temp[n++] = (0xC0 + (v >> 6));
-                     temp[n++] = (0x80 + (v & 0x3F));
+                     tmp[n++] = (0xC0 + (v >> 6));
+                     tmp[n++] = (0x80 + (v & 0x3F));
                   } else
                   {
-                     temp[n++] = (0xE0 + (v >> 12));
-                     temp[n++] = (0x80 + ((v >> 6) & 0x3F));
-                     temp[n++] = (0x80 + (v & 0x3F));
+                     tmp[n++] = (0xE0 + (v >> 12));
+                     tmp[n++] = (0x80 + ((v >> 6) & 0x3F));
+                     tmp[n++] = (0x80 + (v & 0x3F));
                   }
                }
             }
-            temp[n] = 0;
-            setenv ("ud", temp, 1);
-            for (n = 0, p = 0; p < udl; p++)
+            tmp[n] = 0;
+            setenv ("ud", tmp, 1);
+            for (n = 0, x = 0; x < udl; x++)
             {
-               unsigned short v = ud[p];
+               unsigned short v = ud[x];
                if (v < ' ' || v == '\\')
                {
-                  temp[n++] = '\\';
+                  tmp[n++] = '\\';
                   if (v == '\\')
-                     temp[n++] = '\\';
+                     tmp[n++] = '\\';
                   else if (v == '\n')
-                     temp[n++] = 'n';
+                     tmp[n++] = 'n';
                   else if (v == '\r')
-                     temp[n++] = 'r';
+                     tmp[n++] = 'r';
                   else if (v == '\t')
-                     temp[n++] = 't';
+                     tmp[n++] = 't';
                   else if (v == '\f')
-                     temp[n++] = 'f';
+                     tmp[n++] = 'f';
                   else
                   {
-                     temp[n++] = '0' + (v >> 6);
-                     temp[n++] = '0' + ((v >> 3) & 7);
-                     temp[n++] = '0' + (v & 7);
+                     tmp[n++] = '0' + (v >> 6);
+                     tmp[n++] = '0' + ((v >> 3) & 7);
+                     tmp[n++] = '0' + (v & 7);
                   }
                } else if (v < 0x80)
-                  temp[n++] = v;
+                  tmp[n++] = v;
                else if (v < 0x800)
                {
-                  temp[n++] = (0xC0 + (v >> 6));
-                  temp[n++] = (0x80 + (v & 0x3F));
+                  tmp[n++] = (0xC0 + (v >> 6));
+                  tmp[n++] = (0x80 + (v & 0x3F));
                } else
                {
-                  temp[n++] = (0xE0 + (v >> 12));
-                  temp[n++] = (0x80 + ((v >> 6) & 0x3F));
-                  temp[n++] = (0x80 + (v & 0x3F));
+                  tmp[n++] = (0xE0 + (v >> 12));
+                  tmp[n++] = (0x80 + ((v >> 6) & 0x3F));
+                  tmp[n++] = (0x80 + (v & 0x3F));
                }
             }
-            temp[n] = 0;
-            setenv ("ude", temp, 1);
-            for (p = 0; p < udl && ud[p] < 0x100; p++);
-            if (p == udl)
+            tmp[n] = 0;
+            setenv ("ude", tmp, 1);
+            for (x = 0; x < udl && ud[x] < 0x100; x++);
+            if (x == udl)
             {
-               for (n = 0, p = 0; p < udl; p++)
+               for (n = 0, x = 0; x < udl; x++)
                {
-                  sprintf (temp + n, "%02X", ud[p]);
+                  sprintf (tmp + n, "%02X", ud[x]);
                   n += 2;
                }
-               setenv ("ud8", temp, 1);
+               setenv ("ud8", tmp, 1);
             }
-            for (n = 0, p = 0; p < udl; p++)
+            for (n = 0, x = 0; x < udl; x++)
             {
-               sprintf (temp + n, "%04X", ud[p]);
+               sprintf (tmp + n, "%04X", ud[x]);
                n += 4;
             }
-            setenv ("ud16", temp, 1);
+            setenv ("ud16", tmp, 1);
          }
          /* run the command */
          system (process);




More information about the asterisk-commits mailing list