lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1153588759.44c25e17dd274@portal.student.luth.se>
Date:	Sat, 22 Jul 2006 19:19:19 +0200
From:	ricknu-0@...dent.ltu.se
To:	Jan Engelhardt <jengelh@...ux01.gwdg.de>
Cc:	linux-kernel@...r.kernel.org, Andrew Morton <akpm@...l.org>,
	Jeff Garzik <jeff@...zik.org>,
	Alexey Dobriyan <adobriyan@...il.com>,
	Vadim Lobanov <vlobanov@...akeasy.net>,
	Shorty Porty <getshorty_@...mail.com>,
	Peter Williams <pwil3058@...pond.net.au>,
	Michael Buesch <mb@...sch.de>,
	Pekka Enberg <penberg@...helsinki.fi>
Subject: Re: [RFC][PATCH] A generic boolean (version 3)

Citerar Jan Engelhardt <jengelh@...ux01.gwdg.de>:

> >+++ b/drivers/block/DAC960.h
> >@@ -71,7 +71,7 @@ #define DAC690_V2_PciDmaMask	0xfffffffff
> >   Define a Boolean data type.
> > */
> > 
> >-typedef enum { false, true } __attribute__ ((packed)) boolean;
> >+typedef bool boolean;
> > 
> Probably I missed some mail, but why can't we just have typedef _Bool bool?
> Like below?

Because it defines bool in include/asm/types.h, then "all" files will have the
bool-type. But because DAC960.h calles it boolean I just typedefed the new
bool-type to "boolean". Then if this gets into -mm or linus-tree, I/we can start
to clean up all the code using booleans. After all, there is also BOOL and
BOOLEAN but they are not effected by this change.

> 
> >+++ b/include/asm-i386/types.h
> >@@ -1,6 +1,13 @@
> > #ifndef _I386_TYPES_H
> > #define _I386_TYPES_H
> > 
> >+#if __GNUC__ >= 3
> >+typedef _Bool bool;
> >+#else
> >+#warning You compiler doesn't seem to support boolean types, will set
> 'bool' as
> >an 'unsigned int'
> >+typedef unsigned int bool;
> >+#endif
> >+
> > #ifndef __ASSEMBLY__
> > 
> > typedef unsigned short umode_t;
> >--- a/include/linux/stddef.h
> >+++ b/include/linux/stddef.h
> >@@ -10,6 +10,17 @@ #else
> > #define NULL ((void *)0)
> > #endif
> > 
> >+#undef false
> >+#undef true
> 
> Wasnot this supposed to go away?

#undef or enum?
There has not been any #undef's before, and enum I think is better. This since
Jeff showed it could be combined with the #define for the cpp's sake.

> 
> >+
> >+enum {
> >+	false	= 0,
> >+	true	= 1
> >+};
> >+
> >+#define false false
> >+#define true true 
> >+
> > #undef offsetof
> > #ifdef __compiler_offsetof
> > #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
> >
> 
> Jan Engelhardt

/Richard Knutsson
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