Use correct printf format specifiers for ssize_t

This unbreaks the build on armhf that otherwise fails like

    ../xwayland/selection/incoming.c: In function 'xwm_data_source_write':
    ../include/wlr/util/log.h:34:17: error: format '%ld' expects argument of type 'long int', but argument 6 has type 'ssize_t {aka int}' [-Werror=format=]
      _wlr_log(verb, "[%s:%d] " fmt, wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__)
                     ^
    ../xwayland/selection/incoming.c:34:2: note: in expansion of macro 'wlr_log'
      wlr_log(L_DEBUG, "wrote %zd (chunk size %ld) of %d bytes",
      ^~~~~~~
    ../xwayland/selection/incoming.c:34:44: note: format string is defined here
      wlr_log(L_DEBUG, "wrote %zd (chunk size %ld) of %d bytes",
                                              ~~^
                                              %d
This commit is contained in:
Guido Guenther 2018-04-26 08:40:18 +00:00 committed by Guido Günther
parent a6790d45b2
commit 085452f9d9
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ static int xwm_data_source_write(int fd, uint32_t mask, void *data) {
return 1; return 1;
} }
wlr_log(L_DEBUG, "wrote %ld (chunk size %ld) of %d bytes", wlr_log(L_DEBUG, "wrote %zd (chunk size %zd) of %d bytes",
transfer->property_start + len, transfer->property_start + len,
len, xcb_get_property_value_length(transfer->property_reply)); len, xcb_get_property_value_length(transfer->property_reply));

View File

@ -96,7 +96,7 @@ static int xwm_data_source_read(int fd, uint32_t mask, void *data) {
goto error_out; goto error_out;
} }
wlr_log(L_DEBUG, "read %ld bytes (available %zu, mask 0x%x)", len, wlr_log(L_DEBUG, "read %zd bytes (available %zu, mask 0x%x)", len,
available, mask); available, mask);
transfer->source_data.size = current + len; transfer->source_data.size = current + len;