commit:     e9cf427071b67d3445a42ddad3ecdea29d9fa7a5
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  3 09:50:40 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb  3 09:50:53 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9cf4270

x11-plugins/gkrellm-vaiobright: fix warnings (+ build w/ clang)

Closes: https://bugs.gentoo.org/742902
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../gkrellm-vaiobright-2.5-Fix-Wreturn-type.patch  | 22 ++++++++++
 ...llm-vaiobright-2.5-Use-standard-int-types.patch | 48 ++++++++++++++++++++++
 .../gkrellm-vaiobright-2.5-r4.ebuild               | 35 ++++++++++++++++
 3 files changed, 105 insertions(+)

diff --git 
a/x11-plugins/gkrellm-vaiobright/files/gkrellm-vaiobright-2.5-Fix-Wreturn-type.patch
 
b/x11-plugins/gkrellm-vaiobright/files/gkrellm-vaiobright-2.5-Fix-Wreturn-type.patch
new file mode 100644
index 000000000000..992f3b66b1b8
--- /dev/null
+++ 
b/x11-plugins/gkrellm-vaiobright/files/gkrellm-vaiobright-2.5-Fix-Wreturn-type.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/742902
+
+From 5312ab56edcc721529af6520c9ecccaa20af4cdc Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Fri, 3 Feb 2023 09:46:55 +0000
+Subject: [PATCH 1/2] Fix -Wreturn-type
+
+Signed-off-by: Sam James <[email protected]>
+--- a/vaiobright.c
++++ b/vaiobright.c
+@@ -110,7 +110,7 @@ static int vaiobright_get_brightness() {
+     // If we're broken, try again to open it
+     if (vaiobright_bslider->broken == 1) {
+         if (vaiobright_open_device() == -1)
+-            return;
++            return -1;
+     }
+ 
+     if (ioctl(vaiobright_bslider->sony_fd, SONYPI_IOCGBRT, &value) < 0) {
+-- 
+2.39.1
+

diff --git 
a/x11-plugins/gkrellm-vaiobright/files/gkrellm-vaiobright-2.5-Use-standard-int-types.patch
 
b/x11-plugins/gkrellm-vaiobright/files/gkrellm-vaiobright-2.5-Use-standard-int-types.patch
new file mode 100644
index 000000000000..cec38819ff3f
--- /dev/null
+++ 
b/x11-plugins/gkrellm-vaiobright/files/gkrellm-vaiobright-2.5-Use-standard-int-types.patch
@@ -0,0 +1,48 @@
+From ab824d40f56e3c8037df77a15114de6bd0a332e0 Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Fri, 3 Feb 2023 09:48:01 +0000
+Subject: [PATCH 2/2] Use standard int types
+
+Signed-off-by: Sam James <[email protected]>
+--- a/vaiobright.c
++++ b/vaiobright.c
+@@ -15,6 +15,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <stdint.h>
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <sys/ioctl.h>
+@@ -24,8 +25,8 @@
+ #include <linux/types.h>
+ 
+ // Define our ioctl's (stolen from spicctrl)
+-#define SONYPI_IOCGBRT _IOR('v', 0, __u8)
+-#define SONYPI_IOCSBRT _IOW('v', 0, __u8)
++#define SONYPI_IOCGBRT _IOR('v', 0, uint8_t)
++#define SONYPI_IOCSBRT _IOW('v', 0, uint8_t)
+ 
+ static void create_vaiobright_plug_config(GtkWidget *tab);
+ static void load_vaiobright_plug_config(gchar *arg);
+@@ -88,7 +89,7 @@ static void vaiobright_close_device(void) {
+ 
+ // Write a new brightness level out to the control application
+ static void vaiobright_set_brightness(int level) {
+-    __u8 value = (__u8) level;
++    uint8_t value = (uint8_t) level;
+ 
+     // If we're broken, try again to open it
+     if (vaiobright_bslider->broken == 1) {
+@@ -105,7 +106,7 @@ static void vaiobright_set_brightness(int level) {
+ }
+ 
+ static int vaiobright_get_brightness() {
+-    __u8 value = 0;
++    uint8_t value = 0;
+ 
+     // If we're broken, try again to open it
+     if (vaiobright_bslider->broken == 1) {
+-- 
+2.39.1
+

diff --git a/x11-plugins/gkrellm-vaiobright/gkrellm-vaiobright-2.5-r4.ebuild 
b/x11-plugins/gkrellm-vaiobright/gkrellm-vaiobright-2.5-r4.ebuild
new file mode 100644
index 000000000000..d6693add74ee
--- /dev/null
+++ b/x11-plugins/gkrellm-vaiobright/gkrellm-vaiobright-2.5-r4.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit gkrellm-plugin toolchain-funcs
+
+MY_P=${P/gkrellm-/}
+
+DESCRIPTION="Superslim VAIO LCD Brightness Control Plugin for Gkrellm"
+SRC_URI="http://nerv-un.net/~dragorn/code/${MY_P}.tar.gz";
+HOMEPAGE="http://nerv-un.net/~dragorn/";
+S="${WORKDIR}"/${MY_P}
+
+LICENSE="GPL-2"
+SLOT="2"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="app-admin/gkrellm:2[X]"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-textrel.patch
+       "${FILESDIR}"/${P}-fixinfo.patch
+       "${FILESDIR}"/${P}-Fix-Wreturn-type.patch
+       "${FILESDIR}"/${P}-Use-standard-int-types.patch
+)
+
+src_configure() {
+       tc-export CC PKG_CONFIG
+
+       PLUGIN_SO=( vaiobright$(get_modname) )
+       default
+}

Reply via email to