Skip to content

Commit

Permalink
Massive spaces->tabs and trailing whitespace cleanup, hopefully for t…
Browse files Browse the repository at this point in the history
…he last

time now I've configured emacs to make them displayed in really annoying
colours...
  • Loading branch information
nicm committed Dec 3, 2009
1 parent 6c98626 commit 15a64b8
Show file tree
Hide file tree
Showing 66 changed files with 418 additions and 416 deletions.
14 changes: 7 additions & 7 deletions client.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ client_send_identify(int flags)

if (getcwd(data.cwd, sizeof data.cwd) == NULL)
*data.cwd = '\0';

term = getenv("TERM");
if (term == NULL ||
strlcpy(data.term, term, sizeof data.term) >= sizeof data.term)
Expand All @@ -143,7 +143,7 @@ client_send_environ(void)
struct msg_environ_data data;
char **var;

for (var = environ; *var != NULL; var++) {
for (var = environ; *var != NULL; var++) {
if (strlcpy(data.var, *var, sizeof data.var) >= sizeof data.var)
continue;
client_write_server(MSG_ENVIRON, &data, sizeof data);
Expand All @@ -153,7 +153,7 @@ client_send_environ(void)
void
client_write_server(enum msgtype type, void *buf, size_t len)
{
imsg_compose(&client_ibuf, type, PROTOCOL_VERSION, -1, -1, buf, len);
imsg_compose(&client_ibuf, type, PROTOCOL_VERSION, -1, -1, buf, len);
}

void
Expand All @@ -179,7 +179,7 @@ client_main(void)

/* Note: event_init() has already been called. */

/* Set up signals. */
/* Set up signals. */
memset(&sigact, 0, sizeof sigact);
sigemptyset(&sigact.sa_mask);
sigact.sa_flags = SA_RESTART;
Expand Down Expand Up @@ -263,9 +263,9 @@ client_callback(unused int fd, short events, unused void *data)
if (client_dispatch() != 0) {
event_loopexit(NULL);
return;
}
}
}

