Control: tags -1 patch

On Fri, 2 Sep 2016 20:39:37 -0700 Philip Chung
<[email protected]> wrote:
> Package: muse
> Version: 2.1.2-2
> Severity: normal
> 
> Hello,
> 
> In bug #831147 I submitted a patch, which was incorporated as
> "1002-abs-errors.patch". However, there is a problem with the changes to
> muse/midiedit/ecanvas.cpp
> 
> [snip]
>
> I don't think this is a major problem, but I think it should be fixed. I
> will send an updated version of the patch that references this bug report.

Attached is the updated patch. It casts the arguments to int before
calling abs() so that the proper overload is used. Also, the include of
<math.h> is changed to <stdlib.h> (which is where the integer versions
of abs() normally reside).

Philip Chung
Description: Fix errors related to the abs() function
Author: Philip Chung <[email protected]>
Bug-Debian: https://bugs.debian.org/831147
Bug-Debian: https://bugs.debian.org/836432
---
 midiedit/ecanvas.cpp       |    1 +
 sync.cpp                   |    4 ++--
 widgets/knob.cpp           |    2 +-
 widgets/knob_and_meter.cpp |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

--- muse.orig/muse/widgets/knob.cpp
+++ muse/muse/widgets/knob.cpp
@@ -172,7 +172,7 @@ void Knob::drawKnob(QPainter* p, const Q
       QPen pn;
       pn.setCapStyle(Qt::FlatCap);
 
-      pn.setColor(d_shinyColor.lighter(l_const + abs(value() * l_slope)));
+      pn.setColor(d_shinyColor.lighter(l_const + std::abs(value() * l_slope)));
       pn.setWidth(d_shineWidth * 2);
       p->setPen(pn);
       p->drawArc(aRect, 0, 360 * 16);
--- muse.orig/muse/widgets/knob_and_meter.cpp
+++ muse/muse/widgets/knob_and_meter.cpp
@@ -171,7 +171,7 @@ void KnobWithMeter::drawKnob(QPainter* p
       QPen pn;
       pn.setCapStyle(Qt::FlatCap);
 
-      pn.setColor(d_shinyColor.lighter(l_const + abs(value() * l_slope)));
+      pn.setColor(d_shinyColor.lighter(l_const + std::abs(value() * l_slope)));
       pn.setWidth(d_shineWidth * 2);
       p->setPen(pn);
       p->drawArc(aRect, 0, 360 * 16);
--- muse.orig/muse/midiedit/ecanvas.cpp
+++ muse/muse/midiedit/ecanvas.cpp
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include <limits.h>
+#include <stdlib.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/mman.h>
@@ -273,8 +274,8 @@ void EventCanvas::selectAtTick(unsigned
 
             while (i != items.end()) {
                 CItem* cur=i->second;                
-                unsigned int curtk=abs(cur->x() + cur->part()->tick() - tick);
-                unsigned int neartk=abs(nearest->x() + nearest->part()->tick() - tick);
+                unsigned int curtk=abs(static_cast<int>(cur->x() + cur->part()->tick() - tick));
+                unsigned int neartk=abs(static_cast<int>(nearest->x() + nearest->part()->tick() - tick));
 
                 if (curtk < neartk) {
                     nearest=cur;
--- muse.orig/muse/sync.cpp
+++ muse/muse/sync.cpp
@@ -961,7 +961,7 @@ void MidiSeq::realtimeSystemInput(int po
                               if(_preDetect && pole == 0)
                               {
                                 double real_tempo = 60.0/(avg_diff * 24.0);
-                                double real_tempo_diff = abs(real_tempo - _lastRealTempo);
+                                double real_tempo_diff = std::abs(real_tempo - _lastRealTempo);
                                 
                                 // If the tempo changed a large amount, reset.
                                 if(real_tempo_diff >= 10.0)  // TODO: User-adjustable?
@@ -1009,7 +1009,7 @@ void MidiSeq::realtimeSystemInput(int po
                               if(pole == fin_idx)
                               {
                                 double real_tempo = 60.0/(avg_diff * 24.0);
-                                double real_tempo_diff = abs(real_tempo - _lastRealTempo);
+                                double real_tempo_diff = std::abs(real_tempo - _lastRealTempo);
                                 
                                 if(real_tempo_diff >= _tempoQuantizeAmount/2.0) // Anti-hysteresis
                                 {
_______________________________________________
pkg-multimedia-maintainers mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers

Reply via email to