From 1633b8d793515464b56fe58d1eb62345db04c119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 26 Jan 2018 20:59:47 +0100 Subject: [PATCH] wlr_keyboard: use correct printf format string for keymap_size keymap_size is a size_t. Otherwise the build fails on arm like ../types/wlr_keyboard.c: In function 'wlr_keyboard_set_keymap': ../include/wlr/util/log.h:34:17: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Werror=format=] _wlr_log(verb, "[%s:%d] " fmt, _strip_path(__FILE__), __LINE__, ##__VA_ARGS__) ^ ../types/wlr_keyboard.c:218:3: note: in expansion of macro 'wlr_log' wlr_log(L_ERROR, "creating a keymap file for %lu bytes failed", kb->keymap_size); ^~~~~~~ ../types/wlr_keyboard.c:218:50: note: format string is defined here wlr_log(L_ERROR, "creating a keymap file for %lu bytes failed", kb->keymap_size); ~~^ %u --- types/wlr_keyboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/wlr_keyboard.c b/types/wlr_keyboard.c index b0dc97aa..29552eb4 100644 --- a/types/wlr_keyboard.c +++ b/types/wlr_keyboard.c @@ -215,13 +215,13 @@ void wlr_keyboard_set_keymap(struct wlr_keyboard *kb, } kb->keymap_fd = os_create_anonymous_file(kb->keymap_size); if (kb->keymap_fd < 0) { - wlr_log(L_ERROR, "creating a keymap file for %lu bytes failed", kb->keymap_size); + wlr_log(L_ERROR, "creating a keymap file for %zu bytes failed", kb->keymap_size); goto err; } void *ptr = mmap(NULL, kb->keymap_size, PROT_READ | PROT_WRITE, MAP_SHARED, kb->keymap_fd, 0); if (ptr == (void*)-1) { - wlr_log(L_ERROR, "failed to mmap() %lu bytes", kb->keymap_size); + wlr_log(L_ERROR, "failed to mmap() %zu bytes", kb->keymap_size); goto err; } strcpy(ptr, keymap_str);