Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Mar 2002 11:27:02 +0000
From:      Mark Murray <mark@grondar.za>
To:        obrien@FreeBSD.org
Cc:        Mark Murray <markm@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.bin/rwall rwall.c 
Message-ID:  <200203071127.g27BR2RV009394@grimreaper.grondar.org>
In-Reply-To: <20020307030244.B63484@dragon.nuxi.com> ; from "David O'Brien" <obrien@FreeBSD.org>  "Thu, 07 Mar 2002 03:02:44 PST."
References:  <20020307030244.B63484@dragon.nuxi.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> On Mon, Mar 04, 2002 at 12:27:38PM -0800, Mark Murray wrote:
> > markm       2002/03/04 12:27:38 PST
> > 
> >   Modified files:
> >     usr.bin/rwall        rwall.c 
> >   Log:
> >   ANSIfication, WARNS and lint cleanup.
> 
> -       (void)snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP);
> +       snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP);
> 
> lint(1) does not like our usage of (void)?  Removing it where it already
> exists goes against the examples in style(9).

"Useless cast".

I'm also somewhat tired of (bad?) examples in style.9 getting promoted
to hard-and-fast rules. Style 9 is a _guide_. The examples even more so.

> -       if ((fd = mkstemp(tmpname)) == -1 || !(fp = fdopen(fd, "r+")))
> +       fd = mkstemp(tmpname);
> +       fp = fdopen(fd, "r+");
> +       if (fd == -1 || !fp)
> 
> Why did you need to do such code restructuring?

"Assignment statement in conditional". I also happens to be more readable.

M
-- 
o       Mark Murray
\_
O.\_    Warning: this .sig is umop ap!sdn

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203071127.g27BR2RV009394>