mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Client flags was changed to uint64_t a while ago, fix a few cases where
it is still int (do not matter now but will with some new flags). From Michael Grant.
This commit is contained in:
		
							
								
								
									
										5
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								client.c
									
									
									
									
									
								
							@@ -445,11 +445,12 @@ client_send_identify(const char *ttynam, const char *termname, char **caps,
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
	char	**ss;
 | 
						char	**ss;
 | 
				
			||||||
	size_t	  sslen;
 | 
						size_t	  sslen;
 | 
				
			||||||
	int	  fd, flags = client_flags;
 | 
						int	  fd;
 | 
				
			||||||
 | 
						uint64_t  flags = client_flags;
 | 
				
			||||||
	pid_t	  pid;
 | 
						pid_t	  pid;
 | 
				
			||||||
	u_int	  i;
 | 
						u_int	  i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	proc_send(client_peer, MSG_IDENTIFY_FLAGS, -1, &flags, sizeof flags);
 | 
						proc_send(client_peer, MSG_IDENTIFY_LONGFLAGS, -1, &flags, sizeof flags);
 | 
				
			||||||
	proc_send(client_peer, MSG_IDENTIFY_LONGFLAGS, -1, &client_flags,
 | 
						proc_send(client_peer, MSG_IDENTIFY_LONGFLAGS, -1, &client_flags,
 | 
				
			||||||
	    sizeof client_flags);
 | 
						    sizeof client_flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -496,8 +496,8 @@ screen_redraw_draw_pane_status(struct screen_redraw_ctx *ctx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Update status line and change flags if unchanged. */
 | 
					/* Update status line and change flags if unchanged. */
 | 
				
			||||||
static int
 | 
					static uint64_t
 | 
				
			||||||
screen_redraw_update(struct client *c, int flags)
 | 
					screen_redraw_update(struct client *c, uint64_t flags)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct window			*w = c->session->curw->window;
 | 
						struct window			*w = c->session->curw->window;
 | 
				
			||||||
	struct window_pane		*wp;
 | 
						struct window_pane		*wp;
 | 
				
			||||||
@@ -567,7 +567,7 @@ void
 | 
				
			|||||||
screen_redraw_screen(struct client *c)
 | 
					screen_redraw_screen(struct client *c)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct screen_redraw_ctx	ctx;
 | 
						struct screen_redraw_ctx	ctx;
 | 
				
			||||||
	int				flags;
 | 
						uint64_t			flags;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (c->flags & CLIENT_SUSPENDED)
 | 
						if (c->flags & CLIENT_SUSPENDED)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1870,7 +1870,8 @@ server_client_key_callback(struct cmdq_item *item, void *data)
 | 
				
			|||||||
	struct timeval			 tv;
 | 
						struct timeval			 tv;
 | 
				
			||||||
	struct key_table		*table, *first;
 | 
						struct key_table		*table, *first;
 | 
				
			||||||
	struct key_binding		*bd;
 | 
						struct key_binding		*bd;
 | 
				
			||||||
	int				 xtimeout, flags;
 | 
						int				 xtimeout;
 | 
				
			||||||
 | 
						uint64_t			 flags;
 | 
				
			||||||
	struct cmd_find_state		 fs;
 | 
						struct cmd_find_state		 fs;
 | 
				
			||||||
	key_code			 key0, prefix, prefix2;
 | 
						key_code			 key0, prefix, prefix2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -2569,7 +2570,8 @@ server_client_check_redraw(struct client *c)
 | 
				
			|||||||
	struct tty		*tty = &c->tty;
 | 
						struct tty		*tty = &c->tty;
 | 
				
			||||||
	struct window		*w = c->session->curw->window;
 | 
						struct window		*w = c->session->curw->window;
 | 
				
			||||||
	struct window_pane	*wp;
 | 
						struct window_pane	*wp;
 | 
				
			||||||
	int			 needed, flags, mode = tty->mode, new_flags = 0;
 | 
						int			 needed, tty_flags, mode = tty->mode;
 | 
				
			||||||
 | 
						uint64_t		 client_flags = 0;
 | 
				
			||||||
	int			 redraw;
 | 
						int			 redraw;
 | 
				
			||||||
	u_int			 bit = 0;
 | 
						u_int			 bit = 0;
 | 
				
			||||||
	struct timeval		 tv = { .tv_usec = 1000 };
 | 
						struct timeval		 tv = { .tv_usec = 1000 };
 | 
				
			||||||
@@ -2603,7 +2605,7 @@ server_client_check_redraw(struct client *c)
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (needed)
 | 
							if (needed)
 | 
				
			||||||
			new_flags |= CLIENT_REDRAWPANES;
 | 
								client_flags |= CLIENT_REDRAWPANES;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (needed && (left = EVBUFFER_LENGTH(tty->out)) != 0) {
 | 
						if (needed && (left = EVBUFFER_LENGTH(tty->out)) != 0) {
 | 
				
			||||||
		log_debug("%s: redraw deferred (%zu left)", c->name, left);
 | 
							log_debug("%s: redraw deferred (%zu left)", c->name, left);
 | 
				
			||||||
@@ -2626,20 +2628,20 @@ server_client_check_redraw(struct client *c)
 | 
				
			|||||||
					 * If more that 64 panes, give up and
 | 
										 * If more that 64 panes, give up and
 | 
				
			||||||
					 * just redraw the window.
 | 
										 * just redraw the window.
 | 
				
			||||||
					 */
 | 
										 */
 | 
				
			||||||
					new_flags &= CLIENT_REDRAWPANES;
 | 
										client_flags &= CLIENT_REDRAWPANES;
 | 
				
			||||||
					new_flags |= CLIENT_REDRAWWINDOW;
 | 
										client_flags |= CLIENT_REDRAWWINDOW;
 | 
				
			||||||
					break;
 | 
										break;
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			if (c->redraw_panes != 0)
 | 
								if (c->redraw_panes != 0)
 | 
				
			||||||
				c->flags |= CLIENT_REDRAWPANES;
 | 
									c->flags |= CLIENT_REDRAWPANES;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		c->flags |= new_flags;
 | 
							c->flags |= client_flags;
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	} else if (needed)
 | 
						} else if (needed)
 | 
				
			||||||
		log_debug("%s: redraw needed", c->name);
 | 
							log_debug("%s: redraw needed", c->name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	flags = tty->flags & (TTY_BLOCK|TTY_FREEZE|TTY_NOCURSOR);
 | 
						tty_flags = tty->flags & (TTY_BLOCK|TTY_FREEZE|TTY_NOCURSOR);
 | 
				
			||||||
	tty->flags = (tty->flags & ~(TTY_BLOCK|TTY_FREEZE))|TTY_NOCURSOR;
 | 
						tty->flags = (tty->flags & ~(TTY_BLOCK|TTY_FREEZE))|TTY_NOCURSOR;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (~c->flags & CLIENT_REDRAWWINDOW) {
 | 
						if (~c->flags & CLIENT_REDRAWWINDOW) {
 | 
				
			||||||
@@ -2671,9 +2673,10 @@ server_client_check_redraw(struct client *c)
 | 
				
			|||||||
		screen_redraw_screen(c);
 | 
							screen_redraw_screen(c);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	tty->flags = (tty->flags & ~TTY_NOCURSOR)|(flags & TTY_NOCURSOR);
 | 
						tty->flags = (tty->flags & ~TTY_NOCURSOR)|(tty_flags & TTY_NOCURSOR);
 | 
				
			||||||
	tty_update_mode(tty, mode, NULL);
 | 
						tty_update_mode(tty, mode, NULL);
 | 
				
			||||||
	tty->flags = (tty->flags & ~(TTY_BLOCK|TTY_FREEZE|TTY_NOCURSOR))|flags;
 | 
						tty->flags = (tty->flags & ~(TTY_BLOCK|TTY_FREEZE|TTY_NOCURSOR))|
 | 
				
			||||||
 | 
						    tty_flags;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	c->flags &= ~(CLIENT_ALLREDRAWFLAGS|CLIENT_STATUSFORCE);
 | 
						c->flags &= ~(CLIENT_ALLREDRAWFLAGS|CLIENT_STATUSFORCE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										6
									
								
								server.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								server.c
									
									
									
									
									
								
							@@ -104,8 +104,8 @@ server_check_marked(void)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Create server socket. */
 | 
					/* Create server socket. */
 | 
				
			||||||
static int
 | 
					int
 | 
				
			||||||
server_create_socket(int flags, char **cause)
 | 
					server_create_socket(uint64_t flags, char **cause)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct sockaddr_un	sa;
 | 
						struct sockaddr_un	sa;
 | 
				
			||||||
	size_t			size;
 | 
						size_t			size;
 | 
				
			||||||
@@ -170,7 +170,7 @@ server_tidy_event(__unused int fd, __unused short events, __unused void *data)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* Fork new server. */
 | 
					/* Fork new server. */
 | 
				
			||||||
int
 | 
					int
 | 
				
			||||||
server_start(struct tmuxproc *client, int flags, struct event_base *base,
 | 
					server_start(struct tmuxproc *client, uint64_t flags, struct event_base *base,
 | 
				
			||||||
    int lockfd, char *lockfile)
 | 
					    int lockfd, char *lockfile)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int		 fd;
 | 
						int		 fd;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								tmux.h
									
									
									
									
									
								
							@@ -2703,10 +2703,12 @@ void	 server_clear_marked(void);
 | 
				
			|||||||
int	 server_is_marked(struct session *, struct winlink *,
 | 
					int	 server_is_marked(struct session *, struct winlink *,
 | 
				
			||||||
	     struct window_pane *);
 | 
						     struct window_pane *);
 | 
				
			||||||
int	 server_check_marked(void);
 | 
					int	 server_check_marked(void);
 | 
				
			||||||
int	 server_start(struct tmuxproc *, int, struct event_base *, int, char *);
 | 
					int	 server_start(struct tmuxproc *, uint64_t, struct event_base *, int,
 | 
				
			||||||
 | 
						     char *);
 | 
				
			||||||
void	 server_update_socket(void);
 | 
					void	 server_update_socket(void);
 | 
				
			||||||
void	 server_add_accept(int);
 | 
					void	 server_add_accept(int);
 | 
				
			||||||
void printflike(1, 2) server_add_message(const char *, ...);
 | 
					void printflike(1, 2) server_add_message(const char *, ...);
 | 
				
			||||||
 | 
					int	 server_create_socket(uint64_t, char **);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* server-client.c */
 | 
					/* server-client.c */
 | 
				
			||||||
RB_PROTOTYPE(client_windows, client_window, entry, server_client_window_cmp);
 | 
					RB_PROTOTYPE(client_windows, client_window, entry, server_client_window_cmp);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user