Re: [PATCH 06/11] lib: Internal support for querying and creating ghost messages

Subject: Re: [PATCH 06/11] lib: Internal support for querying and creating ghost messages

Date: Sun, 5 Oct 2014 19:24:00 -0400

To: David Bremner

Cc: notmuch@notmuchmail.org

From: Austin Clements


Quoth David Bremner on Oct 05 at 10:30 am:
> Austin Clements <aclements@csail.mit.edu> writes:
> 
> > +	    message->flags &= ~(1 << NOTMUCH_MESSAGE_FLAG_GHOST);
> 
> What do you think about using bit set / clear / read macros?  I don't
> insist, but I wonder if it would make this part more readable.

I'm used to reading this stuff, so either way is fine with me.  Do we
have bit set / clear / read macros?

> > +	else if (*i == "Tghost")
> > +	    message->flags |= (1 << NOTMUCH_MESSAGE_FLAG_GHOST);
> > +	else
> 
> It makes me faintly unhappy to have the prefix hardcoded here.
> Not sure if there is a sensible solution.

I agree, but I also don't want to construct the test string every time
or deconstruct the term string every time.  I could move the "T"
prefix string to a #define and use that both here and in
BOOLEAN_PREFIX_INTERNAL, but that solution may be worse than the
problem.  What do you think?

Thread: