From: Richard Knutsson <ricknu-0@student.ltu.se>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] what's the deal with using real "boolean" variables?
Date: Wed, 10 Jan 2007 11:10:45 +0000 [thread overview]
Message-ID: <45A4C9B5.3030609@student.ltu.se> (raw)
In-Reply-To: <Pine.LNX.4.64.0701100337460.11933@localhost.localdomain>
Bernd Petrovitsch wrote:
> On Wed, 2007-01-10 at 11:17 +0100, Richard Knutsson wrote:
> [...]
>
>> if (foo =TRUE) {
>>
>
> This is IMHO ugly for any definition and implementation of boolean in C.
> Write it as
> if (foo) {
> Otherwise why don't we write
> if ((foo = TRUE) = TRUE) {
> ?
>
> Bernd
>
It sure is! But a quick check:
linux-2.6]$ grep -Er "\=\= *(TRUE|true)" * | wc -l
70
linux-2.6]$ grep -Er "\=\= *(FALSE|false)" * | wc -l
118
suggest it is used (saw a few false-positivs).
This is something that should be mentioned in "CodingStyle", but have
not got there yet. Care to make a draft/patch?
/Richard Knutsson
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
next prev parent reply other threads:[~2007-01-10 11:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-10 8:44 [KJ] what's the deal with using real "boolean" variables? Robert P. J. Day
2007-01-10 9:23 ` Robert P. J. Day
2007-01-10 9:24 ` Richard Knutsson
2007-01-10 9:48 ` Richard Knutsson
2007-01-10 9:53 ` Alexey Dobriyan
2007-01-10 10:17 ` Richard Knutsson
2007-01-10 10:31 ` Bernd Petrovitsch
2007-01-10 10:57 ` walter harms
2007-01-10 11:10 ` Richard Knutsson [this message]
2007-01-10 11:37 ` Richard Knutsson
2007-01-10 13:34 ` Robert P. J. Day
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45A4C9B5.3030609@student.ltu.se \
--to=ricknu-0@student.ltu.se \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.