mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2024-11-16 19:47:55 +01:00
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
This commit is contained in:
parent
4124ee8c7a
commit
29a06add8e
1 changed files with 2 additions and 2 deletions
4
layer.c
4
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);
|
||||
|
|
Loading…
Reference in a new issue