mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
Introduce enum wl_arg_type
This is less cryptic to read than letters, and allows the compiler to check switch statements exhaustiveness. Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
parent
47de87263c
commit
155dd63b58
4 changed files with 111 additions and 92 deletions
|
|
@ -191,8 +191,8 @@ verify_objects(struct wl_resource *resource, uint32_t opcode,
|
|||
for (i = 0; i < count; i++) {
|
||||
signature = get_next_argument(signature, &arg);
|
||||
switch (arg.type) {
|
||||
case 'n':
|
||||
case 'o':
|
||||
case WL_ARG_NEW_ID:
|
||||
case WL_ARG_OBJECT:
|
||||
res = (struct wl_resource *) (args[i].o);
|
||||
if (res && res->client != resource->client) {
|
||||
wl_log("compositor bug: The compositor "
|
||||
|
|
@ -202,6 +202,8 @@ verify_objects(struct wl_resource *resource, uint32_t opcode,
|
|||
object->interface->events[opcode].name);
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue