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
This commit is contained in:
Guido Günther 2018-01-26 20:59:47 +01:00
parent 174d1aa81b
commit 1633b8d793

View file

@ -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);