(no subject)

Jelmer Vernooij jelmer at samba.org
Fri Jan 5 13:55:09 GMT 2007


Hi Tridge,

On Fri, 2007-01-05 at 14:38 +1100, tridge at samba.org wrote:
>  > #ifndef HAVE_UINT_ENUMS
>  > #define STYPE_HIDDEN    ( 0x80000000 )
>  > ...
>  > #else
>  > #define STYPE_HIDDEN	-1
>  > #endif
> 
> except that the value is wrong (0x80000000 is not -1).
> 
> What if we generated this:
> 
> #define STYPE_HIDDEN (ENUM_CAST)(0x80000000)
Sorry, I made a mistake in the code fragment above. It should be
something like this:

#ifndef HAVE_UINT_ENUMS
#define STYPE_HIDDEN (unsigned short)(0x8000000)
...
#else
enum stype {
  STYPE_HIDDEN=0x8000000,
  ...
}
#endif

I'd like to keep the enum {} bit as that allows compilers like gcc to
warn us when we're using values for the enum that aren't defined.

Cheers,

jelmer
-- 
Jelmer Vernooij <jelmer at samba.org> - http://samba.org/~jelmer/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20070105/995675ae/attachment.bin


More information about the samba-technical mailing list