mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-08 01:04:06 +01:00
%u -> %d for indexes. Some lint fixes.
This commit is contained in:
parent
ab097f0c0c
commit
941eab33e9
5
Makefile
5
Makefile
@ -1,4 +1,4 @@
|
|||||||
# $Id: Makefile,v 1.33 2007-10-26 16:57:32 nicm Exp $
|
# $Id: Makefile,v 1.34 2007-10-30 10:59:42 nicm Exp $
|
||||||
|
|
||||||
.SUFFIXES: .c .o .y .h
|
.SUFFIXES: .c .o .y .h
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
@ -80,6 +80,9 @@ ${PROG}: ${OBJS}
|
|||||||
depend:
|
depend:
|
||||||
mkdep ${CFLAGS} ${INCDIRS} ${SRCS:M*.c}
|
mkdep ${CFLAGS} ${INCDIRS} ${SRCS:M*.c}
|
||||||
|
|
||||||
|
lint:
|
||||||
|
lint -cehvx ${CFLAGS:M-D*} ${SRCS:M*.c}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f ${CLEANFILES}
|
rm -f ${CLEANFILES}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-kill-window.c,v 1.3 2007-10-26 16:57:32 nicm Exp $ */
|
/* $Id: cmd-kill-window.c,v 1.4 2007-10-30 10:59:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -102,7 +102,7 @@ cmd_kill_window_exec(void *ptr, struct cmd_ctx *ctx)
|
|||||||
if (data->idx == -1)
|
if (data->idx == -1)
|
||||||
wl = s->curw;
|
wl = s->curw;
|
||||||
else if ((wl = winlink_find_by_index(&s->windows, data->idx)) == NULL) {
|
else if ((wl = winlink_find_by_index(&s->windows, data->idx)) == NULL) {
|
||||||
ctx->error(ctx, "no window %u", data->idx);
|
ctx->error(ctx, "no window %d", data->idx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-link-window.c,v 1.3 2007-10-26 16:57:32 nicm Exp $ */
|
/* $Id: cmd-link-window.c,v 1.4 2007-10-30 10:59:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -125,7 +125,7 @@ cmd_link_window_exec(void *ptr, struct cmd_ctx *ctx)
|
|||||||
else {
|
else {
|
||||||
wl = winlink_find_by_index(&src->windows, data->srcidx);
|
wl = winlink_find_by_index(&src->windows, data->srcidx);
|
||||||
if (wl == NULL) {
|
if (wl == NULL) {
|
||||||
ctx->error(ctx, "no window %u", data->srcidx);
|
ctx->error(ctx, "no window %d", data->srcidx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-list-windows.c,v 1.4 2007-10-26 12:29:07 nicm Exp $ */
|
/* $Id: cmd-list-windows.c,v 1.5 2007-10-30 10:59:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -49,7 +49,7 @@ cmd_list_windows_exec(unused void *ptr, struct cmd_ctx *ctx)
|
|||||||
|
|
||||||
RB_FOREACH(wl, winlinks, &s->windows) {
|
RB_FOREACH(wl, winlinks, &s->windows) {
|
||||||
w = wl->window;
|
w = wl->window;
|
||||||
ctx->print(ctx, "%u: %s \"%s\" (%s) [%ux%u]", wl->idx,
|
ctx->print(ctx, "%d: %s \"%s\" (%s) [%ux%u]", wl->idx,
|
||||||
w->name, w->screen.title, ttyname(w->fd),
|
w->name, w->screen.title, ttyname(w->fd),
|
||||||
w->screen.sx, w->screen.sy);
|
w->screen.sx, w->screen.sy);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-rename-window.c,v 1.9 2007-10-26 16:57:32 nicm Exp $ */
|
/* $Id: cmd-rename-window.c,v 1.10 2007-10-30 10:59:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -104,7 +104,7 @@ cmd_rename_window_exec(void *ptr, struct cmd_ctx *ctx)
|
|||||||
if (data->idx == -1)
|
if (data->idx == -1)
|
||||||
wl = s->curw;
|
wl = s->curw;
|
||||||
else if ((wl = winlink_find_by_index(&s->windows, data->idx)) == NULL) {
|
else if ((wl = winlink_find_by_index(&s->windows, data->idx)) == NULL) {
|
||||||
ctx->error(ctx, "no window %u", data->idx);
|
ctx->error(ctx, "no window %d", data->idx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
xfree(wl->window->name);
|
xfree(wl->window->name);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-select-window.c,v 1.6 2007-10-26 16:57:32 nicm Exp $ */
|
/* $Id: cmd-select-window.c,v 1.7 2007-10-30 10:59:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -115,7 +115,7 @@ cmd_select_window_exec(void *ptr, struct cmd_ctx *ctx)
|
|||||||
case 1:
|
case 1:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ctx->error(ctx, "no window %u", data->idx);
|
ctx->error(ctx, "no window %d", data->idx);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-set-option.c,v 1.10 2007-10-20 09:57:08 nicm Exp $ */
|
/* $Id: cmd-set-option.c,v 1.11 2007-10-30 10:59:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -90,8 +90,8 @@ cmd_set_option_exec(void *ptr, unused struct cmd_ctx *ctx)
|
|||||||
struct cmd_set_option_data *data = ptr;
|
struct cmd_set_option_data *data = ptr;
|
||||||
struct client *c = ctx->client;
|
struct client *c = ctx->client;
|
||||||
const char *errstr;
|
const char *errstr;
|
||||||
u_int number, i;
|
u_int i;
|
||||||
int bool, key;
|
int number, bool, key;
|
||||||
|
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
return;
|
return;
|
||||||
@ -103,7 +103,7 @@ cmd_set_option_exec(void *ptr, unused struct cmd_ctx *ctx)
|
|||||||
|
|
||||||
number = -1;
|
number = -1;
|
||||||
if (data->value != NULL) {
|
if (data->value != NULL) {
|
||||||
number = strtonum(data->value, 0, UINT_MAX, &errstr);
|
number = strtonum(data->value, 0, INT_MAX, &errstr);
|
||||||
|
|
||||||
bool = -1;
|
bool = -1;
|
||||||
if (number == 1 || strcasecmp(data->value, "on") == 0 ||
|
if (number == 1 || strcasecmp(data->value, "on") == 0 ||
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd-unlink-window.c,v 1.1 2007-10-26 16:57:32 nicm Exp $ */
|
/* $Id: cmd-unlink-window.c,v 1.2 2007-10-30 10:59:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -106,7 +106,7 @@ cmd_unlink_window_exec(void *ptr, struct cmd_ctx *ctx)
|
|||||||
else {
|
else {
|
||||||
wl = winlink_find_by_index(&s->windows, data->idx);
|
wl = winlink_find_by_index(&s->windows, data->idx);
|
||||||
if (wl == NULL) {
|
if (wl == NULL) {
|
||||||
ctx->error(ctx, "no window %u", data->idx);
|
ctx->error(ctx, "no window %d", data->idx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
cmd.c
4
cmd.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: cmd.c,v 1.22 2007-10-26 16:57:32 nicm Exp $ */
|
/* $Id: cmd.c,v 1.23 2007-10-30 10:59:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -113,7 +113,7 @@ usage:
|
|||||||
void
|
void
|
||||||
cmd_exec(struct cmd *cmd, struct cmd_ctx *ctx)
|
cmd_exec(struct cmd *cmd, struct cmd_ctx *ctx)
|
||||||
{
|
{
|
||||||
return (cmd->entry->exec(cmd->data, ctx));
|
cmd->entry->exec(cmd->data, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: server-fn.c,v 1.23 2007-10-26 12:29:07 nicm Exp $ */
|
/* $Id: server-fn.c,v 1.24 2007-10-30 10:59:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -44,7 +44,7 @@ server_extract_session(struct msg_command_data *data, char *name, char **cause)
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
if (data->idx > ARRAY_LENGTH(&sessions)) {
|
if (data->idx > ARRAY_LENGTH(&sessions)) {
|
||||||
xasprintf(cause, "index out of range: %u", data->idx);
|
xasprintf(cause, "index out of range: %d", data->idx);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
if ((s = ARRAY_ITEM(&sessions, data->idx)) == NULL) {
|
if ((s = ARRAY_ITEM(&sessions, data->idx)) == NULL) {
|
||||||
|
5
server.c
5
server.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: server.c,v 1.35 2007-10-26 12:29:07 nicm Exp $ */
|
/* $Id: server.c,v 1.36 2007-10-30 10:59:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -59,11 +59,10 @@ server_start(char *path)
|
|||||||
{
|
{
|
||||||
struct sockaddr_un sa;
|
struct sockaddr_un sa;
|
||||||
size_t size;
|
size_t size;
|
||||||
pid_t pid;
|
|
||||||
mode_t mask;
|
mode_t mask;
|
||||||
int n, fd, mode;
|
int n, fd, mode;
|
||||||
|
|
||||||
switch (pid = fork()) {
|
switch (fork()) {
|
||||||
case -1:
|
case -1:
|
||||||
log_warn("fork");
|
log_warn("fork");
|
||||||
return (-1);
|
return (-1);
|
||||||
|
4
status.c
4
status.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: status.c,v 1.7 2007-10-26 12:29:07 nicm Exp $ */
|
/* $Id: status.c,v 1.8 2007-10-30 10:59:43 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -47,7 +47,7 @@ status_write(struct client *c)
|
|||||||
if (session_hasbell(c->session, wl))
|
if (session_hasbell(c->session, wl))
|
||||||
flag = '!';
|
flag = '!';
|
||||||
status_print(
|
status_print(
|
||||||
b, &size, "%u:%s%c ", wl->idx, wl->window->name, flag);
|
b, &size, "%d:%s%c ", wl->idx, wl->window->name, flag);
|
||||||
|
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user