Skip to contentSkip to conversation

cldcli: suppress warnings from -Wshadow

PATCH Applied Pete Zaitcev 2 participants 3 messages Aug 4, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 cldcli: suppress warnings from -Wshadow

tools/cldcli.c +3 -3
index bb5c4cc..90ae601 100644
@@ -437,12 +437,12 @@ static bool cld_p_timer_ctl(void *private, bool add,
 static int cld_p_pkt_send(void *priv, const void *addr, size_t addrlen,
 			       const void *buf, size_t buflen)
 {
-	struct cldc_udp *udp = priv;
-	return cldc_udp_pkt_send(udp, addr, addrlen, buf, buflen);
+	struct cldc_udp *udpp = priv;
+	return cldc_udp_pkt_send(udpp, addr, addrlen, buf, buflen);
 }
 
 static void cld_p_event(void *private, struct cldc_session *sess,
-			struct cldc_fh *fh, uint32_t what)
+			struct cldc_fh *fhp, uint32_t what)
 {
 	fprintf(stderr, "FIXME: event\n");
 }
#1 lore raw
Quoted 11 lines · Pete Zaitcev
tools/cldcli.c +0 -1
index bb5c4cc..90ae601 100644
@@ -437,12 +437,12 @@ static bool cld_p_timer_ctl(void *private, bool add,
 static int cld_p_pkt_send(void *priv, const void *addr, size_t addrlen,
 			       const void *buf, size_t buflen)
 {
-	struct cldc_udp *udp = priv;

tools/cldcli.c static bool cld_p_timer_ctl(void *private, bool add, · line 447

Quoted 10 lines
tools/cldcli.c +3 -2
-	return cldc_udp_pkt_send(udp, addr, addrlen, buf, buflen);
+	struct cldc_udp *udpp = priv;
+	return cldc_udp_pkt_send(udpp, addr, addrlen, buf, buflen);
 }
 
 static void cld_p_event(void *private, struct cldc_session *sess,
-			struct cldc_fh *fh, uint32_t what)
+			struct cldc_fh *fhp, uint32_t what)
 {
 	fprintf(stderr, "FIXME: event\n");

I think the root cause is poorly named globals, so instead of applying this patch, I added a "thr_" prefix to the globals 'fh' and 'udp'.

I also fixed the other -Wshadow warnings as well, even though they were largely harmless (variable name matched a system function name).

Jeff

#2 lore raw
Quoted 5 lines · Jeff Garzik

I think the root cause is poorly named globals, so instead of applying this patch, I added a "thr_" prefix to the globals 'fh' and 'udp'.

I also fixed the other -Wshadow warnings as well, even though they were largely harmless (variable name matched a system function name).

By all means, thanks.

-- Pete