if (events & EV_WRITE) {
if (msgbuf_write(&client_ibuf.w) < 0)
goto lost_server;
Expand Down Expand Up @@ -341,7 +341,7 @@ client_dispatch(void)
if (datalen != sizeof lockdata)
fatalx("bad MSG_LOCK size");
memcpy(&lockdata, imsg.data, sizeof lockdata);

lockdata.cmd[(sizeof lockdata.cmd) - 1] = '\0';
system(lockdata.cmd);
client_write_server(MSG_UNLOCK, NULL, 0);
Expand Down
8 changes: 4 additions & 4 deletions clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ clock_draw(struct screen_write_ctx *ctx, int colour, int style)
for (ptr = tim; *ptr != '\0'; ptr++) {
if (*ptr >= '0' && *ptr <= '9')
idx = *ptr - '0';
else if (*ptr == ':')
else if (*ptr == ':')
idx = 10;
else if (*ptr == 'A')
else if (*ptr == 'A')
idx = 11;
else if (*ptr == 'P')
else if (*ptr == 'P')
idx = 12;
else if (*ptr == 'M')
else if (*ptr == 'M')
idx = 13;
else {
x += 6;
Expand Down
6 changes: 3 additions & 3 deletions cmd-attach-session.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int cmd_attach_session_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_attach_session_entry = {
"attach-session", "attach",
"[-d] " CMD_TARGET_SESSION_USAGE,
CMD_CANTNEST|CMD_STARTSERVER|CMD_SENDENVIRON, "d",
CMD_CANTNEST|CMD_STARTSERVER|CMD_SENDENVIRON, "d",
cmd_target_init,
cmd_target_parse,
cmd_attach_session_exec,
Expand Down Expand Up @@ -59,7 +59,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx)

if (ctx->cmdclient == NULL) {
if (cmd_check_flag(data->chflags, 'd')) {
/*
/*
* Can't use server_write_session in case attaching to
* the same session as currently attached to.
*/
Expand All @@ -72,7 +72,7 @@ cmd_attach_session_exec(struct cmd *self, struct cmd_ctx *ctx)
server_write_client(c, MSG_DETACH, NULL, 0);
}
}

ctx->curclient->session = s;
server_redraw_client(ctx->curclient);
} else {
Expand Down
2 changes: 1 addition & 1 deletion cmd-bind-key.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ cmd_bind_key_table(struct cmd *self, struct cmd_ctx *ctx)
ctx->error(ctx, "unknown command: %s", data->modecmd);
return (-1);
}

mtmp.key = data->key & ~KEYC_PREFIX;
mtmp.mode = data->command_key ? 1 : 0;
if ((mbind = SPLAY_FIND(mode_key_tree, mtab->tree, &mtmp)) != NULL) {
Expand Down
16 changes: 8 additions & 8 deletions cmd-break-pane.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
if (wl->window->active == NULL)
wl->window->active = TAILQ_NEXT(wp, entry);
}
layout_close_pane(wp);
layout_close_pane(wp);

w = wp->window = window_create1(s->sx, s->sy);
TAILQ_INSERT_HEAD(&w->panes, wp, entry);
w->active = wp;
w->name = default_window_name(w);
w = wp->window = window_create1(s->sx, s->sy);
TAILQ_INSERT_HEAD(&w->panes, wp, entry);
w->active = wp;
w->name = default_window_name(w);
layout_init(w);

base_idx = options_get_number(&s->options, "base-index");
wl = session_attach(s, w, -1 - base_idx, &cause); /* can't fail */
if (!cmd_check_flag(data->chflags, 'd'))
session_select(s, wl->idx);
wl = session_attach(s, w, -1 - base_idx, &cause); /* can't fail */
if (!cmd_check_flag(data->chflags, 'd'))
session_select(s, wl->idx);

server_redraw_session(s);
server_status_session_group(s);
Expand Down
2 changes: 1 addition & 1 deletion cmd-capture-pane.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
struct screen *s;
struct session *sess;
u_int i, limit;
size_t len, linelen;
size_t len, linelen;

if (cmd_find_pane(ctx, data->target, &sess, &wp) == NULL)
return (-1);
Expand Down
6 changes: 3 additions & 3 deletions cmd-choose-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ cmd_choose_window_exec(struct cmd *self, struct cmd_ctx *ctx)
cdata->client = ctx->curclient;
cdata->client->references++;

window_choose_ready(wl->window->active,
window_choose_ready(wl->window->active,
cur, cmd_choose_window_callback, cmd_choose_window_free, cdata);

return (0);
return (0);
}

void
Expand All @@ -133,7 +133,7 @@ cmd_choose_window_callback(void *data, int idx)
if (idx == -1)
return;
if (cdata->client->flags & CLIENT_DEAD)
return;
return;
if (cdata->session->flags & SESSION_DEAD)
return;
if (cdata->client->session != cdata->session)
Expand Down
14 changes: 7 additions & 7 deletions cmd-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ cmd_fill_argument(int flags, char **arg, char **arg2, int argc, char **argv)
if (argc == 2)
*arg2 = xstrdup(argv[1]);
return (0);
}
}

