lkml.org 
[lkml]   [2006]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [RFC][PATCH] A generic boolean (version 4)

>Hopefully it is now ready for a "real" patch, whom adds bool to all
>arches. If there is no comments on this one, it will be sent about
>tomorrow night (GMT).

--- a/drivers/block/DAC960.h
+++ 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;


/*
Looks good. (I know found out what this is good for. Eventually, all booleans
in the source of DAC960 et al. should be changed to just 'bool' but that's
another patch's job.)

Looks good, except for the "all arches" thing. You only seem to add it
to i386:

>--- a/include/asm-i386/types.h
>+++ b/include/asm-i386/types.h
>@@ -1,6 +1,8 @@
> #ifndef _I386_TYPES_H
> #define _I386_TYPES_H
>
>+typedef _Bool bool;
>+
> #ifndef __ASSEMBLY__
>
> typedef unsigned short umode_t;


>+#undef false
>+#undef true
>+
>+enum {
>+ false = 0,
>+ true = 1
>+};
>+
>+#define false false
>+#define true true

Can someone please tell me what advantage 'define true true' is going to
bring, besides than being able to '#ifdef true'?



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

\
 
 \ /
  Last update: 2006-07-23 18:29    [W:0.291 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site