Make some functions which return unused values void (mostly found by lint) and

tweak a redundant expression in window_pane_set_mode.
This commit is contained in:
Nicholas Marriott 2009-07-21 19:54:22 +00:00
parent 6945e86fd7
commit 76a9d98562
5 changed files with 19 additions and 27 deletions

View File

@ -35,7 +35,7 @@
#define INPUT_SPECIAL(ch) (ch == 0xff)
int input_get_argument(struct input_ctx *, u_int, uint16_t *, uint16_t);
int input_new_argument(struct input_ctx *);
void input_new_argument(struct input_ctx *);
int input_add_argument(struct input_ctx *, u_char);
void input_start_string(struct input_ctx *, int);
@ -123,7 +123,7 @@ input_sequence_cmp(const void *a, const void *b)
return (ai - bi);
}
int
void
input_new_argument(struct input_ctx *ictx)
{
struct input_arg *arg;
@ -132,8 +132,6 @@ input_new_argument(struct input_ctx *ictx)
arg = &ARRAY_LAST(&ictx->args);
arg->used = 0;
return (0);
}
int

View File

@ -83,20 +83,19 @@ options_find(struct options *oo, const char *name)
return (o);
}
int
void
options_remove(struct options *oo, const char *name)
{
struct options_entry *o;
if ((o = options_find1(oo, name)) == NULL)
return (-1);
return;
SPLAY_REMOVE(options_tree, &oo->tree, o);
xfree(o->name);
if (o->type == OPTIONS_STRING)
xfree(o->value.string);
xfree(o);
return (0);
}
void printflike3

View File

@ -44,6 +44,7 @@
/* Client list. */
struct clients clients;
void server_create_client(int);
int server_create_socket(void);
int server_main(int);
void server_shutdown(void);
@ -52,7 +53,7 @@ void server_fill_windows(struct pollfd **);
void server_handle_windows(struct pollfd **);
void server_fill_clients(struct pollfd **);
void server_handle_clients(struct pollfd **);
struct client *server_accept_client(int);
void server_accept_client(int);
void server_handle_client(struct client *);
void server_handle_window(struct window *, struct window_pane *);
int server_check_window_bell(struct session *, struct window *);
@ -69,7 +70,7 @@ void server_second_timers(void);
int server_update_socket(void);
/* Create a new client. */
struct client *
void
server_create_client(int fd)
{
struct client *c;
@ -107,11 +108,10 @@ server_create_client(int fd)
for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
if (ARRAY_ITEM(&clients, i) == NULL) {
ARRAY_SET(&clients, i, c);
return (c);
return;
}
}
ARRAY_ADD(&clients, c);
return (c);
}
/* Find client index. */
@ -735,7 +735,7 @@ server_handle_clients(struct pollfd **pfd)
}
/* accept(2) and create new client. */
struct client *
void
server_accept_client(int srv_fd)
{
struct sockaddr_storage sa;
@ -745,14 +745,14 @@ server_accept_client(int srv_fd)
fd = accept(srv_fd, (struct sockaddr *) &sa, &slen);
if (fd == -1) {
if (errno == EAGAIN || errno == EINTR || errno == ECONNABORTED)
return (NULL);
return;
fatal("accept failed");
}
if (sigterm) {
close(fd);
return (NULL);
return;
}
return (server_create_client(fd));
server_create_client(fd);
}
/* Input data from client. */

7
tmux.h
View File

@ -1014,7 +1014,7 @@ void options_init(struct options *, struct options *);
void options_free(struct options *);
struct options_entry *options_find1(struct options *, const char *);
struct options_entry *options_find(struct options *, const char *);
int options_remove(struct options *, const char *);
void options_remove(struct options *, const char *);
void printflike3 options_set_string(
struct options *, const char *, const char *, ...);
char *options_get_string(struct options *, const char *);
@ -1287,7 +1287,6 @@ const char *key_string_lookup_key(int);
/* server.c */
extern struct clients clients;
struct client *server_create_client(int);
int server_client_index(struct client *);
int server_start(char *);
@ -1467,9 +1466,9 @@ struct window *window_create1(u_int, u_int);
struct window *window_create(const char *, const char *,
const char *, const char **, u_int, u_int, u_int, char **);
void window_destroy(struct window *);
int window_resize(struct window *, u_int, u_int);
void window_set_active_pane(struct window *, struct window_pane *);
struct window_pane *window_add_pane(struct window *, u_int, char **);
void window_resize(struct window *, u_int, u_int);
void window_remove_pane(struct window *, struct window_pane *);
struct window_pane *window_pane_at_index(struct window *, u_int);
u_int window_pane_index(struct window *, struct window_pane *);
@ -1479,7 +1478,7 @@ struct window_pane *window_pane_create(struct window *, u_int, u_int, u_int);
void window_pane_destroy(struct window_pane *);
int window_pane_spawn(struct window_pane *,
const char *, const char *, const char **, char **);
int window_pane_resize(struct window_pane *, u_int, u_int);
void window_pane_resize(struct window_pane *, u_int, u_int);
int window_pane_set_mode(
struct window_pane *, const struct window_mode *);
void window_pane_reset_mode(struct window_pane *);

View File

@ -301,13 +301,11 @@ window_destroy(struct window *w)
xfree(w);
}
int
void
window_resize(struct window *w, u_int sx, u_int sy)
{
w->sx = sx;
w->sy = sy;
return (0);
}
void
@ -532,13 +530,13 @@ window_pane_spawn(struct window_pane *wp,
return (0);
}
int
void
window_pane_resize(struct window_pane *wp, u_int sx, u_int sy)
{
struct winsize ws;
if (sx == wp->sx && sy == wp->sy)
return (-1);
return;
wp->sx = sx;
wp->sy = sy;
@ -552,7 +550,6 @@ window_pane_resize(struct window_pane *wp, u_int sx, u_int sy)
if (wp->fd != -1 && ioctl(wp->fd, TIOCSWINSZ, &ws) == -1)
fatal("ioctl failed");
return (0);
}
int
@ -560,9 +557,8 @@ window_pane_set_mode(struct window_pane *wp, const struct window_mode *mode)
{
struct screen *s;
if (wp->mode != NULL || wp->mode == mode)
if (wp->mode != NULL)
return (1);
wp->mode = mode;
if ((s = wp->mode->init(wp)) != NULL)