Opened 10 years ago
Closed 9 years ago
#12443 closed Patch - Bug Fix (fixed)
Patch: proposed bugfix for static analysis detected error
Reported by: | Owned by: | JYA | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | MythTV - Video Decoding | Version: | Master Head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
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.
Attachments (1)
Change History (2)
Changed 10 years ago by
Attachment: | vaapicontext.patch added |
---|
comment:1 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
vaapicontext.patch