Opened 9 years ago

Closed 9 years ago

#10481 closed Patch - Bug Fix (fixed)

Correct empty body warning in metadatafactory.cpp

Reported by: Gary Buhrmaster <gary.buhrmaster@…> Owned by:
Priority: minor Milestone: 0.25
Component: MythTV - General Version: Unspecified
Severity: medium Keywords:
Cc: Ticket locked: no


In metadatafactory.cpp there is a detected (by clang) if statement with an empty body of the form:

if (metadata);

Lookup(metadata, true, true);

such that the Lookup function is called regardless of the value of metadata. It appears that at some point in the past the Lookup function was changed to check for a NULL input, and return immediately, so the check is not technically required. However, for belt and suspenders purposes, I am providing a patch that simply removes the ';', so that the check for NULL will occur in this code (and is what I suspect was the intended purpose of the if).



Attachments (1)

metadatafactory_cpp.diff (543 bytes) - added by Gary Buhrmaster <gary.buhrmaster@…> 9 years ago.

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by Gary Buhrmaster <gary.buhrmaster@…>

Attachment: metadatafactory_cpp.diff added

comment:1 Changed 9 years ago by Github

Milestone: unknown0.25
Resolution: fixed
Status: newclosed

Remove extraneous ; in MetadataFactory?.

Gary came up with an explanation that makes the author (me) sound much better than what actually probably occurred, which is my fingers working on autopilot.

Behavior should be totally unchanged.

Fixes #10481.

Branch: master Changeset: aefc7ced019beb1f722d16e56917c9e22e452a6d

Note: See TracTickets for help on using tickets.