Fix incorrect format parameters

This commit is contained in:
Antonin Décimo 2020-06-04 14:33:32 +02:00 committed by Simon Ser
parent 39fd2335bf
commit d9bb792794
13 changed files with 45 additions and 43 deletions

View File

@ -800,7 +800,7 @@ bool drm_connector_set_mode(struct wlr_drm_connector *conn,
return false; return false;
} }
wlr_log(WLR_INFO, "Modesetting '%s' with '%ux%u@%u mHz'", wlr_log(WLR_INFO, "Modesetting '%s' with '%" PRId32 "x%" PRId32 "@%" PRId32 "mHz'",
conn->output.name, wlr_mode->width, wlr_mode->height, conn->output.name, wlr_mode->width, wlr_mode->height,
wlr_mode->refresh); wlr_mode->refresh);

View File

@ -142,7 +142,7 @@ static bool logind_change_vt(struct wlr_session *base, unsigned vt) {
"/org/freedesktop/login1/seat/seat0", "org.freedesktop.login1.Seat", "SwitchTo", "/org/freedesktop/login1/seat/seat0", "org.freedesktop.login1.Seat", "SwitchTo",
&error, &msg, "u", (uint32_t)vt); &error, &msg, "u", (uint32_t)vt);
if (ret < 0) { if (ret < 0) {
wlr_log(WLR_ERROR, "Failed to change to vt '%d'", vt); wlr_log(WLR_ERROR, "Failed to change to vt '%u'", vt);
} }
sd_bus_error_free(&error); sd_bus_error_free(&error);

View File

