From 82bac13560d095243e9988bfb770da73089749c1 Mon Sep 17 00:00:00 2001 From: brian Date: Sat, 10 May 1997 01:22:19 +0000 Subject: Tidy up the code - bounds checking, return value checking etc. Submitted by: eivind --- usr.sbin/ppp/pred.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'usr.sbin/ppp/pred.c') diff --git a/usr.sbin/ppp/pred.c b/usr.sbin/ppp/pred.c index 587f8bf..e9b76a2 100644 --- a/usr.sbin/ppp/pred.c +++ b/usr.sbin/ppp/pred.c @@ -5,7 +5,7 @@ /* * - * $Id$ + * $Id: pred.c,v 1.9 1997/02/22 16:10:47 peter Exp $ * * pred.c -- Test program for Dave Rand's rendition of the * predictor algorithm @@ -20,8 +20,8 @@ * A better hash function would result in additional compression, * at the expense of time. */ -#define IHASH(x) iHash = (iHash << 4) ^ (x) -#define OHASH(x) oHash = (oHash << 4) ^ (x) +#define IHASH(x) do {iHash = (iHash << 4) ^ (x);} while(0) +#define OHASH(x) do {oHash = (oHash << 4) ^ (x);} while(0) static unsigned short int iHash, oHash; static unsigned char InputGuessTable[65536]; @@ -111,10 +111,7 @@ int direction; } void -Pred1Output(pri, proto, bp) -int pri; -u_short proto; -struct mbuf *bp; +Pred1Output(int pri, u_short proto, struct mbuf *bp) { struct mbuf *mwp; u_char *cp, *wp, *hp; -- cgit v1.1