diff --git a/client.c b/client.c index 5458dfc9..6d4b8a5a 100644 --- a/client.c +++ b/client.c @@ -557,7 +557,7 @@ client_dispatch_wait(void *data0) data = imsg.data; datalen = imsg.hdr.len - IMSG_HEADER_SIZE; - log_debug("got %d from server", imsg.hdr.type); + log_debug("got %u from server", imsg.hdr.type); switch (imsg.hdr.type) { case MSG_EXIT: case MSG_SHUTDOWN: @@ -604,7 +604,7 @@ client_dispatch_wait(void *data0) fatalx("bad MSG_VERSION size"); fprintf(stderr, "protocol version mismatch " - "(client %u, server %u)\n", PROTOCOL_VERSION, + "(client %d, server %u)\n", PROTOCOL_VERSION, imsg.hdr.peerid); client_exitval = 1; @@ -648,7 +648,7 @@ client_dispatch_attached(void) data = imsg.data; datalen = imsg.hdr.len - IMSG_HEADER_SIZE; - log_debug("got %d from server", imsg.hdr.type); + log_debug("got %u from server", imsg.hdr.type); switch (imsg.hdr.type) { case MSG_DETACH: case MSG_DETACHKILL: diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c index ce60b4c5..b44ebe9d 100644 --- a/cmd-capture-pane.c +++ b/cmd-capture-pane.c @@ -74,7 +74,7 @@ cmd_capture_pane_pending(struct args *args, struct window_pane *wp, tmp[0] = line[i]; tmp[1] = '\0'; } else - xsnprintf(tmp, sizeof tmp, "\\%03o", line[i]); + xsnprintf(tmp, sizeof tmp, "\\%03hho", line[i]); buf = cmd_capture_pane_append(buf, len, tmp, strlen(tmp)); } diff --git a/cmd-respawn-pane.c b/cmd-respawn-pane.c index 47031539..6575e8e4 100644 --- a/cmd-respawn-pane.c +++ b/cmd-respawn-pane.c @@ -59,7 +59,7 @@ cmd_respawn_pane_exec(struct cmd *self, struct cmd_q *cmdq) if (!args_has(self->args, 'k') && wp->fd != -1) { if (window_pane_index(wp, &idx) != 0) fatalx("index not found"); - cmdq_error(cmdq, "pane still active: %s:%u.%u", + cmdq_error(cmdq, "pane still active: %s:%d.%u", s->name, wl->idx, idx); return (CMD_RETURN_ERROR); } diff --git a/colour.c b/colour.c index b5efd6f1..82f8533a 100644 --- a/colour.c +++ b/colour.c @@ -147,7 +147,7 @@ colour_tostring(int c) static char s[32]; if (c & 0x100) { - xsnprintf(s, sizeof s, "colour%u", c & ~0x100); + xsnprintf(s, sizeof s, "colour%d", c & ~0x100); return (s); } diff --git a/format.c b/format.c index 01fa3ade..92271753 100644 --- a/format.c +++ b/format.c @@ -503,7 +503,7 @@ format_defaults_session(struct format_tree *ft, struct session *s) format_add(ft, "session_created_string", "%s", tim); format_add(ft, "session_attached", "%u", s->attached); - format_add(ft, "session_many_attached", "%u", s->attached > 1); + format_add(ft, "session_many_attached", "%d", s->attached > 1); } /* Set default format keys for a client. */ @@ -572,7 +572,7 @@ format_defaults_window(struct format_tree *ft, struct window *w) format_add(ft, "window_height", "%u", w->sy); format_add(ft, "window_layout", "%s", layout); format_add(ft, "window_panes", "%u", window_count_panes(w)); - format_add(ft, "window_zoomed_flag", "%u", + format_add(ft, "window_zoomed_flag", "%d", !!(w->flags & WINDOW_ZOOMED)); free(layout); @@ -597,13 +597,13 @@ format_defaults_winlink(struct format_tree *ft, struct session *s, format_add(ft, "window_flags", "%s", flags); format_add(ft, "window_active", "%d", wl == s->curw); - format_add(ft, "window_bell_flag", "%u", + format_add(ft, "window_bell_flag", "%d", !!(wl->flags & WINLINK_BELL)); - format_add(ft, "window_activity_flag", "%u", + format_add(ft, "window_activity_flag", "%d", !!(wl->flags & WINLINK_ACTIVITY)); - format_add(ft, "window_silence_flag", "%u", + format_add(ft, "window_silence_flag", "%d", !!(wl->flags & WINLINK_SILENCE)); - format_add(ft, "window_last_flag", "%u", + format_add(ft, "window_last_flag", "%d", !!(wl == TAILQ_FIRST(&s->lastw))); free(flags); @@ -623,7 +623,7 @@ format_defaults_pane_tabs(struct format_tree *ft, struct window_pane *wp) if (EVBUFFER_LENGTH(buffer) > 0) evbuffer_add(buffer, ",", 1); - evbuffer_add_printf(buffer, "%d", i); + evbuffer_add_printf(buffer, "%u", i); } format_add(ft, "pane_tabs", "%.*s", (int) EVBUFFER_LENGTH(buffer), @@ -694,16 +694,16 @@ format_defaults_pane(struct format_tree *ft, struct window_pane *wp) free(cmd); } - format_add(ft, "cursor_x", "%d", wp->base.cx); - format_add(ft, "cursor_y", "%d", wp->base.cy); - format_add(ft, "scroll_region_upper", "%d", wp->base.rupper); - format_add(ft, "scroll_region_lower", "%d", wp->base.rlower); - format_add(ft, "saved_cursor_x", "%d", wp->ictx.old_cx); - format_add(ft, "saved_cursor_y", "%d", wp->ictx.old_cy); + format_add(ft, "cursor_x", "%u", wp->base.cx); + format_add(ft, "cursor_y", "%u", wp->base.cy); + format_add(ft, "scroll_region_upper", "%u", wp->base.rupper); + format_add(ft, "scroll_region_lower", "%u", wp->base.rlower); + format_add(ft, "saved_cursor_x", "%u", wp->ictx.old_cx); + format_add(ft, "saved_cursor_y", "%u", wp->ictx.old_cy); format_add(ft, "alternate_on", "%d", wp->saved_grid ? 1 : 0); - format_add(ft, "alternate_saved_x", "%d", wp->saved_cx); - format_add(ft, "alternate_saved_y", "%d", wp->saved_cy); + format_add(ft, "alternate_saved_x", "%u", wp->saved_cx); + format_add(ft, "alternate_saved_y", "%u", wp->saved_cy); format_add(ft, "cursor_flag", "%d", !!(wp->base.mode & MODE_CURSOR)); diff --git a/input-keys.c b/input-keys.c index 040a0605..f2d010d8 100644 --- a/input-keys.c +++ b/input-keys.c @@ -219,7 +219,7 @@ input_mouse(struct window_pane *wp, struct session *s, struct mouse_event *m) * legacy format. */ if (m->sgr && (wp->screen->mode & MODE_MOUSE_SGR)) { - len = xsnprintf(buf, sizeof buf, "\033[<%d;%d;%d%c", + len = xsnprintf(buf, sizeof buf, "\033[<%u;%u;%u%c", m->sgr_xb, m->x + 1, m->y + 1, m->sgr_rel ? 'm' : 'M'); } else if (wp->screen->mode & MODE_MOUSE_UTF8) { diff --git a/input.c b/input.c index de11f629..9f7d4413 100644 --- a/input.c +++ b/input.c @@ -1717,7 +1717,7 @@ void input_exit_osc(struct input_ctx *ictx) { u_char *p = ictx->input_buf; - int option; + u_int option; if (ictx->flags & INPUT_DISCARD) return; diff --git a/server-client.c b/server-client.c index 280815cb..8373a0ef 100644 --- a/server-client.c +++ b/server-client.c @@ -824,7 +824,7 @@ server_client_msg_dispatch(struct client *c) continue; } - log_debug("got %d from client %d", imsg.hdr.type, c->ibuf.fd); + log_debug("got %u from client %d", imsg.hdr.type, c->ibuf.fd); switch (imsg.hdr.type) { case MSG_IDENTIFY_FLAGS: case MSG_IDENTIFY_TERM: diff --git a/server-fn.c b/server-fn.c index b8cdb31a..f89eca8e 100644 --- a/server-fn.c +++ b/server-fn.c @@ -41,9 +41,9 @@ server_fill_environ(struct session *s, struct environ *env) idx = s->id; } else - idx = -1; + idx = (u_int)-1; pid = getpid(); - xsnprintf(var, sizeof var, "%s,%ld,%d", socket_path, pid, idx); + xsnprintf(var, sizeof var, "%s,%ld,%u", socket_path, pid, idx); environ_set(env, "TMUX", var); } diff --git a/server-window.c b/server-window.c index a14c3150..a2355701 100644 --- a/server-window.c +++ b/server-window.c @@ -90,7 +90,7 @@ server_window_check_bell(struct session *s, struct winlink *wl) if (c->session->curw->window == w) status_message_set(c, "Bell in current window"); else if (action == BELL_ANY) - status_message_set(c, "Bell in window %u", wl->idx); + status_message_set(c, "Bell in window %d", wl->idx); } return (1); @@ -124,7 +124,7 @@ server_window_check_activity(struct session *s, struct winlink *wl) c = ARRAY_ITEM(&clients, i); if (c == NULL || c->session != s) continue; - status_message_set(c, "Activity in window %u", wl->idx); + status_message_set(c, "Activity in window %d", wl->idx); } } @@ -175,7 +175,7 @@ server_window_check_silence(struct session *s, struct winlink *wl) c = ARRAY_ITEM(&clients, i); if (c == NULL || c->session != s) continue; - status_message_set(c, "Silence in window %u", wl->idx); + status_message_set(c, "Silence in window %d", wl->idx); } } diff --git a/window-choose.c b/window-choose.c index 69141676..8bed8d45 100644 --- a/window-choose.c +++ b/window-choose.c @@ -98,7 +98,7 @@ window_choose_add(struct window_pane *wp, struct window_choose_data *wcd) item->pos = ARRAY_LENGTH(&data->list) - 1; item->state = 0; - data->width = xsnprintf(tmp, sizeof tmp , "%u", item->pos); + data->width = xsnprintf(tmp, sizeof tmp , "%d", item->pos); } void diff --git a/window-copy.c b/window-copy.c index 223df88a..074e7310 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1216,7 +1216,7 @@ window_copy_write_line(struct window_pane *wp, struct screen_write_ctx *ctx, limit = screen_size_x(s) + 1; if (data->inputtype == WINDOW_COPY_NUMERICPREFIX) { xoff = size = xsnprintf(hdr, limit, - "Repeat: %u", data->numprefix); + "Repeat: %d", data->numprefix); } else { xoff = size = xsnprintf(hdr, limit, "%s: %s", data->inputprompt, data->inputstr);