@ -97,7 +97,7 @@ static void registry_global(void *data, struct wl_registry *registry,
uint32_t name, const char *iface, uint32_t version) { uint32_t name, const char *iface, uint32_t version) {
struct wlr_wl_backend *wl = data; struct wlr_wl_backend *wl = data;
wlr_log(WLR_DEBUG, "Remote wayland global: %s v%d", iface, version); wlr_log(WLR_DEBUG, "Remote wayland global: %s v%" PRIu32, iface, version);
if (strcmp(iface, wl_compositor_interface.name) == 0) { if (strcmp(iface, wl_compositor_interface.name) == 0) {
wl->compositor = wl_registry_bind(registry, name, wl->compositor = wl_registry_bind(registry, name,

View File

@ -267,7 +267,7 @@ void wlr_seat_keyboard_enter(struct wlr_seat *seat,
for (size_t i = 0; i < num_keycodes; ++i) { for (size_t i = 0; i < num_keycodes; ++i) {
uint32_t *p = wl_array_add(&keys, sizeof(uint32_t)); uint32_t *p = wl_array_add(&keys, sizeof(uint32_t));
if (!p) { if (!p) {
wlr_log(WLR_ERROR, "Cannot allocate memory, skipping keycode: %d\n", wlr_log(WLR_ERROR, "Cannot allocate memory, skipping keycode: %" PRIu32 "\n",
keycodes[i]); keycodes[i]);
continue; continue;
} }
@ -449,7 +449,7 @@ void seat_client_create_keyboard(struct wlr_seat_client *seat_client,
for (size_t i = 0; i < num_keycodes; ++i) { for (size_t i = 0; i < num_keycodes; ++i) {
uint32_t *p = wl_array_add(&keys, sizeof(uint32_t)); uint32_t *p = wl_array_add(&keys, sizeof(uint32_t));
if (!p) { if (!p) {
wlr_log(WLR_ERROR, "Cannot allocate memory, skipping keycode: %d\n", wlr_log(WLR_ERROR, "Cannot allocate memory, skipping keycode: %" PRIu32 "\n",
keycodes[i]); keycodes[i]);
continue; continue;
} }

View File

@ -39,7 +39,7 @@ static void subcompositor_handle_get_subsurface(struct wl_client *client,
if (surface == parent) { if (surface == parent) {
wl_resource_post_error(resource, wl_resource_post_error(resource,
WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE,
"%s%d: wl_surface@%d cannot be its own parent", "%s%" PRIu32 ": wl_surface@%" PRIu32 " cannot be its own parent",
msg, id, wl_resource_get_id(surface_resource)); msg, id, wl_resource_get_id(surface_resource));
return; return;
} }
@ -48,7 +48,7 @@ static void subcompositor_handle_get_subsurface(struct wl_client *client,
wlr_subsurface_from_wlr_surface(surface) != NULL) { wlr_subsurface_from_wlr_surface(surface) != NULL) {
wl_resource_post_error(resource, wl_resource_post_error(resource,
WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE,
"%s%d: wl_surface@%d is already a sub-surface", "%s%" PRIu32 ": wl_surface@%" PRIu32 " is already a sub-surface",
msg, id, wl_resource_get_id(surface_resource)); msg, id, wl_resource_get_id(surface_resource));
return; return;
} }
@ -56,7 +56,7 @@ static void subcompositor_handle_get_subsurface(struct wl_client *client,
if (wlr_surface_get_root_surface(parent) == surface) { if (wlr_surface_get_root_surface(parent) == surface) {
wl_resource_post_error(resource, wl_resource_post_error(resource,
WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE, WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE,
"%s%d: wl_surface@%d is an ancestor of parent", "%s%" PRIu32 ": wl_surface@%" PRIu32 " is an ancestor of parent",
msg, id, wl_resource_get_id(surface_resource)); msg, id, wl_resource_get_id(surface_resource));
return; return;
} }

View File

@ -74,7 +74,7 @@ static void layer_surface_handle_ack_configure(struct wl_client *client,
if (!found) { if (!found) {
wl_resource_post_error(resource, wl_resource_post_error(resource,
ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SURFACE_STATE, ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SURFACE_STATE,
"wrong configure serial: %u", serial); "wrong configure serial: %" PRIu32, serial);
return; return;
} }
// Then remove old configures from the list // Then remove old configures from the list
@ -114,7 +114,7 @@ static void layer_surface_handle_set_anchor(struct wl_client *client,
if (anchor > max_anchor) { if (anchor > max_anchor) {
wl_resource_post_error(resource, wl_resource_post_error(resource,
ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_ANCHOR, ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_ANCHOR,
"invalid anchor %d", anchor); "invalid anchor %" PRIu32, anchor);
} }
struct wlr_layer_surface_v1 *surface = layer_surface_from_resource(resource); struct wlr_layer_surface_v1 *surface = layer_surface_from_resource(resource);
@ -187,7 +187,7 @@ static void layer_surface_set_layer(struct wl_client *client,
if (layer > ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) { if (layer > ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) {
wl_resource_post_error(surface->resource, wl_resource_post_error(surface->resource,
ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER, ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER,
"Invalid layer %d", layer); "Invalid layer %" PRIu32, layer);
return; return;
} }
surface->client_pending.layer = layer; surface->client_pending.layer = layer;
@ -403,7 +403,7 @@ static void layer_shell_handle_get_layer_surface(struct wl_client *wl_client,
free(surface); free(surface);
wl_resource_post_error(client_resource, wl_resource_post_error(client_resource,
ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER, ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER,
"Invalid layer %d", layer); "Invalid layer %" PRIu32, layer);
return; return;
} }
surface->namespace = strdup(namespace); surface->namespace = strdup(namespace);

View File

@ -210,7 +210,7 @@ static void params_create_common(struct wl_client *client,
if (buffer->attributes.offset[i] > size) { if (buffer->attributes.offset[i] > size) {
wl_resource_post_error(params_resource, wl_resource_post_error(params_resource,
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS,
"invalid offset %i for plane %d", "invalid offset %" PRIu32 " for plane %d",
buffer->attributes.offset[i], i); buffer->attributes.offset[i], i);
goto err_out; goto err_out;
} }
@ -219,7 +219,7 @@ static void params_create_common(struct wl_client *client,
buffer->attributes.stride[i] == 0) { buffer->attributes.stride[i] == 0) {
wl_resource_post_error(params_resource, wl_resource_post_error(params_resource,
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS, ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS,
"invalid stride %i for plane %d", "invalid stride %" PRIu32 " for plane %d",
buffer->attributes.stride[i], i); buffer->attributes.stride[i], i);
goto err_out; goto err_out;
} }

View File

@ -712,7 +712,7 @@ bool wlr_surface_set_role(struct wlr_surface *surface,
if (surface->role != NULL && surface->role != role) { if (surface->role != NULL && surface->role != role) {
if (error_resource != NULL) { if (error_resource != NULL) {
wl_resource_post_error(error_resource, error_code, wl_resource_post_error(error_resource, error_code,
"Cannot assign role %s to wl_surface@%d, already has role %s\n", "Cannot assign role %s to wl_surface@%" PRIu32 ", already has role %s\n",
role->name, wl_resource_get_id(surface->resource), role->name, wl_resource_get_id(surface->resource),
surface->role->name); surface->role->name);
} }
@ -720,7 +720,7 @@ bool wlr_surface_set_role(struct wlr_surface *surface,
} }
if (surface->role_data != NULL && surface->role_data != role_data) { if (surface->role_data != NULL && surface->role_data != role_data) {
wl_resource_post_error(error_resource, error_code, wl_resource_post_error(error_resource, error_code,
"Cannot reassign role %s to wl_surface@%d," "Cannot reassign role %s to wl_surface@%" PRIu32 ","
"role object still exists", role->name, "role object still exists", role->name,
wl_resource_get_id(surface->resource)); wl_resource_get_id(surface->resource));
return false; return false;
@ -791,7 +791,7 @@ static void subsurface_handle_place_above(struct wl_client *client,
if (!sibling) { if (!sibling) {
wl_resource_post_error(subsurface->resource, wl_resource_post_error(subsurface->resource,
WL_SUBSURFACE_ERROR_BAD_SURFACE, WL_SUBSURFACE_ERROR_BAD_SURFACE,
"%s: wl_surface@%d is not a parent or sibling", "%s: wl_surface@%" PRIu32 "is not a parent or sibling",
"place_above", wl_resource_get_id(sibling_surface->resource)); "place_above", wl_resource_get_id(sibling_surface->resource));
return; return;
} }
@ -818,7 +818,7 @@ static void subsurface_handle_place_below(struct wl_client *client,
if (!sibling) { if (!sibling) {
wl_resource_post_error(subsurface->resource, wl_resource_post_error(subsurface->resource,
WL_SUBSURFACE_ERROR_BAD_SURFACE, WL_SUBSURFACE_ERROR_BAD_SURFACE,
"%s: wl_surface@%d is not a parent or sibling", "%s: wl_surface@%" PRIu32 " is not a parent or sibling",
"place_below", wl_resource_get_id(sibling_surface->resource)); "place_below", wl_resource_get_id(sibling_surface->resource));
return; return;
} }

View File

@ -94,7 +94,7 @@ static void virtual_pointer_axis(struct wl_client *client,
if (axis > WL_POINTER_AXIS_HORIZONTAL_SCROLL) { if (axis > WL_POINTER_AXIS_HORIZONTAL_SCROLL) {
wl_resource_post_error(resource, wl_resource_post_error(resource,
ZWLR_VIRTUAL_POINTER_V1_ERROR_INVALID_AXIS, ZWLR_VIRTUAL_POINTER_V1_ERROR_INVALID_AXIS,
"Invalid enumeration value %d", axis); "Invalid enumeration value %" PRIu32, axis);
return; return;
} }
struct wlr_virtual_pointer_v1 *pointer = struct wlr_virtual_pointer_v1 *pointer =
@ -140,7 +140,7 @@ static void virtual_pointer_axis_source(struct wl_client *client,
if (source > WL_POINTER_AXIS_SOURCE_WHEEL_TILT) { if (source > WL_POINTER_AXIS_SOURCE_WHEEL_TILT) {
wl_resource_post_error(resource, wl_resource_post_error(resource,
ZWLR_VIRTUAL_POINTER_V1_ERROR_INVALID_AXIS_SOURCE, ZWLR_VIRTUAL_POINTER_V1_ERROR_INVALID_AXIS_SOURCE,
"Invalid enumeration value %d", source); "Invalid enumeration value %" PRIu32, source);
return; return;
} }
struct wlr_virtual_pointer_v1 *pointer = struct wlr_virtual_pointer_v1 *pointer =
@ -158,7 +158,7 @@ static void virtual_pointer_axis_stop(struct wl_client *client,
if (axis > WL_POINTER_AXIS_HORIZONTAL_SCROLL) { if (axis > WL_POINTER_AXIS_HORIZONTAL_SCROLL) {
wl_resource_post_error(resource, wl_resource_post_error(resource,
ZWLR_VIRTUAL_POINTER_V1_ERROR_INVALID_AXIS, ZWLR_VIRTUAL_POINTER_V1_ERROR_INVALID_AXIS,
"Invalid enumeration value %d", axis); "Invalid enumeration value %" PRIu32, axis);
return; return;
} }
struct wlr_virtual_pointer_v1 *pointer = struct wlr_virtual_pointer_v1 *pointer =
@ -182,7 +182,7 @@ static void virtual_pointer_axis_discrete(struct wl_client *client,
if (axis > WL_POINTER_AXIS_HORIZONTAL_SCROLL) { if (axis > WL_POINTER_AXIS_HORIZONTAL_SCROLL) {
wl_resource_post_error(resource, wl_resource_post_error(resource,
ZWLR_VIRTUAL_POINTER_V1_ERROR_INVALID_AXIS, ZWLR_VIRTUAL_POINTER_V1_ERROR_INVALID_AXIS,
"Invalid enumeration value %d", axis); "Invalid enumeration value %" PRIu32, axis);
return; return;
} }
struct wlr_virtual_pointer_v1 *pointer = struct wlr_virtual_pointer_v1 *pointer =

View File

@ -24,7 +24,7 @@
*/ */
#define _POSIX_C_SOURCE 200809L #define _POSIX_C_SOURCE 200809L
#include <stdint.h> #include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -245,7 +245,7 @@ struct wlr_xcursor_theme *wlr_xcursor_theme_load(const char *name, int size) {
for (size_t i = 0; i < theme->cursor_count; ++i) { for (size_t i = 0; i < theme->cursor_count; ++i) {
struct wlr_xcursor *c = theme->cursors[i]; struct wlr_xcursor *c = theme->cursors[i];
struct wlr_xcursor_image *i = c->images[0]; struct wlr_xcursor_image *i = c->images[0];
wlr_log(WLR_DEBUG, "%s (%u images) %dx%d+%d,%d", wlr_log(WLR_DEBUG, "%s (%u images) %" PRIu32 "x%" PRIu32 "+%" PRIu32 ",%" PRIu32,
c->name, c->image_count, c->name, c->image_count,
i->width, i->height, i->hotspot_x, i->hotspot_y); i->width, i->height, i->hotspot_x, i->hotspot_y);
} }

View File

@ -192,7 +192,7 @@ int xwm_handle_selection_client_message(struct wlr_xwm *xwm,
drag->source->accepted = accepted; drag->source->accepted = accepted;
wlr_data_source_dnd_action(drag->source, action); wlr_data_source_dnd_action(drag->source, action);
wlr_log(WLR_DEBUG, "DND_STATUS window=%d accepted=%d action=%d", wlr_log(WLR_DEBUG, "DND_STATUS window=%" PRIu32 " accepted=%d action=%d",
target_window, accepted, action); target_window, accepted, action);
return 1; return 1;
} else if (ev->type == xwm->atoms[DND_FINISHED]) { } else if (ev->type == xwm->atoms[DND_FINISHED]) {
@ -226,7 +226,7 @@ int xwm_handle_selection_client_message(struct wlr_xwm *xwm,
wlr_data_source_dnd_finish(source); wlr_data_source_dnd_finish(source);
} }
wlr_log(WLR_DEBUG, "DND_FINISH window=%d performed=%d action=%d", wlr_log(WLR_DEBUG, "DND_FINISH window=%" PRIu32 " performed=%d action=%d",
target_window, performed, action); target_window, performed, action);
return 1; return 1;
} else { } else {

View File

@ -23,9 +23,9 @@ static void xwm_selection_send_notify(struct wlr_xwm *xwm,
.property = success ? req->property : XCB_ATOM_NONE, .property = success ? req->property : XCB_ATOM_NONE,
}; };
wlr_log(WLR_DEBUG, "SendEvent destination=%d SelectionNotify(31) time=%d " wlr_log(WLR_DEBUG, "SendEvent destination=%" PRIu32 " SelectionNotify(31) time=%" PRIu32
"requestor=%d selection=%d target=%d property=%d", req->requestor, " requestor=%" PRIu32 " selection=%" PRIu32 " target=%" PRIu32 " property=%" PRIu32,
req->time, req->requestor, req->selection, req->target, req->requestor, req->time, req->requestor, req->selection, req->target,
selection_notify.property); selection_notify.property);
xcb_send_event(xwm->xcb_conn, xcb_send_event(xwm->xcb_conn,
0, // propagate 0, // propagate

View File

@ -393,8 +393,9 @@ static void read_surface_class(struct wlr_xwm *xwm,
surface->class = NULL; surface->class = NULL;
} }
wlr_log(WLR_DEBUG, "XCB_ATOM_WM_CLASS: %s %s", surface->instance, wlr_log(WLR_DEBUG, "XCB_ATOM_WM_CLASS: %s %s",
surface->class); surface->instance ? surface->instance : "(null)",
surface->class ? surface->class : "(null)");
wlr_signal_emit_safe(&surface->events.set_class, surface); wlr_signal_emit_safe(&surface->events.set_class, surface);
} }
@ -416,7 +417,8 @@ static void read_surface_role(struct wlr_xwm *xwm,
xsurface->role = NULL; xsurface->role = NULL;
} }
wlr_log(WLR_DEBUG, "XCB_ATOM_WM_WINDOW_ROLE: %s", xsurface->role); wlr_log(WLR_DEBUG, "XCB_ATOM_WM_WINDOW_ROLE: %s",
xsurface->role ? xsurface->role : "(null)");
wlr_signal_emit_safe(&xsurface->events.set_role, xsurface); wlr_signal_emit_safe(&xsurface->events.set_role, xsurface);
} }
@ -444,7 +446,7 @@ static void read_surface_title(struct wlr_xwm *xwm,
} }
xsurface->has_utf8_title = is_utf8; xsurface->has_utf8_title = is_utf8;
wlr_log(WLR_DEBUG, "XCB_ATOM_WM_NAME: %s", xsurface->title); wlr_log(WLR_DEBUG, "XCB_ATOM_WM_NAME: %s", xsurface->title ? xsurface->title : "(null)");
wlr_signal_emit_safe(&xsurface->events.set_title, xsurface); wlr_signal_emit_safe(&xsurface->events.set_title, xsurface);
} }
@ -558,7 +560,7 @@ static void read_surface_hints(struct wlr_xwm *xwm,
xsurface->hints->input = true; xsurface->hints->input = true;
} }
wlr_log(WLR_DEBUG, "WM_HINTS (%d)", reply->value_len); wlr_log(WLR_DEBUG, "WM_HINTS (%" PRIu32 ")", reply->value_len);
wlr_signal_emit_safe(&xsurface->events.set_hints, xsurface); wlr_signal_emit_safe(&xsurface->events.set_hints, xsurface);
} }
#else #else
@ -610,7 +612,7 @@ static void read_surface_normal_hints(struct wlr_xwm *xwm,
xsurface->size_hints->max_height = -1; xsurface->size_hints->max_height = -1;
} }
wlr_log(WLR_DEBUG, "WM_NORMAL_HINTS (%d)", reply->value_len); wlr_log(WLR_DEBUG, "WM_NORMAL_HINTS (%" PRIu32 ")", reply->value_len);
} }
#else #else
static void read_surface_normal_hints(struct wlr_xwm *xwm, static void read_surface_normal_hints(struct wlr_xwm *xwm,
@ -654,7 +656,7 @@ static void read_surface_motif_hints(struct wlr_xwm *xwm,
wlr_signal_emit_safe(&xsurface->events.set_decorations, xsurface); wlr_signal_emit_safe(&xsurface->events.set_decorations, xsurface);
} }
wlr_log(WLR_DEBUG, "MOTIF_WM_HINTS (%d)", reply->value_len); wlr_log(WLR_DEBUG, "MOTIF_WM_HINTS (%" PRIu32 ")", reply->value_len);
} }
static void read_surface_net_wm_state(struct wlr_xwm *xwm, static void read_surface_net_wm_state(struct wlr_xwm *xwm,
@ -727,8 +729,8 @@ static void read_surface_property(struct wlr_xwm *xwm,
read_surface_role(xwm, xsurface, reply); read_surface_role(xwm, xsurface, reply);
} else { } else {
char *prop_name = xwm_get_atom_name(xwm, property); char *prop_name = xwm_get_atom_name(xwm, property);
wlr_log(WLR_DEBUG, "unhandled X11 property %u (%s) for window %u", wlr_log(WLR_DEBUG, "unhandled X11 property %" PRIu32 " (%s) for window %" PRIu32,
property, prop_name, xsurface->window_id); property, prop_name ? prop_name : "(null)", xsurface->window_id);
free(prop_name); free(prop_name);
} }
@ -1210,8 +1212,8 @@ static void xwm_handle_wm_protocols_message(struct wlr_xwm *xwm,
surface->pinging = false; surface->pinging = false;
} else { } else {
char *type_name = xwm_get_atom_name(xwm, type); char *type_name = xwm_get_atom_name(xwm, type);
wlr_log(WLR_DEBUG, "unhandled WM_PROTOCOLS client message %u (%s)", wlr_log(WLR_DEBUG, "unhandled WM_PROTOCOLS client message %" PRIu32 " (%s)",
type, type_name); type, type_name ? type_name : "(null)");
free(type_name); free(type_name);
} }
} }
@ -1269,8 +1271,8 @@ static void xwm_handle_client_message(struct wlr_xwm *xwm,
xwm_handle_wm_change_state_message(xwm, ev); xwm_handle_wm_change_state_message(xwm, ev);
} else if (!xwm_handle_selection_client_message(xwm, ev)) { } else if (!xwm_handle_selection_client_message(xwm, ev)) {
char *type_name = xwm_get_atom_name(xwm, ev->type); char *type_name = xwm_get_atom_name(xwm, ev->type);
wlr_log(WLR_DEBUG, "unhandled x11 client message %u (%s)", ev->type, wlr_log(WLR_DEBUG, "unhandled x11 client message %" PRIu32 " (%s)", ev->type,
type_name); type_name ? type_name : "(null)");
free(type_name); free(type_name);
} }
} }
@ -1596,7 +1598,7 @@ static void xwm_get_resources(struct wlr_xwm *xwm) {
xfixes_reply = xfixes_reply =
xcb_xfixes_query_version_reply(xwm->xcb_conn, xfixes_cookie, NULL); xcb_xfixes_query_version_reply(xwm->xcb_conn, xfixes_cookie, NULL);
wlr_log(WLR_DEBUG, "xfixes version: %d.%d", wlr_log(WLR_DEBUG, "xfixes version: %" PRIu32 ".%" PRIu32,
xfixes_reply->major_version, xfixes_reply->minor_version); xfixes_reply->major_version, xfixes_reply->minor_version);
free(xfixes_reply); free(xfixes_reply);