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

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


Author: seanbright
Date: Sat Apr 19 13:51:17 2008
New Revision: 114308

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114308
Log:
pbx/

Modified:
    team/seanbright/resolve-shadow-warnings/pbx/dundi-parser.c
    team/seanbright/resolve-shadow-warnings/pbx/pbx_config.c
    team/seanbright/resolve-shadow-warnings/pbx/pbx_dundi.c

Modified: team/seanbright/resolve-shadow-warnings/pbx/dundi-parser.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/pbx/dundi-parser.c?view=diff&rev=114308&r1=114307&r2=114308
==============================================================================
--- team/seanbright/resolve-shadow-warnings/pbx/dundi-parser.c (original)
+++ team/seanbright/resolve-shadow-warnings/pbx/dundi-parser.c Sat Apr 19 13:51:17 2008
@@ -373,7 +373,7 @@
 	int ie;
 	char *name;
 	void (*dump)(char *output, int maxlen, void *value, int len);
-} ies[] = {
+} infoelts[] = {
 	{ DUNDI_IE_EID, "ENTITY IDENT", dump_eid },
 	{ DUNDI_IE_CALLED_CONTEXT, "CALLED CONTEXT", dump_string },
 	{ DUNDI_IE_CALLED_NUMBER, "CALLED NUMBER", dump_string },
@@ -404,9 +404,9 @@
 const char *dundi_ie2str(int ie)
 {
 	int x;
-	for (x=0;x<(int)sizeof(ies) / (int)sizeof(ies[0]); x++) {
-		if (ies[x].ie == ie)
-			return ies[x].name;
+	for (x = 0; x < ARRAY_LEN(infoelts); x++) {
+		if (infoelts[x].ie == ie)
+			return infoelts[x].name;
 	}
 	return "Unknown IE";
 }
@@ -433,18 +433,18 @@
 			return;
 		}
 		found = 0;
-		for (x=0;x<(int)sizeof(ies) / (int)sizeof(ies[0]); x++) {
-			if (ies[x].ie == ie) {
-				if (ies[x].dump) {
-					ies[x].dump(interp, (int)sizeof(interp), iedata + 2, ielen);
-					snprintf(tmp, (int)sizeof(tmp), "   %s%-15.15s : %s\n", (spaces ? "     " : "" ), ies[x].name, interp);
+		for (x = 0; x < ARRAY_LEN(infoelts); x++) {
+			if (infoelts[x].ie == ie) {
+				if (infoelts[x].dump) {
+					infoelts[x].dump(interp, (int)sizeof(interp), iedata + 2, ielen);
+					snprintf(tmp, (int)sizeof(tmp), "   %s%-15.15s : %s\n", (spaces ? "     " : "" ), infoelts[x].name, interp);
 					outputf(tmp);
 				} else {
 					if (ielen)
 						snprintf(interp, (int)sizeof(interp), "%d bytes", ielen);
 					else
 						strcpy(interp, "Present");
-					snprintf(tmp, (int)sizeof(tmp), "   %s%-15.15s : %s\n", (spaces ? "     " : "" ), ies[x].name, interp);
+					snprintf(tmp, (int)sizeof(tmp), "   %s%-15.15s : %s\n", (spaces ? "     " : "" ), infoelts[x].name, interp);
 					outputf(tmp);
 				}
 				found++;

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=114308&r1=114307&r2=114308
==============================================================================
--- team/seanbright/resolve-shadow-warnings/pbx/pbx_config.c (original)
+++ team/seanbright/resolve-shadow-warnings/pbx/pbx_config.c Sat Apr 19 13:51:17 2008
@@ -623,7 +623,7 @@
 	} 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 *c;
+		struct ast_context *ctx;
 		const char *s = skip_words(a->line, 3); /* should not fail */
 
 		if (a->n != 0)	/* only once */
@@ -643,8 +643,8 @@
 			/* our fault, we can't check, so complete 'into' ... */
 			ret = strdup("into");
 		} else {
-			for (c = NULL; !ret && (c = ast_walk_contexts(c)); )
-				if (!strcmp(context, ast_get_context_name(c)))
+			for (ctx = NULL; !ret && (ctx = ast_walk_contexts(ctx)); )
+				if (!strcmp(context, ast_get_context_name(ctx)))
 					ret = strdup("into"); /* found */
 			ast_unlock_contexts();
 		}
@@ -814,7 +814,7 @@
 	/* walk all contexts */
 	for (c = NULL; (c = ast_walk_contexts(c)); ) {
 		int context_header_written = 0;
-		struct ast_exten *e, *last_written_e = NULL;
+		struct ast_exten *ext, *last_written_e = NULL;
 		struct ast_include *i;
 		struct ast_ignorepat *ip;
 		struct ast_sw *sw;
@@ -832,11 +832,11 @@
 		}
 
 		/* walk extensions ... */
-		for (e = NULL; (e = ast_walk_context_extensions(c, e)); ) {
+		for (ext = NULL; (ext = ast_walk_context_extensions(c, ext)); ) {
 			struct ast_exten *p = NULL;
 
 			/* fireout priorities */
-			while ( (p = ast_walk_extension_priorities(e, p)) ) {
+			while ( (p = ast_walk_extension_priorities(ext, p)) ) {
 				if (strcmp(ast_get_extension_registrar(p), registrar) != 0) /* not this source */
 					continue;
 		

Modified: team/seanbright/resolve-shadow-warnings/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/resolve-shadow-warnings/pbx/pbx_dundi.c?view=diff&rev=114308&r1=114307&r2=114308
==============================================================================
--- team/seanbright/resolve-shadow-warnings/pbx/pbx_dundi.c (original)
+++ team/seanbright/resolve-shadow-warnings/pbx/pbx_dundi.c Sat Apr 19 13:51:17 2008
@@ -1183,7 +1183,7 @@
 	return 0;
 }
 
-static int cache_lookup(struct dundi_request *req, dundi_eid *peer_eid, unsigned long crc32, int *lowexpiration)
+static int cache_lookup(struct dundi_request *req, dundi_eid *peer_eid, unsigned long checksum, int *lowexpiration)
 {
 	char key[256];
 	char eid_str[20];
@@ -1199,7 +1199,7 @@
 	dundi_eid_to_str_short(eid_str, sizeof(eid_str), peer_eid);
 	dundi_eid_to_str_short(eidroot_str, sizeof(eidroot_str), &req->root_eid);
 	dundi_eid_to_str(eid_str_full, sizeof(eid_str_full), peer_eid);
-	snprintf(key, sizeof(key), "%s/%s/%s/e%08lx", eid_str, req->number, req->dcontext, crc32);
+	snprintf(key, sizeof(key), "%s/%s/%s/e%08lx", eid_str, req->number, req->dcontext, checksum);
 	res |= cache_lookup_internal(now, req, key, eid_str_full, lowexpiration);
 	snprintf(key, sizeof(key), "%s/%s/%s/e%08lx", eid_str, req->number, req->dcontext, 0L);
 	res |= cache_lookup_internal(now, req, key, eid_str_full, lowexpiration);
@@ -1214,7 +1214,7 @@
 				break;
 			x++;
 			/* Check for hints */
-			snprintf(key, sizeof(key), "hint/%s/%s/%s/e%08lx", eid_str, tmp, req->dcontext, crc32);
+			snprintf(key, sizeof(key), "hint/%s/%s/%s/e%08lx", eid_str, tmp, req->dcontext, checksum);
 			res2 |= cache_lookup_internal(now, req, key, eid_str_full, lowexpiration);
 			snprintf(key, sizeof(key), "hint/%s/%s/%s/e%08lx", eid_str, tmp, req->dcontext, 0L);
 			res2 |= cache_lookup_internal(now, req, key, eid_str_full, lowexpiration);
@@ -4661,11 +4661,11 @@
 			} else if(sin->sin_port != last_port)
 				ast_log(LOG_WARNING, "change to port ignored until next asterisk re-start\n");
 		} else if (!strcasecmp(v->name, "bindaddr")) {
-			struct hostent *hp;
-			struct ast_hostent he;
-			hp = ast_gethostbyname(v->value, &he);
-			if (hp) {
-				memcpy(&sin->sin_addr, hp->h_addr, sizeof(sin->sin_addr));
+			struct hostent *hep;
+			struct ast_hostent hent;
+			hep = ast_gethostbyname(v->value, &hent);
+			if (hep) {
+				memcpy(&sin->sin_addr, hep->h_addr, sizeof(sin->sin_addr));
 			} else
 				ast_log(LOG_WARNING, "Invalid host/IP '%s'\n", v->value);
 		} else if (!strcasecmp(v->name, "authdebug")) {




More information about the asterisk-commits mailing list