More consistent ID printing

Use unsigned rather than signed for IDs, so they match up with what we
see in other prints.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
Daniel Stone 2012-07-23 19:54:42 +01:00 committed by Kristian Høgsberg
parent db0add6d5e
commit 3ec40512c7
4 changed files with 16 additions and 16 deletions

View file

@ -738,7 +738,7 @@ wl_connection_demarshal(struct wl_connection *connection,
* destroyed client side */ * destroyed client side */
*object = NULL; *object = NULL;
} else if (*object == NULL && *p != 0) { } else if (*object == NULL && *p != 0) {
printf("unknown object (%d), message %s(%s)\n", printf("unknown object (%u), message %s(%s)\n",
*p, message->name, message->signature); *p, message->name, message->signature);
*object = NULL; *object = NULL;
errno = EINVAL; errno = EINVAL;
@ -747,7 +747,7 @@ wl_connection_demarshal(struct wl_connection *connection,
if (*object != NULL && message->types[i-2] != NULL && if (*object != NULL && message->types[i-2] != NULL &&
(*object)->interface != message->types[i-2]) { (*object)->interface != message->types[i-2]) {
printf("invalid object (%d), type (%s), " printf("invalid object (%u), type (%s), "
"message %s(%s)\n", "message %s(%s)\n",
*p, (*object)->interface->name, *p, (*object)->interface->name,
message->name, message->signature); message->name, message->signature);

View file

@ -203,14 +203,14 @@ wl_proxy_marshal(struct wl_proxy *proxy, uint32_t opcode, ...)
abort(); abort();
} }
if (wl_debug)
wl_closure_print(closure, &proxy->object, true);
if (wl_closure_send(closure, proxy->display->connection)) { if (wl_closure_send(closure, proxy->display->connection)) {
fprintf(stderr, "Error sending request: %m\n"); fprintf(stderr, "Error sending request: %m\n");
abort(); abort();
} }
if (wl_debug)
wl_closure_print(closure, &proxy->object, true);
wl_closure_destroy(closure); wl_closure_destroy(closure);
} }
@ -235,7 +235,7 @@ display_handle_error(void *data,
struct wl_display *display, struct wl_object *object, struct wl_display *display, struct wl_object *object,
uint32_t code, const char *message) uint32_t code, const char *message)
{ {
fprintf(stderr, "%s@%d: error %d: %s\n", fprintf(stderr, "%s@%u: error %d: %s\n",
object->interface->name, object->id, code, message); object->interface->name, object->id, code, message);
abort(); abort();
} }
@ -531,14 +531,14 @@ handle_event(struct wl_display *display,
closure = wl_connection_demarshal(display->connection, size, closure = wl_connection_demarshal(display->connection, size,
&display->objects, message); &display->objects, message);
if (wl_debug)
wl_closure_print(closure, &proxy->object, false);
if (closure == NULL || create_proxies(display, closure) < 0) { if (closure == NULL || create_proxies(display, closure) < 0) {
fprintf(stderr, "Error demarshalling event\n"); fprintf(stderr, "Error demarshalling event\n");
abort(); abort();
} }
if (wl_debug)
wl_closure_print(closure, &proxy->object, false);
wl_closure_invoke(closure, &proxy->object, wl_closure_invoke(closure, &proxy->object,
proxy->object.implementation[opcode], proxy->object.implementation[opcode],
proxy->user_data); proxy->user_data);

View file

@ -243,7 +243,7 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)
if (resource == NULL) { if (resource == NULL) {
wl_resource_post_error(client->display_resource, wl_resource_post_error(client->display_resource,
WL_DISPLAY_ERROR_INVALID_OBJECT, WL_DISPLAY_ERROR_INVALID_OBJECT,
"invalid object %d", p[0]); "invalid object %u", p[0]);
break; break;
} }
@ -251,7 +251,7 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)
if (opcode >= object->interface->method_count) { if (opcode >= object->interface->method_count) {
wl_resource_post_error(client->display_resource, wl_resource_post_error(client->display_resource,
WL_DISPLAY_ERROR_INVALID_METHOD, WL_DISPLAY_ERROR_INVALID_METHOD,
"invalid method %d, object %s@%d", "invalid method %d, object %s@%u",
opcode, opcode,
object->interface->name, object->interface->name,
object->id); object->id);
@ -263,10 +263,13 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)
&client->objects, message); &client->objects, message);
len -= size; len -= size;
if (wl_debug)
wl_closure_print(closure, object, false);
if (closure == NULL && errno == EINVAL) { if (closure == NULL && errno == EINVAL) {
wl_resource_post_error(client->display_resource, wl_resource_post_error(client->display_resource,
WL_DISPLAY_ERROR_INVALID_METHOD, WL_DISPLAY_ERROR_INVALID_METHOD,
"invalid arguments for %s@%d.%s", "invalid arguments for %s@%u.%s",
object->interface->name, object->interface->name,
object->id, object->id,
message->name); message->name);
@ -278,9 +281,6 @@ wl_client_connection_data(int fd, uint32_t mask, void *data)
deref_new_objects(closure); deref_new_objects(closure);
if (wl_debug)
wl_closure_print(closure, object, false);
wl_closure_invoke(closure, object, wl_closure_invoke(closure, object,
object->implementation[opcode], client); object->implementation[opcode], client);

View file

@ -236,7 +236,7 @@ TEST(connection_marshal)
marshal(&data, "n", 12, &object); marshal(&data, "n", 12, &object);
assert(data.buffer[2] == object.id); assert(data.buffer[2] == object.id);
marshal(&data, "n", 12, NULL); marshal(&data, "?n", 12, NULL);
assert(data.buffer[2] == 0); assert(data.buffer[2] == 0);
array.data = (void *) text; array.data = (void *) text;