From 1b0694b79481643cb456d03e1be50a1b4f6ca591 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Tue, 3 Oct 2023 01:51:07 -0400 Subject: treewide: Migrate from sizeof(struct) to sizeof(*pointer) where practical --- examples/output-layout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/output-layout.c') diff --git a/examples/output-layout.c b/examples/output-layout.c index 99d403e0..de5217e4 100644 --- a/examples/output-layout.c +++ b/examples/output-layout.c @@ -168,7 +168,7 @@ static void new_output_notify(struct wl_listener *listener, void *data) { wlr_output_init_render(output, sample->allocator, sample->renderer); - struct sample_output *sample_output = calloc(1, sizeof(struct sample_output)); + struct sample_output *sample_output = calloc(1, sizeof(*sample_output)); wlr_output_layout_add_auto(sample->layout, output); sample_output->output = output; sample_output->sample = sample; @@ -236,7 +236,7 @@ static void new_input_notify(struct wl_listener *listener, void *data) { struct sample_state *sample = wl_container_of(listener, sample, new_input); switch (device->type) { case WLR_INPUT_DEVICE_KEYBOARD:; - struct sample_keyboard *keyboard = calloc(1, sizeof(struct sample_keyboard)); + struct sample_keyboard *keyboard = calloc(1, sizeof(*keyboard)); keyboard->wlr_keyboard = wlr_keyboard_from_input_device(device); keyboard->sample = sample; wl_signal_add(&device->events.destroy, &keyboard->destroy); -- cgit v1.2.3