treewide: Migrate from sizeof(struct) to sizeof(*pointer) where practical

This commit is contained in:
Alexander Orzechowski 2023-10-03 01:51:07 -04:00
parent a09d649439
commit 1b0694b794
99 changed files with 224 additions and 355 deletions

View file

@ -127,8 +127,7 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
}
struct wlr_backend *wlr_multi_backend_create(struct wl_display *display) {
struct wlr_multi_backend *backend =
calloc(1, sizeof(struct wlr_multi_backend));
struct wlr_multi_backend *backend = calloc(1, sizeof(*backend));
if (!backend) {
wlr_log(WLR_ERROR, "Backend allocation failed");
return NULL;
@ -191,7 +190,7 @@ bool wlr_multi_backend_add(struct wlr_backend *_multi,
return true;
}
struct subbackend_state *sub = calloc(1, sizeof(struct subbackend_state));
struct subbackend_state *sub = calloc(1, sizeof(*sub));
if (sub == NULL) {
wlr_log(WLR_ERROR, "Could not add backend: allocation failed");
return false;