BOOL vs. bool [was Re: svn commit: samba r25126]

Gerald (Jerry) Carter jerry at samba.org
Thu Sep 13 18:46:10 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jelmer Vernooij wrote:

> It'd be nice if Samba 3 could also start using bool, false 
> and true for new code (not much point in converting
> everything at once imho).
> 
> bool is C99 (<stdbool.h>) and will be defined by libreplace 
> if not defined by the host system. Some compilers may have specific
> optimizations for it. Samba's use of BOOL predates the 
> standardization of 'bool', but I don't see a reason to not
> start using the standardized type now that it's there.
> 
> Same goes for uint\d_t, which are defined in stdint.h as of 
> C99 and for which libreplace will also provided replacements
> if necessary.

ok. How does this sound for README.Coding then:

Primitive Data Types
- --------------------

Samba has large amounts of historical code which makes use of data
types commonly supported by the C99 standard. However, at the time
such types as boolean and exact width integers did not exist and
Samba developers were forced to provide their own.  Now that these
types are guaranteed to be available either as part of the compiler
C99 support or from lib/replace/, new code should adhere to the
following conventions:

  * Booleans are of type "bool" (not BOOL)
  * Boolean values are "true" and "false" (not True or False)
  * Exact width integers are of type [u]int[8|16|32|64]_t





cheers, jerry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG6YVyIR7qMdg1EfYRAlkHAJ9x5juXSZ4d5vKfyiJVBEu3lbO+wQCgpgmG
ZX0PaYUyb7a1LoDBf3+hmog=
=hgtH
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list