Skip to content

Commit

Permalink
Explicitly test to see if bitmask value is non-zero.
Browse files Browse the repository at this point in the history
The clang-tidy "implicit boolean conversion" check pointed out a
couple of places where masks are applied to bitfields, and then the
resulting value is implicitly tested to see if it is non-zero.  Make
these tests explicit.

https://clang.llvm.org/extra/clang-tidy/checks/readability-implicit-bool-conversion.html
  • Loading branch information
linuxdude42 committed Mar 26, 2019
1 parent 66ccc93 commit 23f73a5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mythtv/libs/libmyth/audio/audiooutputsettings.h
Expand Up @@ -88,25 +88,25 @@ class MPUBLIC AudioOutputSettings
* - FEATURE_DTSHD
*/
bool canFeature(DigitalFeature arg)
{ return m_features & arg; };
{ return (m_features & arg) != 0U; };
bool canFeature(unsigned int arg)
{ return m_features & arg; };
{ return (m_features & arg) != 0U; };

/**
* return true if device can or may support AC3
* (deprecated, see canFeature())
*/
bool canAC3() { return m_features & FEATURE_AC3; };
bool canAC3() { return canFeature(FEATURE_AC3); };
/**
* return true if device can or may support DTS
* (deprecated, see canFeature())
*/
bool canDTS() { return m_features & FEATURE_DTS; };
bool canDTS() { return canFeature(FEATURE_DTS); };
/**
* return true if device supports multichannels PCM
* (deprecated, see canFeature())
*/
bool canLPCM() { return m_features & FEATURE_LPCM; };
bool canLPCM() { return canFeature(FEATURE_LPCM); };
/**
* return true if class instance is marked invalid.
* if true, you can not assume any of the other method returned
Expand Down

0 comments on commit 23f73a5

Please sign in to comment.