mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	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:
		
							
								
								
									
										6
									
								
								input.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								input.c
									
									
									
									
									
								
							@@ -35,7 +35,7 @@
 | 
				
			|||||||
#define INPUT_SPECIAL(ch)	(ch == 0xff)
 | 
					#define INPUT_SPECIAL(ch)	(ch == 0xff)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int	 input_get_argument(struct input_ctx *, u_int, uint16_t *, uint16_t);
 | 
					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);
 | 
					int	 input_add_argument(struct input_ctx *, u_char);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void	 input_start_string(struct input_ctx *, int);
 | 
					void	 input_start_string(struct input_ctx *, int);
 | 
				
			||||||
@@ -123,7 +123,7 @@ input_sequence_cmp(const void *a, const void *b)
 | 
				
			|||||||
	return (ai - bi);
 | 
						return (ai - bi);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					void
 | 
				
			||||||
input_new_argument(struct input_ctx *ictx)
 | 
					input_new_argument(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct input_arg       *arg;
 | 
						struct input_arg       *arg;
 | 
				
			||||||
@@ -132,8 +132,6 @@ input_new_argument(struct input_ctx *ictx)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	arg = &ARRAY_LAST(&ictx->args);
 | 
						arg = &ARRAY_LAST(&ictx->args);
 | 
				
			||||||
	arg->used = 0;
 | 
						arg->used = 0;
 | 
				
			||||||
 | 
					 | 
				
			||||||
	return (0);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -83,20 +83,19 @@ options_find(struct options *oo, const char *name)
 | 
				
			|||||||
	return (o);
 | 
						return (o);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					void
 | 
				
			||||||
options_remove(struct options *oo, const char *name)
 | 
					options_remove(struct options *oo, const char *name)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct options_entry	*o;
 | 
						struct options_entry	*o;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((o = options_find1(oo, name)) == NULL)
 | 
						if ((o = options_find1(oo, name)) == NULL)
 | 
				
			||||||
		return (-1);
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	SPLAY_REMOVE(options_tree, &oo->tree, o);
 | 
						SPLAY_REMOVE(options_tree, &oo->tree, o);
 | 
				
			||||||
	xfree(o->name);
 | 
						xfree(o->name);
 | 
				
			||||||
	if (o->type == OPTIONS_STRING)
 | 
						if (o->type == OPTIONS_STRING)
 | 
				
			||||||
		xfree(o->value.string);
 | 
							xfree(o->value.string);
 | 
				
			||||||
	xfree(o);
 | 
						xfree(o);
 | 
				
			||||||
	return (0);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void printflike3
 | 
					void printflike3
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										16
									
								
								server.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								server.c
									
									
									
									
									
								
							@@ -44,6 +44,7 @@
 | 
				
			|||||||
/* Client list. */
 | 
					/* Client list. */
 | 
				
			||||||
struct clients	 clients;
 | 
					struct clients	 clients;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void		 server_create_client(int);
 | 
				
			||||||
int		 server_create_socket(void);
 | 
					int		 server_create_socket(void);
 | 
				
			||||||
int		 server_main(int);
 | 
					int		 server_main(int);
 | 
				
			||||||
void		 server_shutdown(void);
 | 
					void		 server_shutdown(void);
 | 
				
			||||||
@@ -52,7 +53,7 @@ void		 server_fill_windows(struct pollfd **);
 | 
				
			|||||||
void		 server_handle_windows(struct pollfd **);
 | 
					void		 server_handle_windows(struct pollfd **);
 | 
				
			||||||
void		 server_fill_clients(struct pollfd **);
 | 
					void		 server_fill_clients(struct pollfd **);
 | 
				
			||||||
void		 server_handle_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_client(struct client *);
 | 
				
			||||||
void		 server_handle_window(struct window *, struct window_pane *);
 | 
					void		 server_handle_window(struct window *, struct window_pane *);
 | 
				
			||||||
int		 server_check_window_bell(struct session *, struct window *);
 | 
					int		 server_check_window_bell(struct session *, struct window *);
 | 
				
			||||||
@@ -69,7 +70,7 @@ void		 server_second_timers(void);
 | 
				
			|||||||
int		 server_update_socket(void);
 | 
					int		 server_update_socket(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Create a new client. */
 | 
					/* Create a new client. */
 | 
				
			||||||
struct client *
 | 
					void
 | 
				
			||||||
server_create_client(int fd)
 | 
					server_create_client(int fd)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct client	*c;
 | 
						struct client	*c;
 | 
				
			||||||
@@ -107,11 +108,10 @@ server_create_client(int fd)
 | 
				
			|||||||
	for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
 | 
						for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
 | 
				
			||||||
		if (ARRAY_ITEM(&clients, i) == NULL) {
 | 
							if (ARRAY_ITEM(&clients, i) == NULL) {
 | 
				
			||||||
			ARRAY_SET(&clients, i, c);
 | 
								ARRAY_SET(&clients, i, c);
 | 
				
			||||||
			return (c);
 | 
								return;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	ARRAY_ADD(&clients, c);
 | 
						ARRAY_ADD(&clients, c);
 | 
				
			||||||
	return (c);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Find client index. */
 | 
					/* Find client index. */
 | 
				
			||||||
@@ -735,7 +735,7 @@ server_handle_clients(struct pollfd **pfd)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* accept(2) and create new client. */
 | 
					/* accept(2) and create new client. */
 | 
				
			||||||
struct client *
 | 
					void
 | 
				
			||||||
server_accept_client(int srv_fd)
 | 
					server_accept_client(int srv_fd)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct sockaddr_storage	sa;
 | 
						struct sockaddr_storage	sa;
 | 
				
			||||||
@@ -745,14 +745,14 @@ server_accept_client(int srv_fd)
 | 
				
			|||||||
	fd = accept(srv_fd, (struct sockaddr *) &sa, &slen);
 | 
						fd = accept(srv_fd, (struct sockaddr *) &sa, &slen);
 | 
				
			||||||
	if (fd == -1) {
 | 
						if (fd == -1) {
 | 
				
			||||||
		if (errno == EAGAIN || errno == EINTR || errno == ECONNABORTED)
 | 
							if (errno == EAGAIN || errno == EINTR || errno == ECONNABORTED)
 | 
				
			||||||
			return (NULL);
 | 
								return;
 | 
				
			||||||
		fatal("accept failed");
 | 
							fatal("accept failed");
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (sigterm) {
 | 
						if (sigterm) {
 | 
				
			||||||
		close(fd);
 | 
							close(fd);
 | 
				
			||||||
		return (NULL);
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return (server_create_client(fd));
 | 
						server_create_client(fd);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Input data from client. */
 | 
					/* Input data from client. */
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								tmux.h
									
									
									
									
									
								
							@@ -1014,7 +1014,7 @@ void	options_init(struct options *, struct options *);
 | 
				
			|||||||
void	options_free(struct options *);
 | 
					void	options_free(struct options *);
 | 
				
			||||||
struct options_entry *options_find1(struct options *, const char *);
 | 
					struct options_entry *options_find1(struct options *, const char *);
 | 
				
			||||||
struct options_entry *options_find(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(
 | 
					void printflike3 options_set_string(
 | 
				
			||||||
    	    struct options *, const char *, const char *, ...);
 | 
					    	    struct options *, const char *, const char *, ...);
 | 
				
			||||||
char   *options_get_string(struct options *, const char *);
 | 
					char   *options_get_string(struct options *, const char *);
 | 
				
			||||||
@@ -1287,7 +1287,6 @@ const char *key_string_lookup_key(int);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* server.c */
 | 
					/* server.c */
 | 
				
			||||||
extern struct clients clients;
 | 
					extern struct clients clients;
 | 
				
			||||||
struct client *server_create_client(int);
 | 
					 | 
				
			||||||
int	 server_client_index(struct client *);
 | 
					int	 server_client_index(struct client *);
 | 
				
			||||||
int	 server_start(char *);
 | 
					int	 server_start(char *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1467,9 +1466,9 @@ struct window	*window_create1(u_int, u_int);
 | 
				
			|||||||
struct window	*window_create(const char *, const char *,
 | 
					struct window	*window_create(const char *, const char *,
 | 
				
			||||||
		     const char *, const char **, u_int, u_int, u_int, char **);
 | 
							     const char *, const char **, u_int, u_int, u_int, char **);
 | 
				
			||||||
void		 window_destroy(struct window *);
 | 
					void		 window_destroy(struct window *);
 | 
				
			||||||
int		 window_resize(struct window *, u_int, u_int);
 | 
					 | 
				
			||||||
void		 window_set_active_pane(struct window *, struct window_pane *);
 | 
					void		 window_set_active_pane(struct window *, struct window_pane *);
 | 
				
			||||||
struct window_pane *window_add_pane(struct window *, u_int, char **);
 | 
					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 *);
 | 
					void		 window_remove_pane(struct window *, struct window_pane *);
 | 
				
			||||||
struct window_pane *window_pane_at_index(struct window *, u_int);
 | 
					struct window_pane *window_pane_at_index(struct window *, u_int);
 | 
				
			||||||
u_int		 window_pane_index(struct window *, struct window_pane *);
 | 
					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 *);
 | 
					void		 window_pane_destroy(struct window_pane *);
 | 
				
			||||||
int		 window_pane_spawn(struct window_pane *,
 | 
					int		 window_pane_spawn(struct window_pane *,
 | 
				
			||||||
		     const char *, const char *, const char **, char **);
 | 
							     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(
 | 
					int		 window_pane_set_mode(
 | 
				
			||||||
		     struct window_pane *, const struct window_mode *);
 | 
							     struct window_pane *, const struct window_mode *);
 | 
				
			||||||
void		 window_pane_reset_mode(struct window_pane *);
 | 
					void		 window_pane_reset_mode(struct window_pane *);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								window.c
									
									
									
									
									
								
							@@ -301,13 +301,11 @@ window_destroy(struct window *w)
 | 
				
			|||||||
	xfree(w);
 | 
						xfree(w);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					void
 | 
				
			||||||
window_resize(struct window *w, u_int sx, u_int sy)
 | 
					window_resize(struct window *w, u_int sx, u_int sy)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	w->sx = sx;
 | 
						w->sx = sx;
 | 
				
			||||||
	w->sy = sy;
 | 
						w->sy = sy;
 | 
				
			||||||
 | 
					 | 
				
			||||||
	return (0);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
@@ -532,13 +530,13 @@ window_pane_spawn(struct window_pane *wp,
 | 
				
			|||||||
	return (0);
 | 
						return (0);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					void
 | 
				
			||||||
window_pane_resize(struct window_pane *wp, u_int sx, u_int sy)
 | 
					window_pane_resize(struct window_pane *wp, u_int sx, u_int sy)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct winsize	ws;
 | 
						struct winsize	ws;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (sx == wp->sx && sy == wp->sy)
 | 
						if (sx == wp->sx && sy == wp->sy)
 | 
				
			||||||
		return (-1);
 | 
							return;
 | 
				
			||||||
	wp->sx = sx;
 | 
						wp->sx = sx;
 | 
				
			||||||
	wp->sy = sy;
 | 
						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)
 | 
						if (wp->fd != -1 && ioctl(wp->fd, TIOCSWINSZ, &ws) == -1)
 | 
				
			||||||
		fatal("ioctl failed");
 | 
							fatal("ioctl failed");
 | 
				
			||||||
	return (0);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
@@ -560,9 +557,8 @@ window_pane_set_mode(struct window_pane *wp, const struct window_mode *mode)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	struct screen	*s;
 | 
						struct screen	*s;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (wp->mode != NULL || wp->mode == mode)
 | 
						if (wp->mode != NULL)
 | 
				
			||||||
		return (1);
 | 
							return (1);
 | 
				
			||||||
 | 
					 | 
				
			||||||
	wp->mode = mode;
 | 
						wp->mode = mode;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((s = wp->mode->init(wp)) != NULL)
 | 
						if ((s = wp->mode->init(wp)) != NULL)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user