summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoonas Niilola <juippis@gentoo.org>2022-08-04 09:36:45 +0300
committerJoonas Niilola <juippis@gentoo.org>2022-08-04 09:37:21 +0300
commit9cc6eaa77dc60fb031455afae705658c818c94f7 (patch)
treecc7f5509a979a3e79f1d14a4f7c4b4e63776c2c0 /app-misc
parentapp-misc/qlcplus: Remove old version (diff)
downloadgentoo-9cc6eaa77dc60fb031455afae705658c818c94f7.tar.gz
gentoo-9cc6eaa77dc60fb031455afae705658c818c94f7.tar.bz2
gentoo-9cc6eaa77dc60fb031455afae705658c818c94f7.zip
app-misc/qlcplus: add upstream patch to fix a test issue in 4.12.5
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'app-misc')
-rw-r--r--app-misc/qlcplus/files/qlcplus-4.12.5-fix-test-issue.patch59
-rw-r--r--app-misc/qlcplus/qlcplus-4.12.5.ebuild2
2 files changed, 61 insertions, 0 deletions
diff --git a/app-misc/qlcplus/files/qlcplus-4.12.5-fix-test-issue.patch b/app-misc/qlcplus/files/qlcplus-4.12.5-fix-test-issue.patch
new file mode 100644
index 000000000000..d7cffba6ff8c
--- /dev/null
+++ b/app-misc/qlcplus/files/qlcplus-4.12.5-fix-test-issue.patch
@@ -0,0 +1,59 @@
+From 2ee0e053e39587d29789a26a37309445df222a0c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?=
+ <jeromelebleu@users.noreply.github.com>
+Date: Fri, 8 Jul 2022 09:41:21 +0200
+Subject: [PATCH] Round values explicitly in FadeChannel and KeyPadParser
+
+Fix #1344
+---
+ engine/src/fadechannel.cpp | 9 +++------
+ engine/src/keypadparser.cpp | 6 ++++--
+ 2 files changed, 7 insertions(+), 8 deletions(-)
+
+diff --git a/engine/src/fadechannel.cpp b/engine/src/fadechannel.cpp
+index 537b0fd9f..c642360be 100644
+--- a/engine/src/fadechannel.cpp
++++ b/engine/src/fadechannel.cpp
+@@ -323,14 +323,11 @@ uchar FadeChannel::calculateCurrent(uint fadeTime, uint elapsedTime)
+ // 16 bit fading works as long as MSB and LSB channels
+ // are targeting the same value. E.g. Red and Red Fine both at 158
+ float val = (float(m_target - m_start) * (float(elapsedTime) / float(fadeTime))) + float(m_start);
++ long rval = lrintf(val * 256);
+ if (m_flags & Fine)
+- {
+- m_current = ((val - floor(val)) * float(UCHAR_MAX));
+- }
++ m_current = rval & 0xff;
+ else
+- {
+- m_current = val;
+- }
++ m_current = rval / 256;
+ }
+
+ return uchar(m_current);
+diff --git a/engine/src/keypadparser.cpp b/engine/src/keypadparser.cpp
+index bc2d64cbc..36a4fe9b9 100644
+--- a/engine/src/keypadparser.cpp
++++ b/engine/src/keypadparser.cpp
+@@ -17,6 +17,8 @@
+ limitations under the License.
+ */
+
++#include <cmath>
++
+ #include "keypadparser.h"
+ #include "qlcmacros.h"
+
+@@ -194,9 +196,9 @@ QList<SceneValue> KeyPadParser::parseCommand(Doc *doc, QString command,
+ else if (lastCommand == CommandMinus)
+ scv.value = CLAMP(uniValue - toValue, 0, 255);
+ else if (lastCommand == CommandPlusPercent)
+- scv.value = CLAMP(uniValue * (1.0 + toValue), 0, 255);
++ scv.value = CLAMP(lrintf(uniValue * (1.0 + toValue)), 0, 255);
+ else if (lastCommand == CommandMinusPercent)
+- scv.value = CLAMP(uniValue - (float(uniValue) * toValue), 0, 255);
++ scv.value = CLAMP(lrintf(uniValue - (float(uniValue) * toValue)), 0, 255);
+ else if (lastCommand == CommandZERO)
+ scv.value = 0;
+ else if (lastCommand == CommandFULL)
diff --git a/app-misc/qlcplus/qlcplus-4.12.5.ebuild b/app-misc/qlcplus/qlcplus-4.12.5.ebuild
index a178db0add32..bdcb55edcf6b 100644
--- a/app-misc/qlcplus/qlcplus-4.12.5.ebuild
+++ b/app-misc/qlcplus/qlcplus-4.12.5.ebuild
@@ -44,6 +44,8 @@ DEPEND="${RDEPEND}
dev-qt/qttest:5
"
+PATCHES=( "${FILESDIR}"/qlcplus-4.12.5-fix-test-issue.patch )
+
src_prepare() {
default