aboutsummaryrefslogtreecommitdiff
path: root/examples/rotation.c
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-10-03 01:51:07 -0400
committerAlexander Orzechowski <alex@ozal.ski>2023-10-03 01:51:07 -0400
commit1b0694b79481643cb456d03e1be50a1b4f6ca591 (patch)
treec693c5de3ee7ebd52873f6ec063118408f0bd28a /examples/rotation.c
parenta09d6494397bdd28a3254d2e646212afb5a3049c (diff)
treewide: Migrate from sizeof(struct) to sizeof(*pointer) where practical
Diffstat (limited to 'examples/rotation.c')
-rw-r--r--examples/rotation.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/rotation.c b/examples/rotation.c
index e092a363..203b208e 100644
--- a/examples/rotation.c
+++ b/examples/rotation.c
@@ -119,7 +119,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));
sample_output->x_offs = sample_output->y_offs = 0;
sample_output->x_vel = sample_output->y_vel = 128;
@@ -187,7 +187,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);