cldcli: suppress warnings from -Wshadow
PATCH 2/3 cldcli: suppress warnings from -Wshadow
Signed-off-by Pete Zaitcev <[email protected]>
tools/cldcli.c +3 -3
@@ -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" ); }
Quoted 11 lines · Pete Zaitcev
Signed-off-by Pete Zaitcev <[email protected]>tools/cldcli.c +0
-1@@ -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
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