gamescope/libliftoff-fix-gcc14-calloc-transposed-args.patch
llyyr 29746772f8 Accepting request 1172994 from home:ateixeira:branches:games:tools
- Update to version 3.14.13:
  * wlserver: Fix content overrides for reparented windows
  * drm: Add drm_debug_disable_in_fence_fd convar
  * wlserver: Cursor constraint improvements
  * wlserver: Add affirmative log that libei started
  * layer: Fix double ptr in RemoveFromChain (and add vkroots checks)
  * rendervulkan, shaders: Fix mura correction with FSR + NIS
  * InputEmulation: Add missing break to {START,STOP}_EMULATING
  * layer: Fix crash with frame limiter aware
  * reshade: added helper lambda: matchesAnnotationName
  * reshade: prefer ranges + bind_front over custom lambda
- Add upstream patch libliftoff-fix-gcc14-calloc-transposed-args.patch
  * Fix libliftoff builds with gcc14

OBS-URL: https://build.opensuse.org/request/show/1172994
OBS-URL: https://build.opensuse.org/package/show/games:tools/gamescope?expand=0&rev=25
2024-05-09 20:58:33 +00:00

38 lines
1.5 KiB
Diff

From 29a06add8ef184f85e37ff8abdc34fbaa2f4ee1e Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyich@gmail.com>
Date: Thu, 21 Dec 2023 20:15:29 +0000
Subject: [PATCH] layer.c: fix build against upcoming `gcc-14`
(`-Werror=calloc-transposed-args`)
`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It
detected minor infelicity in `calloc()` API usage in `libliftoff`:
../layer.c: In function 'liftoff_layer_create':
../layer.c:20:48: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in t
ument [-Werror=calloc-transposed-args]
20 | layer->candidate_planes = calloc(sizeof(layer->candidate_planes[0]),
| ^
../layer.c:20:48: note: earlier argument should specify number of elements, later size of each element
---
layer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/subprojects/libliftoff/layer.c b/subprojects/libliftoff/layer.c
index 73a8186..6510ea7 100644
--- a/subprojects/libliftoff/layer.c
+++ b/subprojects/libliftoff/layer.c
@@ -17,8 +17,8 @@ liftoff_layer_create(struct liftoff_output *output)
return NULL;
}
layer->output = output;
- layer->candidate_planes = calloc(sizeof(layer->candidate_planes[0]),
- output->device->planes_cap);
+ layer->candidate_planes = calloc(output->device->planes_cap,
+ sizeof(layer->candidate_planes[0]));
if (layer->candidate_planes == NULL) {
liftoff_log_errno(LIFTOFF_ERROR, "calloc");
free(layer);
--
GitLab