diff --git a/input.c b/input.c index cb534373..9b09aa21 100644 --- a/input.c +++ b/input.c @@ -1,4 +1,4 @@ -/* $Id: input.c,v 1.87 2009-07-14 06:40:33 nicm Exp $ */ +/* $Id: input.c,v 1.88 2009-07-22 17:46:53 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -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 diff --git a/options.c b/options.c index de02be0c..7f963ead 100644 --- a/options.c +++ b/options.c @@ -1,4 +1,4 @@ -/* $Id: options.c,v 1.5 2009-05-15 12:57:36 nicm Exp $ */ +/* $Id: options.c,v 1.6 2009-07-22 17:46:53 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -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 diff --git a/server.c b/server.c index 2c2d0ab3..718448ae 100644 --- a/server.c +++ b/server.c @@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.161 2009-07-20 16:07:23 tcunha Exp $ */ +/* $Id: server.c,v 1.162 2009-07-22 17:46:53 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -43,6 +43,7 @@ /* Client list. */ struct clients clients; +void server_create_client(int); int server_create_socket(void); int server_main(int); void server_shutdown(void); @@ -51,7 +52,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 *); @@ -68,7 +69,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; @@ -106,11 +107,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. */ @@ -740,7 +740,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; @@ -750,14 +750,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. */ diff --git a/tmux.h b/tmux.h index 674e9fc1..b2cae2de 100644 --- a/tmux.h +++ b/tmux.h @@ -1,4 +1,4 @@ -/* $Id: tmux.h,v 1.379 2009-07-22 17:33:02 tcunha Exp $ */ +/* $Id: tmux.h,v 1.380 2009-07-22 17:46:53 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -1013,7 +1013,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 *); @@ -1286,7 +1286,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 *); @@ -1466,9 +1465,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 *); @@ -1478,7 +1477,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 *); diff --git a/window.c b/window.c index ab48a6ea..5568a05f 100644 --- a/window.c +++ b/window.c @@ -1,4 +1,4 @@ -/* $Id: window.c,v 1.96 2009-07-22 12:42:57 nicm Exp $ */ +/* $Id: window.c,v 1.97 2009-07-22 17:46:53 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -299,13 +299,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 @@ -530,13 +528,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; @@ -559,7 +557,6 @@ window_pane_resize(struct window_pane *wp, u_int sx, u_int sy) if (errno != EINVAL) #endif fatal("ioctl failed"); - return (0); } int @@ -567,9 +564,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)