gui-apps/mpvpaper: fix build with GCC 15

Closes: https://bugs.gentoo.org/945227
Signed-off-by: Takuya Wakazono <pastalian46@gmail.com>
This commit is contained in:
Takuya Wakazono 2024-11-28 21:20:34 +09:00
parent 1bd27e66fe
commit 30e320d277
No known key found for this signature in database
GPG Key ID: 91CA2604719DDA61
2 changed files with 153 additions and 0 deletions

View File

@ -0,0 +1,148 @@
https://bugs.gentoo.org/945227
https://github.com/GhostNaN/mpvpaper/pull/90
--- a/src/holder.c
+++ b/src/holder.c
@@ -45,8 +45,6 @@ static struct {
int start_time;
} halt_info = {NULL, NULL, false, 0};
-static void nop() {}
-
static void revive_mpvpaper() {
// Get the "real" cwd
char exe_dir[1024];
@@ -197,6 +195,16 @@ static void create_layer_surface(struct display_output *output) {
wl_surface_commit(output->surface);
}
+static void output_geometry(void *data, struct wl_output *wl_output, int32_t x, int32_t y, int32_t physical_width,
+ int32_t physical_height, int32_t subpixel, const char *make, const char *model, int32_t transform) {
+ // NOP
+}
+
+static void output_mode(void *data, struct wl_output *wl_output, uint32_t flags, int32_t width, int32_t height,
+ int32_t refresh) {
+ // NOP
+}
+
static void output_name(void *data, struct wl_output *wl_output, const char *name) {
(void)wl_output;
@@ -221,6 +229,10 @@ static void output_done(void *data, struct wl_output *wl_output) {
destroy_display_output(output);
}
+static void output_scale(void *data, struct wl_output *wl_output, int32_t scale) {
+ // NOP
+}
+
static void output_description(void *data, struct wl_output *wl_output, const char *description) {
(void)wl_output;
@@ -238,10 +250,10 @@ static void output_description(void *data, struct wl_output *wl_output, const ch
}
static const struct wl_output_listener output_listener = {
- .geometry = nop,
- .mode = nop,
+ .geometry = output_geometry,
+ .mode = output_mode,
.done = output_done,
- .scale = nop,
+ .scale = output_scale,
.name = output_name,
.description = output_description,
};
--- a/src/main.c
+++ b/src/main.c
@@ -88,8 +88,6 @@ static uint SLIDESHOW_TIME = 0;
static bool SHOW_OUTPUTS = false;
static int VERBOSE = 0;
-static void nop() {}
-
static void exit_cleanup() {
// Give mpv a chance to finish
@@ -123,7 +121,7 @@ static void exit_mpvpaper(int reason) {
exit(reason);
}
-static void *exit_by_pthread() {
+static void *exit_by_pthread(void *_) {
exit_mpvpaper(EXIT_SUCCESS);
pthread_exit(NULL);
}
@@ -262,7 +260,7 @@ static char *check_watch_list(char **list) {
return NULL;
}
-static void *monitor_pauselist() {
+static void *monitor_pauselist(void *_) {
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
bool list_paused = 0;
@@ -286,7 +284,7 @@ static void *monitor_pauselist() {
pthread_exit(NULL);
}
-static void *monitor_stoplist() {
+static void *monitor_stoplist(void *_) {
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
while (halt_info.stoplist) {
@@ -303,7 +301,7 @@ static void *monitor_stoplist() {
pthread_exit(NULL);
}
-static void *handle_auto_pause() {
+static void *handle_auto_pause(void *_) {
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
while (halt_info.auto_pause) {
@@ -327,7 +325,7 @@ static void *handle_auto_pause() {
pthread_exit(NULL);
}
-static void *handle_auto_stop() {
+static void *handle_auto_stop(void *_) {
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
while (halt_info.auto_stop) {
@@ -344,7 +342,7 @@ static void *handle_auto_stop() {
pthread_exit(NULL);
}
-static void *handle_mpv_events() {
+static void *handle_mpv_events(void *_) {
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
int mpv_paused = 0;
time_t start_time = time(NULL);
@@ -710,6 +708,16 @@ static void create_layer_surface(struct display_output *output) {
wl_surface_commit(output->surface);
}
+static void output_geometry(void *data, struct wl_output *wl_output, int32_t x, int32_t y, int32_t physical_width,
+ int32_t physical_height, int32_t subpixel, const char *make, const char *model, int32_t transform) {
+ // NOP
+}
+
+static void output_mode(void *data, struct wl_output *wl_output, uint32_t flags, int32_t width, int32_t height,
+ int32_t refresh) {
+ // NOP
+}
+
static void output_name(void *data, struct wl_output *wl_output, const char *name) {
(void)wl_output;
@@ -771,8 +779,8 @@ static void output_description(void *data, struct wl_output *wl_output, const ch
}
static const struct wl_output_listener output_listener = {
- .geometry = nop,
- .mode = nop,
+ .geometry = output_geometry,
+ .mode = output_mode,
.done = output_done,
.scale = output_scale,
.name = output_name,

View File

@ -32,6 +32,11 @@ DEPEND="
"
BDEPEND="dev-util/wayland-scanner"
PATCHES=(
# bug #945227
"${FILESDIR}/${P}-gcc15.patch"
)
src_install() {
meson_src_install
newman mpvpaper.man mpvpaper.1