server: improve wl_registry.bind error messages

- Consistently use PRIu32 for global names (uint32_t)
- Use expected/got instead of have/wanted (which were used differently anyway)

Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
This commit is contained in:
Kirill Primak 2026-03-03 21:07:42 +03:00 committed by Simon Ser
parent 69aabecd18
commit 13d906a629

View file

@ -1061,18 +1061,17 @@ registry_bind(struct wl_client *client,
else if (strcmp(global->interface->name, interface) != 0)
wl_resource_post_error(resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
"invalid interface for global %u: "
"have %s, wanted %s",
name, interface, global->interface->name);
"invalid interface for global %"PRIu32": expected %s, got %s",
name, global->interface->name, interface);
else if (version == 0)
wl_resource_post_error(resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
"invalid version for global %s (%d): 0 is not a valid version",
"invalid version for global %s (%"PRIu32"): 0 is not a valid version",
interface, name);
else if (global->version < version)
wl_resource_post_error(resource,
WL_DISPLAY_ERROR_INVALID_OBJECT,
"invalid version for global %s (%d): have %d, wanted %d",
"invalid version for global %s (%"PRIu32"): expected at most %d, got %d",
interface, name, global->version, version);
else
global->bind(client, global->data, version, id);