short_options = malloc(sizeof(char) * (len + 1) * 2);
if (!short_options) {
- log_error("cannot allocate enough memory to parse command line arguments (%d): %m");
+ log_error("cannot allocate enough memory to parse command line arguments (%d): %m", errno);
return -ENOMEM;
}
long_options = malloc(sizeof(struct option) * len * 2);
if (!long_options) {
- log_error("cannot allocate enough memory to parse command line arguments (%d): %m");
+ log_error("cannot allocate enough memory to parse command line arguments (%d): %m", errno);
free(short_options);
return -ENOMEM;
}
*/
#include <errno.h>
+#include <inttypes.h>
#include <pthread.h>
#include <signal.h>
#include <stdbool.h>
return llog_dEINVAL(llog);
if (val == 0xffffffffffffffffULL) {
- llog_dwarning(llog, "increasing counter with invalid value %llu", val);
+ llog_dwarning(llog, "increasing counter with invalid value %" PRIu64, val);
return -EINVAL;;
}
ret = write(fd, &val, sizeof(val));
if (ret < 0) {
if (errno == EAGAIN)
- llog_dwarning(llog, "eventfd overflow while writing %llu", val);
+ llog_dwarning(llog, "eventfd overflow while writing %" PRIu64, val);
else
llog_dwarning(llog, "eventfd write error (%d): %m", errno);
return -EFAULT;
ep = realloc(loop->cur_fds, sizeof(struct epoll_event) *
loop->cur_fds_size * 2);
if (!ep) {
- llog_warning(loop, "cannot reallocate dispatch cache to size %u",
+ llog_warning(loop, "cannot reallocate dispatch cache to size %zu",
loop->cur_fds_size * 2);
} else {
loop->cur_fds = ep;
if (!appname)
appname = "<unknown>";
log_format(LOG_DEFAULT_CONF, NULL, LOG_NOTICE,
- "%s Build #%u %s %s", appname,
+ "%s Build #%lu %s %s", appname,
log_build, __DATE__, __TIME__);
}
#include <errno.h>
#include <fcntl.h>
+#include <inttypes.h>
#include <pthread.h>
#include <pty.h>
#include <signal.h>
if (info->ssi_pid != pty->child)
return;
- log_info("child exited: pid: %u status: %d utime: %llu stime: %llu",
+ log_info("child exited: pid: %u status: %d utime: %" PRIu64 " stime: %" PRIu64,
info->ssi_pid, info->ssi_status,
info->ssi_utime, info->ssi_stime);
*/
#include <errno.h>
+#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include "eloop.h"
unsigned int min_cols;
unsigned int min_rows;
- unsigned int fps;
+ unsigned long fps;
unsigned int redraw;
struct ev_timer *redraw_timer;
struct tsm_screen *console;
* ev_timer_enable/disable() all the time. */
if (num > 1)
- log_debug("CPU is too slow; skipping %llu frames", num - 1);
+ log_debug("CPU is too slow; skipping %" PRIu64 " frames", num - 1);
if (term->redraw-- != term->fps) {
if (!term->redraw) {
scr = malloc(sizeof(*scr));
if (!scr) {
- log_error("cannot allocate memory for display %p");
+ log_error("cannot allocate memory for display %p", disp);
return -ENOMEM;
}
memset(scr, 0, sizeof(*scr));
goto err_tex;
}
- log_debug("new atlas of size %ux%u for %u", width, height, newsize);
+ log_debug("new atlas of size %ux%u for %zu", width, height, newsize);
nsize = txt->cols * txt->rows;
*/
#include <errno.h>
+#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
if (con->opts & TSM_SCREEN_OPT_RENDER_TIMING)
llog_debug(con,
- "timing: sum: %llu prepare: %llu draw: %llu render: %llu",
+ "timing: sum: %" PRIu64 " prepare: %" PRIu64 " draw: %" PRIu64 " render: %" PRIu64,
time_prep + time_draw + time_rend,
time_prep, time_draw, time_rend);
}
&ledbits);
if (ret == -1)
log_warn("cannot read LED state of %s (%d): %m",
- errno, dev->node);
+ dev->node, errno);
}
/* rediscover the keyboard state if sth changed during sleep */
dp_global,
disp);
if (!disp->dp_listener) {
- log_error("cannot add wayland global listener (%d)");
+ log_error("cannot add wayland global listener (%d)", errno);
goto err_timer;
}