screen-share: define variable type before using as function argument

Define the void pointer as pixman_region32_t instead of using it
directly.

Void pointers are used by generic API's so each user can define
a data type as needed. Not doing this is dangerous, since void
pointers implicitly cast from/to any pointer without giving
warnings. So we must define its type instead of using it directly
in a function call.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
dev
Leandro Ribeiro 5 years ago committed by Daniel Stone
parent 1b3ad0993b
commit 2a6cfef07e
  1. 3
      compositor/screen-share.c

@ -819,6 +819,7 @@ shared_output_repainted(struct wl_listener *listener, void *data)
struct shared_output *so = struct shared_output *so =
container_of(listener, struct shared_output, frame_listener); container_of(listener, struct shared_output, frame_listener);
pixman_region32_t damage; pixman_region32_t damage;
pixman_region32_t *current_damage = data;
struct ss_shm_buffer *sb; struct ss_shm_buffer *sb;
int32_t x, y, width, height, stride; int32_t x, y, width, height, stride;
int i, nrects, do_yflip, y_orig; int i, nrects, do_yflip, y_orig;
@ -847,7 +848,7 @@ shared_output_repainted(struct wl_listener *listener, void *data)
} else { } else {
/* Damage in output coordinates */ /* Damage in output coordinates */
pixman_region32_init(&damage); pixman_region32_init(&damage);
pixman_region32_intersect(&damage, &so->output->region, data); pixman_region32_intersect(&damage, &so->output->region, current_damage);
pixman_region32_translate(&damage, -so->output->x, -so->output->y); pixman_region32_translate(&damage, -so->output->x, -so->output->y);
} }

Loading…
Cancel
Save