diff options
author | Guido Günther <agx@sigxcpu.org> | 2018-01-26 20:59:47 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2018-01-27 12:23:26 +0100 |
commit | 1633b8d793515464b56fe58d1eb62345db04c119 (patch) | |
tree | 16924342c521cf116ce6a4a18fae935b3c61e63d | |
parent | 174d1aa81bac9d8795e7047686d51c5b7e75d578 (diff) |
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
-rw-r--r-- | types/wlr_keyboard.c | 4 |
1 files 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); |