summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason A. Donenfeld <zx2c4@gentoo.org>2023-12-05 00:03:22 +0100
committerJason A. Donenfeld <zx2c4@gentoo.org>2023-12-05 00:08:32 +0100
commitf6f3e9305723f1df1754959ee41a6bd29cd48ed4 (patch)
tree3380a1f80e6ec2ef4427125b7d8f78aa0261a74c /media-sound/alsa-scarlett-gui
parentnet-fs/samba: add 4.18.9 (diff)
downloadgentoo-f6f3e9305723f1df1754959ee41a6bd29cd48ed4.tar.gz
gentoo-f6f3e9305723f1df1754959ee41a6bd29cd48ed4.tar.bz2
gentoo-f6f3e9305723f1df1754959ee41a6bd29cd48ed4.zip
media-sound/alsa-scarlett-gui: use fabs() for double
clang -MT gtkdial.o -MMD -MP -MF .deps/gtkdial.d -O2 -pipe -march=native -fno-diagnostics-color -Werror=implicit-function-declaration -Werror=implicit-int -Wall -Werror -D_FORTIFY_SOURCE=2 -DVERSION=\"Unknown\" -Wno-error=deprecated-declarations -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include gtkdial.c:836:9: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value] 836 | if (abs(delta) > 1) Link: https://github.com/geoffreybennett/alsa-scarlett-gui/pull/87 Closes: https://bugs.gentoo.org/918957 Signed-off-by: Jason A. Donenfeld <zx2c4@gentoo.org>
Diffstat (limited to 'media-sound/alsa-scarlett-gui')
-rw-r--r--media-sound/alsa-scarlett-gui/alsa-scarlett-gui-0.3.3-r1.ebuild (renamed from media-sound/alsa-scarlett-gui/alsa-scarlett-gui-0.3.3.ebuild)5
-rw-r--r--media-sound/alsa-scarlett-gui/files/alsa-scarlett-gui-0.3.3-fabs.patch33
2 files changed, 37 insertions, 1 deletions
diff --git a/media-sound/alsa-scarlett-gui/alsa-scarlett-gui-0.3.3.ebuild b/media-sound/alsa-scarlett-gui/alsa-scarlett-gui-0.3.3-r1.ebuild
index bbffa10a19b6..8f4c27ffd11c 100644
--- a/media-sound/alsa-scarlett-gui/alsa-scarlett-gui-0.3.3.ebuild
+++ b/media-sound/alsa-scarlett-gui/alsa-scarlett-gui-0.3.3-r1.ebuild
@@ -19,7 +19,10 @@ DEPEND="
RDEPEND="${DEPEND}"
BDEPEND="virtual/pkgconfig"
-PATCHES=( "${FILESDIR}"/"${P}"-cflags.patch )
+PATCHES=(
+ "${FILESDIR}"/"${P}"-cflags.patch
+ "${FILESDIR}"/"${P}"-fabs.patch
+)
MAKEOPTS="${MAKEOPTS} -C src"
export PREFIX="/usr"
diff --git a/media-sound/alsa-scarlett-gui/files/alsa-scarlett-gui-0.3.3-fabs.patch b/media-sound/alsa-scarlett-gui/files/alsa-scarlett-gui-0.3.3-fabs.patch
new file mode 100644
index 000000000000..31f21bed199a
--- /dev/null
+++ b/media-sound/alsa-scarlett-gui/files/alsa-scarlett-gui-0.3.3-fabs.patch
@@ -0,0 +1,33 @@
+From 883541a1073e5bd2f8a8f759db56e48d90a2f448 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason@zx2c4.com>
+Date: Tue, 5 Dec 2023 00:00:34 +0100
+Subject: [PATCH] gtkdial: use fabs() for double
+
+Passing a double to abs() truncates it to an integer, which is probably
+not intended, and also causes fatal errors on clang.
+
+Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
+---
+ src/gtkdial.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/gtkdial.c b/src/gtkdial.c
+index ce06515..931b06b 100644
+--- a/src/gtkdial.c
++++ b/src/gtkdial.c
+@@ -832,9 +832,9 @@ gtk_dial_scroll_controller_scroll (GtkEventControllerScroll *scroll,
+ double dy,
+ GtkDial *dial)
+ {
+- double delta = dx ? dx : dy;
+- if (abs(delta) > 1)
+- delta *= abs(delta);
++ double delta = dx ? dx : dy, absolute_delta = fabs(delta);
++ if (absolute_delta > 1)
++ delta *= absolute_delta;
+ double step = -gtk_adjustment_get_step_increment(dial->adj)*delta;
+
+ set_value(dial, gtk_adjustment_get_value(dial->adj) + step);
+--
+2.42.0
+