if (argc != 0)
return (-1);
Expand Down Expand Up @@ -225,9 +225,9 @@ cmd_target_print(struct cmd *self, char *buf, size_t len)
off += cmd_print_flags(buf, len, off, data->chflags);
if (off < len && data->target != NULL)
off += cmd_prarg(buf + off, len - off, " -t ", data->target);
if (off < len && data->arg != NULL)
if (off < len && data->arg != NULL)
off += cmd_prarg(buf + off, len - off, " ", data->arg);
if (off < len && data->arg2 != NULL)
if (off < len && data->arg2 != NULL)
off += cmd_prarg(buf + off, len - off, " ", data->arg2);
return (off);
}
Expand Down Expand Up @@ -317,9 +317,9 @@ cmd_srcdst_print(struct cmd *self, char *buf, size_t len)
off += xsnprintf(buf + off, len - off, " -s %s", data->src);
if (off < len && data->dst != NULL)
off += xsnprintf(buf + off, len - off, " -t %s", data->dst);
if (off < len && data->arg != NULL)
if (off < len && data->arg != NULL)
off += cmd_prarg(buf + off, len - off, " ", data->arg);
if (off < len && data->arg2 != NULL)
if (off < len && data->arg2 != NULL)
off += cmd_prarg(buf + off, len - off, " ", data->arg2);
return (off);
}
Expand Down Expand Up @@ -415,9 +415,9 @@ cmd_buffer_print(struct cmd *self, char *buf, size_t len)
off += xsnprintf(buf + off, len - off, " -b %d", data->buffer);
if (off < len && data->target != NULL)
off += cmd_prarg(buf + off, len - off, " -t ", data->target);
if (off < len && data->arg != NULL)
if (off < len && data->arg != NULL)
off += cmd_prarg(buf + off, len - off, " ", data->arg);
if (off < len && data->arg2 != NULL)
if (off < len && data->arg2 != NULL)
off += cmd_prarg(buf + off, len - off, " ", data->arg2);
return (off);
}
2 changes: 1 addition & 1 deletion cmd-kill-session.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ cmd_kill_session_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_target_data *data = self->data;
struct session *s;
struct client *c;
struct client *c;
u_int i;

if ((s = cmd_find_session(ctx, data->target)) == NULL)
Expand Down
2 changes: 1 addition & 1 deletion cmd-list-buffers.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ cmd_list_buffers_exec(struct cmd *self, struct cmd_ctx *ctx)
tmp[50 - 3] = '\0';
strlcat(tmp, "...", sizeof tmp);
}

ctx->print(ctx, "%u: %zu bytes: \"%s\"", idx - 1, size, tmp);
}

Expand Down
2 changes: 1 addition & 1 deletion cmd-list-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_ctx *ctx)
if (used >= sizeof tmp)
continue;

