Date: Thu, 12 Oct 2000 22:50:54 -0400 From: "Brian F. Feldman" <green@FreeBSD.org> To: Robert Watson <rwatson@FreeBSD.org> Cc: freebsd-audit@FreeBSD.org Subject: Re: Audit request: capability text format handling Message-ID: <200010130250.e9D2ot578378@green.dyndns.org> In-Reply-To: Message from Robert Watson <rwatson@FreeBSD.org> of "Thu, 12 Oct 2000 13:29:44 EDT." <Pine.NEB.3.96L.1001012132807.44391I-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Robert Watson <rwatson@FreeBSD.org> wrote: > > I'm about to start committing updates to the libposix1e capability > support, and this will include addition of two new routines: > cap_from_text() and cap_to_text(). While I'm relatively confident about > most of my C code, string parsing and generation code is always worthy of > another set of eyes. If someone wants to peruse it and give me a nice > green check (or a nasty red X), it's at: > > http://www.watson.org/~robert/cap_text.c > > I didn't come up with the text format, I just parse it, before anyone asks > :-). I don't see anything at all wrong with it. Seems fine, except for a few fringe issues to make things "nicer"... :) The parsing itself is very straightforward and as such easy to be sure of. Okay, defines are generally evil. In this case, the defines can be const size_t declarations. Also, the const char *'s instead of defines are good, but it makes it less readable (for me, at least) when they're lower-cased. I don't see the purpose of having both large arrays when the information is duplicated. I think cache affinity would be better just using the one array (info) anyway. Also, for the stack-allocated string buffers, it's nicer to use sizeof instead of the magic constant. Hope you don't mind the style critique. Congrats on core =) -- Brian Fundakowski Feldman \ FreeBSD: The Power to Serve! / green@FreeBSD.org `------------------------------' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010130250.e9D2ot578378>