Opened 7 years ago

Closed 7 years ago

#13064 closed Bug Report - General (Fixed)

MythRect::NormRect does not use result of normalized()

Reported by: Stuart Auchterlonie Owned by: Stuart Auchterlonie
Priority: minor Milestone: 29.0
Component: MythTV - User Interface Library Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This is an error that flags up on the build network

mythrect.cpp: In member function ‘void MythRect::NormRect()’:
mythrect.cpp:115:16: warning: ignoring return value of ‘QRect QRect::normalized() const’, declared with attribute warn_unused_result [-Wunused-result]
     normalized();
                ^
In file included from /usr/include/qt5/QtCore/QRect:1:0,
                 from mythrect.h:4,
                 from mythrect.cpp:4:
/usr/include/qt5/QtCore/qrect.h:69:11: note: declared here
     QRect normalized() const Q_DECL_NOTHROW Q_REQUIRED_RESULT;
           ^~~~~~~~~~

Attachments (2)

ticket13064-fix-mythrect-normrect.diff (1.1 KB) - added by Stuart Auchterlonie 7 years ago.
20170712_rect.patch (549 bytes) - added by Peter Bennett 7 years ago.
Apply the normalized result to the MythRect object

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by Stuart Auchterlonie

comment:1 Changed 7 years ago by Peter Bennett

As I see it, the problem is that the result of normalized call is discarded, so it achieves nothing. The result of the call should be applied to the MythRect object. Attached is my suggested patch.

comment:2 Changed 7 years ago by Peter Bennett

That suggestion does not work, it plays havoc with the theme display. Clearly, normalize does not work in this situation.

I suggest just remove the normalize() call, since it does nothing anyway. I tested the updated patch, which now does that, and it does not cause problems.

Last edited 7 years ago by Peter Bennett (previous) (diff)

Changed 7 years ago by Peter Bennett

Attachment: 20170712_rect.patch added

Apply the normalized result to the MythRect object

comment:3 Changed 7 years ago by Stuart Auchterlonie

In 65d90d894c418fb6493a1b1fca40cad2955e70a2/mythtv:

Fixes #13064. Don't call normalized() as the result is ignored and it causes issues with theme display

comment:4 Changed 7 years ago by Stuart Auchterlonie

Resolution: Fixed
Status: newclosed
Note: See TracTickets for help on using tickets.