[mythtv] [mythtv-commits] mythtv commit: r18315 by paulh

Daniel Kristjansson danielk at cuymedia.net
Mon Sep 22 06:30:32 UTC 2008

On Mon, 2008-09-22 at 16:21 +1000, cal wrote:
> Paul Harrison wrote:
> [ ... ]
> > Fixed properly this time ;-)
> Hmmm, I admire your persistence, but ... what you've got now is a little bit ugly, and a little bit misguided (no offence intended). The whole mythverbose mechanism is based on bits, so introducing integer arithmetic operations to manipulate it is a sure recipe for ugliness and obfuscation. 
> As far as I can tell, print_verbose_messages contains just the bits of the verbosity options nominated at runtime. Subsequently ANDing print_verbose_messages with any given VB_XXX option(s) will only give a TRUE if that/those verbosity option(s) was/were nominated at runtime. Like I said, what you've got works, but 
> {{{
> -    if ((print_verbose_messages & VB_MEDIA+VB_EXTRA) == VB_MEDIA+VB_EXTRA)
> +    if (print_verbose_messages & VB_MEDIA & VB_EXTRA)
> }}}
> is a whole lot cleaner, and a whole lot clearer as to what satisfies the if condition.

I'd do this:
+    if ((print_verbose_messages & (VB_MEDIA|VB_EXTRA)) ==

Cal, I think your version always returns false...

-- Daniel

More information about the mythtv-dev mailing list