Remove unused code, fix compilation warnings
PATCH 1/6 Remove unused code, fix compilation warnings
Partially taken from ppp-2.4.3-fix.patch in Fedora RPM
pppd/utils.c: Fedora even patches this code in ppp-2.4.1-varargs.patch, even though it is not used
--- pppd/ipv6cp.c | 5 ++++- pppd/utils.c | 13 ------------- pppdump/bsd-comp.c | 8 ++++---- pppdump/deflate.c | 5 +++-- pppdump/pppdump.c | 5 +++-- 5 files changed, 14 insertions(+), 22 deletions(-)
pppd/ipv6cp.c +4 -1
@@ -151,6 +151,7 @@*/ #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <unistd.h> #include <netdb.h>
@@ -1064,7 +1065,9 @@ endswitch:return (rc);/* Return final code */ } - +#if defined(SOL2 ) || defined(__linux__) +int ether_to_eui64 (eui64_t *p_eui64); +#endif /* * ipv6_check_options - check that any IP-related options are OK, * and assign appropriate defaults.
pppd/utils.c +0 -13
@@ -287,19 +287,6 @@ vslprintf(buf, buflen, fmt, args) (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); str = num;break ; -#if 0 /* not used, and breaks on S/390, apparently */ -case 'r' : - f = va_arg(args, char *); -#ifndef __powerpc__ - n =vslprintf (buf, buflen +1 , f,va_arg (args, va_list)); -#else -/* On the powerpc, a va_list is an array of 1 structure */ - n = vslprintf(buf, buflen + 1, f, va_arg(args, void *)); -#endif - buf += n; - buflen -= n; -continue ; -#endif case 't' :time (&t); str =ctime (&t);
pppdump/bsd-comp.c +4 -4
@@ -383,7 +383,7 @@ bsd_init(db, options, opt_len, unit, hdrlen, mru, debug, decomp) || options[0] != CI_BSD_COMPRESS || options[1] != CILEN_BSD_COMPRESS || BSD_VERSION(options[2]) != BSD_CURRENT_VERSION || BSD_NBITS(options[2]) != db->maxbits - || decomp && db->lens = NULL) + || (decomp && db->lens = NULL))return 0 ;if (decomp) {
@@ -556,11 +556,11 @@ bsd_decompress(state, cmsg, inlen, dmp, outlenp)u_int n_bits = db->n_bits;u_int tgtbitno =32 -n_bits;/* bitno when we have a code */ struct bsd_dict *dictp; -int explen, i, seq, len; +int explen, seq, len;u_int incode, oldcode, finchar;u_char *p, *rptr, *wptr;int ilen; -int dlen, space, codelen, extra; +int dlen=0 , codelen, extra; rptr = cmsg;if (*rptr =0 )
@@ -616,7 +616,7 @@ bsd_decompress(state, cmsg, inlen, dmp, outlenp) }if (incode > max_ent +2 || incode > db->maxmaxcode - || incode > max_ent && oldcode =CLEAR ) { + || (incode > max_ent && oldcode =CLEAR )) {if (db->debug) {printf ("bsd_decomp%d: bad code 0x%x oldcode=0x%x " , db->unit, incode, oldcode);
pppdump/deflate.c +3 -2
@@ -39,6 +39,7 @@#include <sys/types.h> #include <stdio.h> #include <stddef.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include "ppp_defs.h"
@@ -237,8 +238,8 @@ z_decompress(arg, mi, inlen, mo, outlenp) {struct deflate_state *state = (struct deflate_state *) arg;u_char *rptr, *wptr; -int rlen, olen, ospace; -int seq, i, flush, r, decode_proto; +int rlen, olen; +int seq, r; rptr = mi;if (*rptr =0 )
pppdump/pppdump.c +3 -2
@@ -34,6 +34,7 @@* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <stdio.h> +#include <stdlib.h> #include <unistd.h> #include <stdlib.h> #include <time.h>
@@ -191,7 +192,7 @@ dumplog(f)show_time (f, c);break ;default : -printf ("?%.2x\n" ); +printf ("?%.2x\n" , c); } } }
@@ -421,7 +422,7 @@ dumpppp(f)show_time (f, c);break ;default : -printf ("?%.2x\n" ); +printf ("?%.2x\n" , c); } } }
Signature · 1 line
1.6.2.5