Re: [Evolution-hackers] Why a bitfield in CamelOfflineFolder?



On Thu, 2006-11-30 at 11:51 -0500, Jeffrey Stedfast wrote:
> wow, that came out totally wrong...
> 
> using a single bit allows us to extend the structure with more bitfields
> w/o breaking ABI if we find we need to.
> 
> it's akin to having:
> 
> unsigned int sync_offline:1;
> unsigned int unused:31;

I'm just curious, but what's the advantage of bitfields over just having
an integer field called "flags" and defining the individual flags as
enum values?  The latter approach has all the advantages that Jeff
enumerated, but it also allows you to work with groups of flags at once
(e.g. masking, copying, etc.).  Perhaps that's not relevant for this
particular case?

Matthew Barnes




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]