mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
Make NEW_IDs nullable
The connection-handling code already allows this, so make it legal in the protocol definition too. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
efe23443d8
commit
db0add6d5e
3 changed files with 48 additions and 6 deletions
|
|
@ -479,19 +479,29 @@ create_proxies(struct wl_display *display, struct wl_closure *closure)
|
|||
{
|
||||
struct wl_proxy *proxy;
|
||||
const char *signature;
|
||||
struct argument_details arg;
|
||||
uint32_t id;
|
||||
int i;
|
||||
int count;
|
||||
|
||||
signature = closure->message->signature;
|
||||
for (i = 0; signature[i]; i++) {
|
||||
switch (signature[i]) {
|
||||
count = arg_count_for_signature(signature) + 2;
|
||||
for (i = 2; i < count; i++) {
|
||||
signature = get_next_argument(signature, &arg);
|
||||
switch (arg.type) {
|
||||
case 'n':
|
||||
id = **(uint32_t **) closure->args[i + 2];
|
||||
id = **(uint32_t **) closure->args[i];
|
||||
if (id == 0) {
|
||||
*(void **) closure->args[i] = NULL;
|
||||
break;
|
||||
}
|
||||
proxy = wl_proxy_create_for_id(&display->proxy, id,
|
||||
closure->message->types[i]);
|
||||
closure->message->types[i - 2]);
|
||||
if (proxy == NULL)
|
||||
return -1;
|
||||
*(void **) closure->args[i + 2] = proxy;
|
||||
*(void **) closure->args[i] = proxy;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue