screen-share: define variable type before using as function argument
authorLeandro Ribeiro <leandrohr@riseup.net>
Tue, 3 Dec 2019 21:32:05 +0000 (18:32 -0300)
committerDaniel Stone <daniel@fooishbar.org>
Wed, 11 Dec 2019 19:36:57 +0000 (19:36 +0000)
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>
compositor/screen-share.c

index a2b2159410e3a36e6f333eff02ded4f7a0cff32a..c8256faca2a8d2ce5a1195171466f16a6ab3f375 100644 (file)
@@ -819,6 +819,7 @@ shared_output_repainted(struct wl_listener *listener, void *data)
        struct shared_output *so =
                container_of(listener, struct shared_output, frame_listener);
        pixman_region32_t damage;
+       pixman_region32_t *current_damage = data;
        struct ss_shm_buffer *sb;
        int32_t x, y, width, height, stride;
        int i, nrects, do_yflip, y_orig;
@@ -847,7 +848,7 @@ shared_output_repainted(struct wl_listener *listener, void *data)
        } else {
                /* Damage in output coordinates */
                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);
        }