mirror of
https://github.com/tmux/tmux.git
synced 2025-01-05 23:38:48 +00:00
Sync OpenBSD patchset 155:
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:
parent
0237e1dafd
commit
d29b57f597
8
input.c
8
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 <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -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
|
||||||
|
@ -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 <nicm@users.sourceforge.net>
|
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -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
|
||||||
|
18
server.c
18
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 <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -43,6 +43,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);
|
||||||
@ -51,7 +52,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 *);
|
||||||
@ -68,7 +69,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;
|
||||||
@ -106,11 +107,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. */
|
||||||
@ -740,7 +740,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;
|
||||||
@ -750,14 +750,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. */
|
||||||
|
9
tmux.h
9
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 <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -1013,7 +1013,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 *);
|
||||||
@ -1286,7 +1286,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 *);
|
||||||
|
|
||||||
@ -1466,9 +1465,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 *);
|
||||||
@ -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 *);
|
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 *);
|
||||||
|
14
window.c
14
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 <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -299,13 +299,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
|
||||||
@ -530,13 +528,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;
|
||||||
|
|
||||||
@ -559,7 +557,6 @@ window_pane_resize(struct window_pane *wp, u_int sx, u_int sy)
|
|||||||
if (errno != EINVAL)
|
if (errno != EINVAL)
|
||||||
#endif
|
#endif
|
||||||
fatal("ioctl failed");
|
fatal("ioctl failed");
|
||||||
return (0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -567,9 +564,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)
|
||||||
|
Loading…
Reference in New Issue
Block a user