From f86c867611a141b008dc32857d0a01c95fcdd5c1 Mon Sep 17 00:00:00 2001 From: Markus Volk Date: Tue, 21 May 2024 14:46:51 +0200 Subject: [PATCH] xcur2png: ignore implicit-int - add a patch to fix math --- .../xcur2png/0001-fix-wrong-math.patch | 27 +++++++++++++++++++ recipes-extended/xcur2png/xcur2png_git.bb | 9 +++++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 recipes-extended/xcur2png/xcur2png/0001-fix-wrong-math.patch diff --git a/recipes-extended/xcur2png/xcur2png/0001-fix-wrong-math.patch b/recipes-extended/xcur2png/xcur2png/0001-fix-wrong-math.patch new file mode 100644 index 0000000..4e8ea45 --- /dev/null +++ b/recipes-extended/xcur2png/xcur2png/0001-fix-wrong-math.patch @@ -0,0 +1,27 @@ +From cda8f7af382f5c5f1e9a395eb03e2b819770d499 Mon Sep 17 00:00:00 2001 +From: Yuji Saeki <44311901+YujiSaeki@users.noreply.github.com> +Date: Mon, 1 Jun 2020 22:32:16 +0200 +Subject: [PATCH 1/1] fix wrong math + +Signed-off-by: Christian Hesse +--- + xcur2png.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/xcur2png.c b/xcur2png.c +index 8723a10..f7dd95d 100644 +--- a/xcur2png.c ++++ b/xcur2png.c +@@ -586,9 +586,9 @@ int writePngFileFromXcur (const XcursorDim width, const XcursorDim height, + unsigned int red = (pixels[i]>>16) & 0xff; + unsigned int green = (pixels[i]>>8) & 0xff; + unsigned int blue = pixels[i] & 0xff; +- red = (div (red * 256, alpha).quot) & 0xff; +- green = (div (green * 256, alpha).quot) & 0xff; +- blue = (div (blue * 256, alpha).quot) & 0xff; ++ red = (div (red * 255, alpha).quot) & 0xff; ++ green = (div (green * 255, alpha).quot) & 0xff; ++ blue = (div (blue * 255, alpha).quot) & 0xff; + pix[i] = (alpha << 24) + (red << 16) + (green << 8) + blue; + } + diff --git a/recipes-extended/xcur2png/xcur2png_git.bb b/recipes-extended/xcur2png/xcur2png_git.bb index e4f729d..637ebfa 100644 --- a/recipes-extended/xcur2png/xcur2png_git.bb +++ b/recipes-extended/xcur2png/xcur2png_git.bb @@ -5,11 +5,16 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" DEPENDS = "libxcursor libpng" +SRC_URI = " \ + git://github.com/eworm-de/xcur2png.git;protocol=https;branch=master \ + file://0001-fix-wrong-math.patch \ +" + S = "${WORKDIR}/git" SRCREV = "f582d648f37a9ed2de0c8650947487af8a54d3ad" PV = "0.7.1" -SRC_URI = "git://github.com/eworm-de/xcur2png.git;protocol=https;branch=master" - inherit autotools pkgconfig +CFLAGS += "-Wno-implicit-int" +