[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?)
From: |
Alexander Malmberg |
Subject: |
[RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?) |
Date: |
Fri, 30 Jan 2004 17:00:49 +0100 |
Manuel Guesdon wrote:
> My rule: be strict for output and flexible for input :-)
A very good rule. :)
http://www.faqs.org/docs/jargon/P/Postel's-Prescription.html
> So what do we do ?
I've attached a patch to our coding standards. OK to commit? If so, new
code will work ok, and I'll get to work on patching core/ (hopefully
with some help from David Ayers :).
- Alexander Malmberg
Index: Documentation/coding-standards.texi
===================================================================
RCS file:
/cvsroot/gnustep/gnustep/core/base/Documentation/coding-standards.texi,v
retrieving revision 1.8
diff -u -r1.8 coding-standards.texi
--- Documentation/coding-standards.texi 22 Sep 2003 03:00:21 -0000 1.8
+++ Documentation/coding-standards.texi 30 Jan 2004 14:17:35 -0000
@@ -63,6 +63,7 @@
* Variable Declaration::
* Object Persistance::
* Contributing::
+* BOOLs::
@end menu
@c ******************************************************************
@@ -348,7 +349,7 @@
@c ******************************************************************
address@hidden Object Persistance, Contributing, Variable Declaration, Top
address@hidden Object Persistance, BOOLs, Variable Declaration, Top
@section Object Persistance
The standard method of saving and restoring object information in GNUstep
@@ -361,7 +362,19 @@
should be read.
address@hidden Contributing, , Object Persistance, Top
address@hidden
******************************************************************
address@hidden BOOLs, Contributing, Object Persistance, Top
address@hidden BOOLs
+
+BOOL values are normal c truth values. Any non-zero value (i.e. any value
+not equal to NO) is true. Thus, BOOL values must never be compared against
+YES since this doesn't correctly handle true values other than YES.
+
+Methods that return BOOL values should try to return only YES or NO to
+avoid triggering problems in code that doesn't handle BOOL values correctly.
+
+
address@hidden Contributing, , BOOLs, Top
@section Contributing
Contributing code is not difficult. Here are
- Problem with +numberWithBool: ?, Manuel Guesdon, 2004/01/29
- Re: Problem with +numberWithBool: ?, Richard Frith-Macdonald, 2004/01/29
- Re: Problem with +numberWithBool: ?, David Ayers, 2004/01/29
- Re: Problem with +numberWithBool: ?, Alexander Malmberg, 2004/01/29
- Re[2]: Problem with +numberWithBool: ?, Manuel Guesdon, 2004/01/29
- Re: Problem with +numberWithBool: ?, Helge Hess, 2004/01/30
- [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?),
Alexander Malmberg <=
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), David Ayers, 2004/01/30
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Nicola Pero, 2004/01/30
- Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Manuel Guesdon, 2004/01/30
- Re[2]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Nicola Pero, 2004/01/30
- Re[3]: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Manuel Guesdon, 2004/01/30
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), David Ayers, 2004/01/31
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), Richard Frith-Macdonald, 2004/01/31
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), David Ayers, 2004/01/31
- Re: [RFA]: BOOL coding standards (Was: Problem with +numberWithBool: ?), David Ayers, 2004/01/31
- Re: [RFA]: BOOL coding standards (Was: Problem with+numberWithBool: ?), Alexander Malmberg, 2004/01/31