if (!(bd->key & KEYC_PREFIX)) {
if (!(bd->key & KEYC_PREFIX)) {
used = strlcat(tmp, "(no prefix) ", sizeof tmp);
if (used >= sizeof tmp)
continue;
Expand Down
6 changes: 3 additions & 3 deletions cmd-list-panes.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "tmux.h"

/*
* List panes on given window..
* List panes on given window.
*/

int cmd_list_panes_exec(struct cmd *, struct cmd_ctx *);
Expand Down Expand Up @@ -56,15 +56,15 @@ cmd_list_panes_exec(struct cmd *self, struct cmd_ctx *ctx)
n = 0;
TAILQ_FOREACH(wp, &wl->window->panes, entry) {
gd = wp->base.grid;

size = 0;
for (i = 0; i < gd->hsize; i++) {
gl = &gd->linedata[i];
size += gl->cellsize * sizeof *gl->celldata;
size += gl->utf8size * sizeof *gl->utf8data;
}
size += gd->hsize * sizeof *gd->linedata;

ctx->print(ctx, "%u: [%ux%u] [history %u/%u, %llu bytes]",
n, wp->sx, wp->sy, gd->hsize, gd->hlimit, size);
n++;
Expand Down
10 changes: 5 additions & 5 deletions cmd-new-session.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
ctx->error(ctx, "not a terminal");
return (-1);
}
overrides =

overrides =
options_get_string(&global_s_options, "terminal-overrides");
if (tty_open(&ctx->cmdclient->tty, overrides, &cause) != 0) {
ctx->error(ctx, "open terminal failed: %s", cause);
Expand Down Expand Up @@ -267,13 +267,13 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
* Set the client to the new session. If a command client exists, it is
* taking this session and needs to get MSG_READY and stay around.
*/
if (!detached) {
if (!detached) {
if (ctx->cmdclient != NULL) {
server_write_client(ctx->cmdclient, MSG_READY, NULL, 0);
ctx->cmdclient->session = s;
ctx->cmdclient->session = s;
server_redraw_client(ctx->cmdclient);
} else {
ctx->curclient->session = s;
ctx->curclient->session = s;
server_redraw_client(ctx->curclient);
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd-new-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx)
if (!data->flag_detached) {
session_select(s, wl->idx);
server_redraw_session_group(s);
} else
} else
server_status_session_group(s);

return (0);
Expand Down
2 changes: 1 addition & 1 deletion cmd-paste-buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ cmd_paste_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
paste_free_index(&s->buffers, data->buffer);
}

return (0);
return (0);
}

/* Add bytes to a buffer but change every '\n' to '\r'. */
Expand Down
8 changes: 4 additions & 4 deletions cmd-pipe-pane.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
switch (fork()) {
case -1:
ctx->error(ctx, "fork error: %s", strerror(errno));
return (-1);
return (-1);
case 0:
/* Child process. */
close(pipe_fd[0]);
Expand All @@ -114,17 +114,17 @@ cmd_pipe_pane_exec(struct cmd *self, struct cmd_ctx *ctx)

wp->pipe_fd = pipe_fd[0];
wp->pipe_off = EVBUFFER_LENGTH(wp->event->input);

wp->pipe_event = bufferevent_new(wp->pipe_fd,
NULL, NULL, cmd_pipe_pane_error_callback, wp);
bufferevent_enable(wp->pipe_event, EV_WRITE);

if ((mode = fcntl(wp->pipe_fd, F_GETFL)) == -1)
fatal("fcntl failed");
if (fcntl(wp->pipe_fd, F_SETFL, mode|O_NONBLOCK) == -1)
fatal("fcntl failed");
if (fcntl(wp->pipe_fd, F_SETFD, FD_CLOEXEC) == -1)
fatal("fcntl failed");
fatal("fcntl failed");
return (0);
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd-previous-layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ cmd_previous_layout_exec(struct cmd *self, struct cmd_ctx *ctx)
struct cmd_target_data *data = self->data;
struct winlink *wl;
u_int layout;

if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
return (-1);

Expand Down
2 changes: 1 addition & 1 deletion cmd-resize-pane.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ cmd_resize_pane_init(struct cmd *self, int key)
cmd_set_flag(&data->chflags, 'L');
if (key == (KEYC_RIGHT | KEYC_CTRL))
cmd_set_flag(&data->chflags, 'R');

if (key == (KEYC_UP | KEYC_ESCAPE)) {
cmd_set_flag(&data->chflags, 'U');
data->arg = xstrdup("5");
Expand Down
2 changes: 1 addition & 1 deletion cmd-respawn-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ cmd_respawn_window_exec(struct cmd *self, struct cmd_ctx *ctx)
wp = TAILQ_FIRST(&w->panes);
TAILQ_REMOVE(&w->panes, wp, entry);
layout_free(w);
window_destroy_panes(w);
window_destroy_panes(w);
TAILQ_INSERT_HEAD(&w->panes, wp, entry);
window_pane_resize(wp, w->sx, w->sy);
if (window_pane_spawn(
Expand Down
4 changes: 2 additions & 2 deletions cmd-select-layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ cmd_select_layout_init(struct cmd *self, int key)
break;
case ('2' | KEYC_ESCAPE):
data->arg = xstrdup("even-vertical");
break;
break;
case ('3' | KEYC_ESCAPE):
data->arg = xstrdup("main-horizontal");
break;
Expand Down Expand Up @@ -80,7 +80,7 @@ cmd_select_layout_exec(struct cmd *self, struct cmd_ctx *ctx)
ctx->error(ctx, "unknown layout or ambiguous: %s", data->arg);
return (-1);
}

layout = layout_set_select(wl->window, layout);
ctx->info(ctx, "arranging in: %s", layout_set_name(layout));

Expand Down
2 changes: 1 addition & 1 deletion cmd-send-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ size_t cmd_send_keys_print(struct cmd *, char *, size_t);

struct cmd_send_keys_data {
char *target;
u_int nkeys;
u_int nkeys;
int *keys;
};

Expand Down
Loading

0 comments on commit 15a64b8

Please sign in to comment.