From 315e022f2fda159e1e92620e19cc6e436f6604c3 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 10 May 2024 09:38:20 +0200 Subject: [PATCH] backend/drm: fix swapped calloc() arguments in get_or_create_layer() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../backend/drm/drm.c:415:49: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 415 | layer->candidate_planes = calloc(sizeof(bool), drm->num_planes); | ^~~~ --- backend/drm/drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 7489d78f..2f4a74d1 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -412,7 +412,7 @@ static struct wlr_drm_layer *get_or_create_layer(struct wlr_drm_backend *drm, abort(); // unreachable #endif - layer->candidate_planes = calloc(sizeof(bool), drm->num_planes); + layer->candidate_planes = calloc(drm->num_planes, sizeof(layer->candidate_planes[0])); if (layer->candidate_planes == NULL) { #if HAVE_LIBLIFTOFF liftoff_layer_destroy(layer->liftoff);