PPP, fixed some IAR warnings

these are the compiler warnings I get with the head of ppp-new. All
of them are trivial, [...] (I'm using IAR EWARM 6.4).

ppp.c
Warning[Pe550]: variable "c" was set but never used
lwip\src\netif\ppp\ppp.c 1012

Warning[Pe111]: statement is unreachable
lwip\src\netif\ppp\ppp.c 1132

Warning[Pe111]: statement is unreachable
lwip\src\netif\ppp\ppp.c 1377

Warning[Pe111]: statement is unreachable
lwip\src\netif\ppp\ppp.c 1412

utils.c
Warning[Pe186]: pointless comparison of unsigned integer with zero
lwip\src\netif\ppp\utils.c 210
This commit is contained in:
Sylvain Rochet 2012-12-23 22:52:58 +01:00
parent 78d52ad2de
commit 211a889528
2 changed files with 7 additions and 6 deletions

View File

@ -1012,7 +1012,8 @@ pppos_put(ppp_pcb *pcb, struct pbuf *nb)
int c;
for(b = nb; b != NULL; b = b->next) {
if((c = sio_write(pcb->fd, b->payload, b->len)) != b->len) {
c = sio_write(pcb->fd, b->payload, b->len)
if(c != b->len) {
PPPDEBUG(LOG_WARNING,
("PPP pppos_put: incomplete sio_write(fd:%"SZT_F", len:%d, c: 0x%"X8_F") c = %d\n", (size_t)pcb->fd, b->len, c, c));
LINK_STATS_INC(link.err);
@ -1129,7 +1130,9 @@ static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u_short prot
return ppp_netif_output_over_serial(pcb, pb, protocol);
#endif /* PPPOS_SUPPORT */
#if !PPPOS_SUPPORT
return ERR_OK;
#endif
}
#if PPPOS_SUPPORT
@ -1368,10 +1371,6 @@ ppp_ioctl(ppp_pcb *pcb, int cmd, void *arg)
return PPPERR_PARAM;
break;
#endif /* PPPOS_SUPPORT */
default:
return PPPERR_PARAM;
break;
}
return PPPERR_PARAM;
@ -1409,8 +1408,10 @@ int ppp_write(ppp_pcb *pcb, struct pbuf *p) {
return ppp_write_over_serial(pcb, p);
#endif /* PPPOS_SUPPORT */
#if !PPPOS_SUPPORT
pbuf_free(p);
return PPPERR_NONE;
#endif
}
#if PPPOS_SUPPORT

View File

@ -207,7 +207,7 @@ int ppp_vslprintf(char *buf, int buflen, char *fmt, va_list args) {
switch (c) {
case 'd':
val = va_arg(args, long);
if (val < 0) {
if ((long)val < 0) {
neg = 1;
val = -val;
}