aboutsummaryrefslogtreecommitdiff
path: root/examples/pointer.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/pointer.c')
-rw-r--r--examples/pointer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/pointer.c b/examples/pointer.c
index 86986503..5d9de33b 100644
--- a/examples/pointer.c
+++ b/examples/pointer.c
@@ -194,7 +194,7 @@ static void handle_touch_up(struct wl_listener *listener, void *data) {
static void handle_touch_down(struct wl_listener *listener, void *data) {
struct sample_state *sample = wl_container_of(listener, sample, touch_down);
struct wlr_touch_down_event *event = data;
- struct touch_point *point = calloc(1, sizeof(struct touch_point));
+ struct touch_point *point = calloc(1, sizeof(*point));
point->touch_id = event->touch_id;
point->x = event->x;
point->y = event->y;
@@ -266,7 +266,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->output = output;
sample_output->state = sample;
wl_signal_add(&output->events.frame, &sample_output->frame);
@@ -305,7 +305,7 @@ static void new_input_notify(struct wl_listener *listener, void *data) {
break;
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->state = state;
wl_signal_add(&device->events.destroy, &keyboard->destroy);