From bea45b3c30b50b1e36d49108813cc5cdfc8270a7 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Mon, 4 Jun 2012 00:59:24 +0200 Subject: [PATCH] cleared IDE warnings --- src/netif/ppp/auth.c | 1 + src/netif/ppp/fsm.c | 7 ++++ src/netif/ppp/lcp.c | 2 +- src/netif/ppp/options.c | 6 --- src/netif/ppp/ppp.c | 10 ++++- src/netif/ppp/utils.c | 81 ++--------------------------------------- src/netif/ppp/vj.c | 4 +- 7 files changed, 23 insertions(+), 88 deletions(-) diff --git a/src/netif/ppp/auth.c b/src/netif/ppp/auth.c index a51007f2..3529b392 100644 --- a/src/netif/ppp/auth.c +++ b/src/netif/ppp/auth.c @@ -1174,6 +1174,7 @@ auth_withpeer_success(unit, protocol, prot_flavor) default: warn("auth_withpeer_success: unknown protocol %x", protocol); bit = 0; + /* no break */ } notice("%s authentication succeeded", prot); diff --git a/src/netif/ppp/fsm.c b/src/netif/ppp/fsm.c index 3edf8b2b..57b366b2 100644 --- a/src/netif/ppp/fsm.c +++ b/src/netif/ppp/fsm.c @@ -117,6 +117,7 @@ fsm_lowerup(f) default: FSMDEBUG(("%s: Up event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -162,6 +163,7 @@ fsm_lowerdown(f) default: FSMDEBUG(("%s: Down event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -193,6 +195,7 @@ fsm_open(f) case CLOSING: f->state = STOPPING; /* fall through */ + /* no break */ case STOPPED: case OPENED: if( f->flags & OPT_RESTART ){ @@ -325,6 +328,7 @@ fsm_timeout(arg) default: FSMDEBUG(("%s: Timeout event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } @@ -711,6 +715,7 @@ fsm_protreject(f) case CLOSING: UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ /* fall through */ + /* no break */ case CLOSED: f->state = CLOSED; if( f->callbacks->finished ) @@ -723,6 +728,7 @@ fsm_protreject(f) case ACKSENT: UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ /* fall through */ + /* no break */ case STOPPED: f->state = STOPPED; if( f->callbacks->finished ) @@ -736,6 +742,7 @@ fsm_protreject(f) default: FSMDEBUG(("%s: Protocol-reject event in state %d!", PROTO_NAME(f), f->state)); + /* no break */ } } diff --git a/src/netif/ppp/lcp.c b/src/netif/ppp/lcp.c index 8613559a..533b0824 100644 --- a/src/netif/ppp/lcp.c +++ b/src/netif/ppp/lcp.c @@ -467,7 +467,7 @@ lcp_close(unit, reason) oldstate = f->state; fsm_close(f, reason); - if (oldstate == STOPPED && f->flags & (OPT_PASSIVE|OPT_SILENT|DELAYED_UP)) { + if (oldstate == STOPPED && (f->flags & (OPT_PASSIVE|OPT_SILENT|DELAYED_UP))) { /* * This action is not strictly according to the FSM in RFC1548, * but it does mean that the program terminates if you do a diff --git a/src/netif/ppp/options.c b/src/netif/ppp/options.c index 1c39c6a7..0cbe1de7 100644 --- a/src/netif/ppp/options.c +++ b/src/netif/ppp/options.c @@ -1089,13 +1089,7 @@ option_error (char *fmt, ...) va_list args; char buf[1024]; -#if defined(__STDC__) va_start(args, fmt); -#else - char *fmt; - va_start(args); - fmt = va_arg(args, char *); -#endif vslprintf(buf, sizeof(buf), fmt, args); va_end(args); if (phase == PHASE_INITIALIZE) diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index 3be7ec47..994ae4d2 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -1712,18 +1712,22 @@ pppos_input_proc(ppp_control_rx *pcrx, u_char *s, int l) if (cur_char != PPP_ALLSTATIONS) { break; } + /* no break */ + /* Fall through */ - /* Fall through */ case PDSTART: /* Process start flag. */ /* Prepare for a new packet. */ pcrx->in_fcs = PPP_INITFCS; + /* no break */ + /* Fall through */ - /* Fall through */ case PDADDRESS: /* Process address field. */ if (cur_char == PPP_ALLSTATIONS) { pcrx->in_state = PDCONTROL; break; } + /* no break */ + /* Else assume compressed address and control fields so * fall through to get the protocol... */ case PDCONTROL: /* Process control field. */ @@ -1732,6 +1736,8 @@ pppos_input_proc(ppp_control_rx *pcrx, u_char *s, int l) pcrx->in_state = PDPROTOCOL1; break; } + /* no break */ + #if 0 else { PPPDEBUG(LOG_WARNING, diff --git a/src/netif/ppp/utils.c b/src/netif/ppp/utils.c index b2e2a8a3..b7cf10cc 100644 --- a/src/netif/ppp/utils.c +++ b/src/netif/ppp/utils.c @@ -135,17 +135,7 @@ slprintf (char *buf, int buflen, char *fmt, ...) va_list args; int n; -#if defined(__STDC__) va_start(args, fmt); -#else - char *buf; - int buflen; - char *fmt; - va_start(args); - buf = va_arg(args, char *); - buflen = va_arg(args, int); - fmt = va_arg(args, char *); -#endif n = vslprintf(buf, buflen, fmt, args); va_end(args); return n; @@ -287,9 +277,11 @@ vslprintf(buf, buflen, fmt, args) num[1] = 0; str = num; break; +#if 0 /* do we always have strerror() in embedded ? */ case 'm': str = strerror(errno); break; +#endif /* do we always have strerror() in embedded ? */ case 'I': ip = va_arg(args, u_int32_t); ip = ntohl(ip); @@ -446,16 +438,7 @@ vslp_printer (void *arg, char *fmt, ...) va_list pvar; struct buffer_info *bi; -#if defined(__STDC__) va_start(pvar, fmt); -#else - void *arg; - char *fmt; - va_start(pvar); - arg = va_arg(pvar, void *); - fmt = va_arg(pvar, char *); -#endif - bi = (struct buffer_info *) arg; n = vslprintf(bi->ptr, bi->len, fmt, pvar); va_end(pvar); @@ -576,16 +559,7 @@ pr_log (void *arg, char *fmt, ...) char *p, *eol; char buf[256]; -#if defined(__STDC__) va_start(pvar, fmt); -#else - void *arg; - char *fmt; - va_start(pvar); - arg = va_arg(pvar, void *); - fmt = va_arg(pvar, char *); -#endif - n = vslprintf(buf, sizeof(buf), fmt, pvar); va_end(pvar); @@ -627,13 +601,7 @@ pr_log (void *arg, char *fmt, ...) * print_string - print a readable representation of a string using * printer. */ -void -print_string(p, len, printer, arg) - char *p; - int len; - void (*printer) (void *, char *, ...); - void *arg; -{ +void print_string(char *p, int len, void (*printer) (void *, char *, ...), void arg) { int c; printer(arg, "\""); @@ -656,6 +624,7 @@ print_string(p, len, printer, arg) break; default: printer(arg, "\\%.3o", c); + /* no break */ } } } @@ -706,14 +675,7 @@ fatal (char *fmt, ...) { va_list pvar; -#if defined(__STDC__) va_start(pvar, fmt); -#else - char *fmt; - va_start(pvar); - fmt = va_arg(pvar, char *); -#endif - logit(LOG_ERR, fmt, pvar); va_end(pvar); @@ -731,14 +693,7 @@ error (char *fmt, ...) { va_list pvar; -#if defined(__STDC__) va_start(pvar, fmt); -#else - char *fmt; - va_start(pvar); - fmt = va_arg(pvar, char *); -#endif - logit(LOG_ERR, fmt, pvar); va_end(pvar); ++error_count; @@ -752,14 +707,7 @@ warn (char *fmt, ...) { va_list pvar; -#if defined(__STDC__) va_start(pvar, fmt); -#else - char *fmt; - va_start(pvar); - fmt = va_arg(pvar, char *); -#endif - logit(LOG_WARNING, fmt, pvar); va_end(pvar); } @@ -772,14 +720,7 @@ notice (char *fmt, ...) { va_list pvar; -#if defined(__STDC__) va_start(pvar, fmt); -#else - char *fmt; - va_start(pvar); - fmt = va_arg(pvar, char *); -#endif - logit(LOG_NOTICE, fmt, pvar); va_end(pvar); } @@ -792,14 +733,7 @@ info (char *fmt, ...) { va_list pvar; -#if defined(__STDC__) va_start(pvar, fmt); -#else - char *fmt; - va_start(pvar); - fmt = va_arg(pvar, char *); -#endif - logit(LOG_INFO, fmt, pvar); va_end(pvar); } @@ -812,14 +746,7 @@ dbglog (char *fmt, ...) { va_list pvar; -#if defined(__STDC__) va_start(pvar, fmt); -#else - char *fmt; - va_start(pvar); - fmt = va_arg(pvar, char *); -#endif - logit(LOG_DEBUG, fmt, pvar); va_end(pvar); } diff --git a/src/netif/ppp/vj.c b/src/netif/ppp/vj.c index 0fed7aab..79752512 100644 --- a/src/netif/ppp/vj.c +++ b/src/netif/ppp/vj.c @@ -316,8 +316,8 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf *pb) ntohs(IPH_LEN(&cs->cs_ip)) == hlen) { break; } - - /* (fall through) */ + /* no break */ + /* fall through */ case SPECIAL_I: case SPECIAL_D: