ANSI-fy of ranlib, ruptime and rdist [patches]

Douwe Kiela virtus at wanadoo.nl
Fri Jul 23 20:41:40 PDT 2004


"Douwe Kiela" <virtus at xxxxxxxxxx> schreef in bericht
news:001901c47124$787fa890$0300a8c0 at xxxxxxxxxxx
>
> "Eirik Nygaard" <eirikn at xxxxxxxxxxxx> schreef in bericht
> news:20040723223609.GA81742 at xxxxxxxxxxxxx
> > On Fri, Jul 23, 2004 at 03:11:59PM -0700, Matthew Dillon wrote:
> > >     Ok, I've talked a bit with Douwe Kiela and he seems quite
interested
> > >     in doing ANSIfication/cleanup work, starting with the patches he
> > >     posted before (included below).
> > >
> > >     Since this is potentially going to be a non-trivial volume of
> patches
> > >     it would be nice if one or two of our committers could head up the
> > >     responsibility for reviewing, adjusting, and committing the work,
> with
> > >     the rest of the committers helping out if they happen to have the
> time.
> > >     Douwe is going to posting the URL references to submit@ as he
goes.
> >
> > I can do this, still have a few weeks left of my holiday so I should
have
> time
> > for it. Just wait for the commit spree :)
> Alright, cool.. Just a few questions before I get started:
>
> * I will maintain style(9), but as has been stated previously, this is
> outdated,
> concerning style.. do I have to maintain **argv or *argv[]? do I have to
> maintain
> the newline when no function-specific variables are declared within the
> function
> after the starting accolade? do I have to remove globals where I can? do I
> have to
> put all the #define's on top, or in the code (where they sometimes are
right
> now)?
> * Do I have to send my patches to submit@ or directly to eirik, without
> bothering
> the rest?
> * Do I also have to submit style changes for contrib/ and stuff? Or just
the
> userland
> tree belonging directly to DragonFlyBSD? (In NetBSD spelling/style fixes
are
> sometimes
> also committed to contrib/)

Oh, more questions...

* In some cases I find that *rintf() function calls are preceeded by a
(void) cast,
e.g. (void) printf("blah"); do we want this all over the code, or don't we w
ant this
all over the code? In my opinion consistency is a key factor, so we should
either
maintain this method everywhere, or nowhere.. Opinions about this?
* The correct method in error return values is the usage of EXIT_FAILURE and
EXIT_SUCCESS declared in stdlib.h respectively as 1 and 0. Do we want to use
the defines or the actual values? The EXIT_* looks more clean to me, but it
requires
a lot of changes, and takes up more diskspace ;-). In this case consistency
is also the
key, so do we we EXIT_* or just 1 and 0? Everywhere or nowhere.. :-)
* Concerning error checking, what should be used, the return value of a
function checked
within a condition, or the condition that checks the return value
seperately, i.e.
if ((buf = malloc(bsize)) == NULL)
          err(1, "buffer");
versus
buf = malloc(bsize);
if (buf == NULL)
          err(1, "buffer");
Any opinions on this? Or just let it be the way it is?
* Concerning the initialisation of function-scoped variables, which one is
the correct..
to assign values to variables in their declaration, e.g. int var = 0; or
seperately, e.g.
int var;
var = 0;
This is being mixed all over the code, which one is the correct?

That's all for now, I think ;-)

Greetings,
Douwe






More information about the Submit mailing list