Looks good but I think PROTOCOL_VERSION should just be made unsigned.

On Sun, Feb 22, 2015 at 11:34:23AM -0500, Ben Boeckel wrote:
> GCC5 is warning about these things more it seems.
> 
> Signed-off-by: Ben Boeckel <maths...@gmail.com>
> ---
>  client.c           |  6 +++---
>  cmd-respawn-pane.c |  2 +-
>  colour.c           |  2 +-
>  format.c           | 30 +++++++++++++++---------------
>  input-keys.c       |  2 +-
>  input.c            |  2 +-
>  server-client.c    |  2 +-
>  server-fn.c        |  4 ++--
>  server-window.c    |  6 +++---
>  tty-term.c         |  6 +++---
>  window-choose.c    |  2 +-
>  window-copy.c      |  2 +-
>  12 files changed, 33 insertions(+), 33 deletions(-)
> 
> diff --git a/client.c b/client.c
> index 042ec92..c16afac 100644
> --- a/client.c
> +++ b/client.c
> @@ -561,7 +561,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:
> @@ -608,7 +608,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;
>  
> @@ -652,7 +652,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-respawn-pane.c b/cmd-respawn-pane.c
> index 4703153..6575e8e 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 b5efd6f..82f8533 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 776de96..164fef0 100644
> --- a/format.c
> +++ b/format.c
> @@ -504,7 +504,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. */
> @@ -573,7 +573,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);
> @@ -598,13 +598,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);
> @@ -624,7 +624,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),
> @@ -697,16 +697,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 ef652ee..762e86b 100644
> --- a/input-keys.c
> +++ b/input-keys.c
> @@ -218,7 +218,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 de11f62..80fed9e 100644
> --- a/input.c
> +++ b/input.c
> @@ -1747,7 +1747,7 @@ input_exit_osc(struct input_ctx *ictx)
>                       screen_set_cursor_colour(ictx->ctx.s, "");
>               break;
>       default:
> -             log_debug("%s: unknown '%u'", __func__, option);
> +             log_debug("%s: unknown '%d'", __func__, option);
>               break;
>       }
>  }
> diff --git a/server-client.c b/server-client.c
> index 3ca9907..f7ce35c 100644
> --- a/server-client.c
> +++ b/server-client.c
> @@ -833,7 +833,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 1ed3a01..ad82540 100644
> --- a/server-fn.c
> +++ b/server-fn.c
> @@ -43,7 +43,7 @@ server_fill_environ(struct session *s, struct environ *env)
>       } else
>               idx = -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);
>  }
>  
> @@ -64,7 +64,7 @@ server_write_client(struct client *c, enum msgtype type, 
> const void *buf,
>  
>       if (c->flags & CLIENT_BAD)
>               return (-1);
> -     log_debug("writing %d to client %d", type, c->ibuf.fd);
> +     log_debug("writing %u to client %d", type, c->ibuf.fd);
>       error = imsg_compose(ibuf, type, PROTOCOL_VERSION, -1, -1,
>           (void *) buf, len);
>       if (error == 1)
> diff --git a/server-window.c b/server-window.c
> index a14c315..a235570 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/tty-term.c b/tty-term.c
> index 365da5f..fa30ab4 100644
> --- a/tty-term.c
> +++ b/tty-term.c
> @@ -532,7 +532,7 @@ tty_term_string(struct tty_term *term, enum tty_code_code 
> code)
>       if (!tty_term_has(term, code))
>               return ("");
>       if (term->codes[code].type != TTYCODE_STRING)
> -             log_fatalx("not a string: %d", code);
> +             log_fatalx("not a string: %u", code);
>       return (term->codes[code].value.string);
>  }
>  
> @@ -568,7 +568,7 @@ tty_term_number(struct tty_term *term, enum tty_code_code 
> code)
>       if (!tty_term_has(term, code))
>               return (0);
>       if (term->codes[code].type != TTYCODE_NUMBER)
> -             log_fatalx("not a number: %d", code);
> +             log_fatalx("not a number: %u", code);
>       return (term->codes[code].value.number);
>  }
>  
> @@ -578,6 +578,6 @@ tty_term_flag(struct tty_term *term, enum tty_code_code 
> code)
>       if (!tty_term_has(term, code))
>               return (0);
>       if (term->codes[code].type != TTYCODE_FLAG)
> -             log_fatalx("not a flag: %d", code);
> +             log_fatalx("not a flag: %u", code);
>       return (term->codes[code].value.flag);
>  }
> diff --git a/window-choose.c b/window-choose.c
> index 6914167..8bed8d4 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 223df88..074e731 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);
> -- 
> 2.3.0
> 
> 
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
> _______________________________________________
> tmux-users mailing list
> tmux-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tmux-users

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to