From ead58945cdd6c53b4f0368f2bd7ff16f3eaa7234 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 8 Jan 2021 19:13:33 +0100 Subject: [PATCH] wip: make wl_array arguments const Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/189 --- src/connection.c | 2 +- src/scanner.c | 2 +- src/wayland-util.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/connection.c b/src/connection.c index d0c7d9fc..f0bbbe73 100644 --- a/src/connection.c +++ b/src/connection.c @@ -527,7 +527,7 @@ wl_argument_from_va_list(const char *signature, union wl_argument *args, args[i].o = va_arg(ap, struct wl_object *); break; case 'a': - args[i].a = va_arg(ap, struct wl_array *); + args[i].a = va_arg(ap, const struct wl_array *); break; case 'h': args[i].h = va_arg(ap, int32_t); diff --git a/src/scanner.c b/src/scanner.c index 36ac905f..dd593e2e 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -1114,7 +1114,7 @@ emit_type(struct arg *a) printf("struct %s *", a->interface_name); break; case ARRAY: - printf("struct wl_array *"); + printf("const struct wl_array *"); break; } } diff --git a/src/wayland-util.h b/src/wayland-util.h index 79977783..c889c260 100644 --- a/src/wayland-util.h +++ b/src/wayland-util.h @@ -687,7 +687,7 @@ union wl_argument { const char *s; /**< `string` */ struct wl_object *o; /**< `object` */ uint32_t n; /**< `new_id` */ - struct wl_array *a; /**< `array` */ + const struct wl_array *a; /**< `array` */ int32_t h; /**< `fd` */ };