From owner-cvs-src@FreeBSD.ORG Wed Apr 21 16:24:45 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 680) id 15A0316A4CF; Wed, 21 Apr 2004 16:24:45 -0700 (PDT) Date: Wed, 21 Apr 2004 16:24:45 -0700 From: Darren Reed To: Luigi Rizzo Message-ID: <20040421232445.GB60368@hub.freebsd.org> References: <200404211527.i3LFRabS088245@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200404211527.i3LFRabS088245@repoman.freebsd.org> User-Agent: Mutt/1.4.1i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/net radix.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 23:24:45 -0000 Some of these changes, for the sake of change, can be annoying when you grab code from one BSD, start analysing it and then go looking at others to see if they behave the same, etc. I suppose what I'm saying here is that the more arbitrary divergence in the code base here, the greater the difficulty in analysing the code at some point in the future to see if it is is bug compatible with others. A different example is that changes of this nature might make the casual reader pickup a copy of Stevens and think the code is different, just by virtue of the names being different, when in fact it isn't. Darren On Wed, Apr 21, 2004 at 08:27:36AM -0700, Luigi Rizzo wrote: > luigi 2004/04/21 08:27:36 PDT > > FreeBSD src repository > > Modified files: > sys/net radix.c > Log: > Readability fixes: > > Clearly comment the assumptions on the structure of keys (addresses) > and masks, and introduce a macro, LEN(p), to extract the size of these > objects instead of using *(u_char *)p which might be confusing. > > Comment the confusion in the types used to pass around pointers > to keys and masks, as a reminder to fix that at some point. > > Add a few comments on what some functions do. > > Comment a probably inefficient (but still correct) section of code > in rn_walktree_from() > > The object code generated after this commit is the same as before. > > At some point we should also change same variable identifiers such > as "t, tt, ttt" to fancier names such as "root, left, right" (just > in case someone wants to understand the code!), replace misspelling > of NULL as 0, remove 'register' declarations that make little sense > these days. > > Revision Changes Path > 1.36 +76 -12 src/sys/net/radix.c