[mythtv-commits] Ticket #12443: Patch: proposed bugfix for static analysis detected error
MythTV
noreply at mythtv.org
Thu Apr 30 15:05:41 UTC 2015
#12443: Patch: proposed bugfix for static analysis detected error
-------------------------------------------------+-------------------------
Reporter: Gary Buhrmaster | Owner: jyavenard
<gary.buhrmaster@…> |
Type: Patch - Bug Fix | Status: new
Priority: minor | Milestone: unknown
Component: MythTV - Video Decoding | Version: Master Head
Severity: medium | Keywords:
Ticket locked: 0 |
-------------------------------------------------+-------------------------
Clang 3.5 reported the following warning:
{{{
vaapicontext.cpp:673:9: warning: logical not is only applied to the left
hand side of this comparison [-Wlogical-not-parentheses]
if (!m_dispType == kVADisplayX11)
^ ~~
vaapicontext.cpp:673:9: note: add parentheses after the '!' to evaluate
the comparison first
if (!m_dispType == kVADisplayX11)
^
( )
vaapicontext.cpp:673:9: note: add parentheses around left hand side
expression to silence this warning
if (!m_dispType == kVADisplayX11)
^
( )
}}}
Since m_dispType is not a bitfield (but an enum) negating it before the
comparison seems unintended.
Proposed (and completely untested) patch will be attached, but appears
consistent with the other code fragments in the source.
Note that the returned value after the comparison seems to be irrelevant,
since the only apparent place this routine is called (almost immediately)
checks for m_dispType != kVADisplayX11 anyway.
--
Ticket URL: <https://code.mythtv.org/trac/ticket/12443>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list