From 818fc4a87b9ea6b7174443e19c1a7c2756b3c002 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 9 Dec 2021 16:39:09 +0100 Subject: [PATCH] Fix incorrect %zd formatting directives %zd is for ssize_t. For size_t we should use %zu. --- backend/headless/output.c | 4 ++-- backend/wayland/output.c | 4 ++-- backend/x11/output.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/headless/output.c b/backend/headless/output.c index fbec8110a..f03d6ee0d 100644 --- a/backend/headless/output.c +++ b/backend/headless/output.c @@ -118,12 +118,12 @@ struct wlr_output *wlr_headless_add_output(struct wlr_backend *wlr_backend, strncpy(wlr_output->model, "headless", sizeof(wlr_output->model)); char name[64]; - snprintf(name, sizeof(name), "HEADLESS-%zd", ++backend->last_output_num); + snprintf(name, sizeof(name), "HEADLESS-%zu", ++backend->last_output_num); wlr_output_set_name(wlr_output, name); char description[128]; snprintf(description, sizeof(description), - "Headless output %zd", backend->last_output_num); + "Headless output %zu", backend->last_output_num); wlr_output_set_description(wlr_output, description); struct wl_event_loop *ev = wl_display_get_event_loop(backend->display); diff --git a/backend/wayland/output.c b/backend/wayland/output.c index 27195592d..de5d42edd 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -522,12 +522,12 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *wlr_backend) { strncpy(wlr_output->model, "wayland", sizeof(wlr_output->model)); char name[64]; - snprintf(name, sizeof(name), "WL-%zd", ++backend->last_output_num); + snprintf(name, sizeof(name), "WL-%zu", ++backend->last_output_num); wlr_output_set_name(wlr_output, name); char description[128]; snprintf(description, sizeof(description), - "Wayland output %zd", backend->last_output_num); + "Wayland output %zu", backend->last_output_num); wlr_output_set_description(wlr_output, description); output->backend = backend; diff --git a/backend/x11/output.c b/backend/x11/output.c index 25194e708..b87b08dc5 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -513,14 +513,14 @@ struct wlr_output *wlr_x11_output_create(struct wlr_backend *backend) { wlr_output_update_custom_mode(wlr_output, 1024, 768, 0); char name[64]; - snprintf(name, sizeof(name), "X11-%zd", ++x11->last_output_num); + snprintf(name, sizeof(name), "X11-%zu", ++x11->last_output_num); wlr_output_set_name(wlr_output, name); parse_xcb_setup(wlr_output, x11->xcb); char description[128]; snprintf(description, sizeof(description), - "X11 output %zd", x11->last_output_num); + "X11 output %zu", x11->last_output_num); wlr_output_set_description(wlr_output, description); // The X11 protocol requires us to set a colormap and border pixel if the