From 8b8d0963da522c3a0ac4e99dc9264b6fda2b477a Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 16 Feb 2017 10:53:25 +0000 Subject: [PATCH] Style nits. --- attributes.c | 14 +++++++------- cmd-run-shell.c | 4 ---- cmd-set-option.c | 2 +- tmux.c | 2 +- window-choose.c | 2 +- 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/attributes.c b/attributes.c index 84e4f9c6..046cdcc5 100644 --- a/attributes.c +++ b/attributes.c @@ -32,13 +32,13 @@ attributes_tostring(u_char attr) return ("none"); len = xsnprintf(buf, sizeof buf, "%s%s%s%s%s%s%s", - attr & GRID_ATTR_BRIGHT ? "bright," : "", - attr & GRID_ATTR_DIM ? "dim," : "", - attr & GRID_ATTR_UNDERSCORE ? "underscore," : "", - attr & GRID_ATTR_BLINK ? "blink," : "", - attr & GRID_ATTR_REVERSE ? "reverse," : "", - attr & GRID_ATTR_HIDDEN ? "hidden," : "", - attr & GRID_ATTR_ITALICS ? "italics," : ""); + (attr & GRID_ATTR_BRIGHT) ? "bright," : "", + (attr & GRID_ATTR_DIM) ? "dim," : "", + (attr & GRID_ATTR_UNDERSCORE) ? "underscore," : "", + (attr & GRID_ATTR_BLINK)? "blink," : "", + (attr & GRID_ATTR_REVERSE) ? "reverse," : "", + (attr & GRID_ATTR_HIDDEN) ? "hidden," : "", + (attr & GRID_ATTR_ITALICS) ? "italics," : ""); if (len > 0) buf[len - 1] = '\0'; diff --git a/cmd-run-shell.c b/cmd-run-shell.c index 29375428..e6cd7936 100644 --- a/cmd-run-shell.c +++ b/cmd-run-shell.c @@ -131,14 +131,11 @@ cmd_run_shell_callback(struct job *job) char *cmd = cdata->cmd, *msg, *line; size_t size; int retcode; - u_int lines; - lines = 0; do { if ((line = evbuffer_readline(job->event->input)) != NULL) { cmd_run_shell_print(job, line); free(line); - lines++; } } while (line != NULL); @@ -149,7 +146,6 @@ cmd_run_shell_callback(struct job *job) line[size] = '\0'; cmd_run_shell_print(job, line); - lines++; free(line); } diff --git a/cmd-set-option.c b/cmd-set-option.c index cc8b7570..a0138d86 100644 --- a/cmd-set-option.c +++ b/cmd-set-option.c @@ -72,7 +72,7 @@ cmd_set_option_exec(struct cmd *self, struct cmdq_item *item) struct cmd_find_state *fs = &item->state.tflag; struct session *s = fs->s; struct winlink *wl = fs->wl; - struct window *w = wl->window; + struct window *w; struct client *c; enum options_table_scope scope; struct options *oo; diff --git a/tmux.c b/tmux.c index d5e962df..12402bb5 100644 --- a/tmux.c +++ b/tmux.c @@ -81,7 +81,7 @@ getshell(void) static int checkshell(const char *shell) { - if (shell == NULL || *shell == '\0' || *shell != '/') + if (shell == NULL || *shell != '/') return (0); if (areshell(shell)) return (0); diff --git a/window-choose.c b/window-choose.c index b7647d2a..7daddc6f 100644 --- a/window-choose.c +++ b/window-choose.c @@ -910,7 +910,7 @@ window_choose_write_line(struct window_pane *wp, struct screen_write_ctx *ctx, * expanded or not. */ (item->wcd->type & TREE_SESSION) ? - (item->state & TREE_EXPANDED ? "-" : "+") : "", item->name); + ((item->state & TREE_EXPANDED) ? "-" : "+") : "", item->name); } while (s->cx < screen_size_x(s) - 1) screen_write_putc(ctx, &gc, ' ');