mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	GRID_DEBUG is no longer needed.
This commit is contained in:
		
							
								
								
									
										22
									
								
								grid-view.c
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								grid-view.c
									
									
									
									
									
								
							@@ -59,8 +59,6 @@ grid_view_clear_history(struct grid *gd)
 | 
			
		||||
	struct grid_line	*gl;
 | 
			
		||||
	u_int			 yy, last;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "");
 | 
			
		||||
 | 
			
		||||
	/* Find the last used line. */
 | 
			
		||||
	last = 0;
 | 
			
		||||
	for (yy = 0; yy < gd->sy; yy++) {
 | 
			
		||||
@@ -82,8 +80,6 @@ grid_view_clear_history(struct grid *gd)
 | 
			
		||||
void
 | 
			
		||||
grid_view_clear(struct grid *gd, u_int px, u_int py, u_int nx, u_int ny)
 | 
			
		||||
{
 | 
			
		||||
	GRID_DEBUG(gd, "px=%u, py=%u, nx=%u, ny=%u", px, py, nx, ny);
 | 
			
		||||
 | 
			
		||||
	px = grid_view_x(gd, px);
 | 
			
		||||
	py = grid_view_y(gd, py);
 | 
			
		||||
 | 
			
		||||
@@ -94,8 +90,6 @@ grid_view_clear(struct grid *gd, u_int px, u_int py, u_int nx, u_int ny)
 | 
			
		||||
void
 | 
			
		||||
grid_view_scroll_region_up(struct grid *gd, u_int rupper, u_int rlower)
 | 
			
		||||
{
 | 
			
		||||
	GRID_DEBUG(gd, "rupper=%u, rlower=%u", rupper, rlower);
 | 
			
		||||
 | 
			
		||||
	if (gd->flags & GRID_HISTORY) {
 | 
			
		||||
		grid_collect_history(gd);
 | 
			
		||||
		if (rupper == 0 && rlower == gd->sy - 1)
 | 
			
		||||
@@ -116,8 +110,6 @@ grid_view_scroll_region_up(struct grid *gd, u_int rupper, u_int rlower)
 | 
			
		||||
void
 | 
			
		||||
grid_view_scroll_region_down(struct grid *gd, u_int rupper, u_int rlower)
 | 
			
		||||
{
 | 
			
		||||
	GRID_DEBUG(gd, "rupper=%u, rlower=%u", rupper, rlower);
 | 
			
		||||
 | 
			
		||||
	rupper = grid_view_y(gd, rupper);
 | 
			
		||||
	rlower = grid_view_y(gd, rlower);
 | 
			
		||||
 | 
			
		||||
@@ -130,8 +122,6 @@ grid_view_insert_lines(struct grid *gd, u_int py, u_int ny)
 | 
			
		||||
{
 | 
			
		||||
	u_int	sy;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "py=%u, ny=%u", py, ny);
 | 
			
		||||
 | 
			
		||||
	py = grid_view_y(gd, py);
 | 
			
		||||
 | 
			
		||||
	sy = grid_view_y(gd, gd->sy);
 | 
			
		||||
@@ -145,8 +135,6 @@ grid_view_insert_lines_region(struct grid *gd, u_int rlower, u_int py, u_int ny)
 | 
			
		||||
{
 | 
			
		||||
	u_int	ny2;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "rlower=%u, py=%u, ny=%u", rlower, py, ny);
 | 
			
		||||
 | 
			
		||||
	rlower = grid_view_y(gd, rlower);
 | 
			
		||||
 | 
			
		||||
	py = grid_view_y(gd, py);
 | 
			
		||||
@@ -162,8 +150,6 @@ grid_view_delete_lines(struct grid *gd, u_int py, u_int ny)
 | 
			
		||||
{
 | 
			
		||||
	u_int	sy;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "py=%u, ny=%u", py, ny);
 | 
			
		||||
 | 
			
		||||
	py = grid_view_y(gd, py);
 | 
			
		||||
 | 
			
		||||
	sy = grid_view_y(gd, gd->sy);
 | 
			
		||||
@@ -178,8 +164,6 @@ grid_view_delete_lines_region(struct grid *gd, u_int rlower, u_int py, u_int ny)
 | 
			
		||||
{
 | 
			
		||||
	u_int	ny2;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "rlower=%u, py=%u, ny=%u", rlower, py, ny);
 | 
			
		||||
 | 
			
		||||
	rlower = grid_view_y(gd, rlower);
 | 
			
		||||
 | 
			
		||||
	py = grid_view_y(gd, py);
 | 
			
		||||
@@ -195,8 +179,6 @@ grid_view_insert_cells(struct grid *gd, u_int px, u_int py, u_int nx)
 | 
			
		||||
{
 | 
			
		||||
	u_int	sx;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx);
 | 
			
		||||
 | 
			
		||||
	px = grid_view_x(gd, px);
 | 
			
		||||
	py = grid_view_y(gd, py);
 | 
			
		||||
 | 
			
		||||
@@ -214,8 +196,6 @@ grid_view_delete_cells(struct grid *gd, u_int px, u_int py, u_int nx)
 | 
			
		||||
{
 | 
			
		||||
	u_int	sx;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx);
 | 
			
		||||
 | 
			
		||||
	px = grid_view_x(gd, px);
 | 
			
		||||
	py = grid_view_y(gd, py);
 | 
			
		||||
 | 
			
		||||
@@ -229,8 +209,6 @@ grid_view_delete_cells(struct grid *gd, u_int px, u_int py, u_int nx)
 | 
			
		||||
char *
 | 
			
		||||
grid_view_string_cells(struct grid *gd, u_int px, u_int py, u_int nx)
 | 
			
		||||
{
 | 
			
		||||
	GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx);
 | 
			
		||||
 | 
			
		||||
	px = grid_view_x(gd, px);
 | 
			
		||||
	py = grid_view_y(gd, py);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								grid.c
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								grid.c
									
									
									
									
									
								
							@@ -151,8 +151,6 @@ grid_collect_history(struct grid *gd)
 | 
			
		||||
{
 | 
			
		||||
	u_int	yy;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "");
 | 
			
		||||
 | 
			
		||||
	if (gd->hsize < gd->hlimit)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
@@ -173,8 +171,6 @@ grid_scroll_history(struct grid *gd)
 | 
			
		||||
{
 | 
			
		||||
	u_int	yy;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "");
 | 
			
		||||
 | 
			
		||||
	yy = gd->hsize + gd->sy;
 | 
			
		||||
	gd->linedata = xrealloc(gd->linedata, yy + 1, sizeof *gd->linedata);
 | 
			
		||||
	memset(&gd->linedata[yy], 0, sizeof gd->linedata[yy]);
 | 
			
		||||
@@ -189,8 +185,6 @@ grid_scroll_history_region(struct grid *gd, u_int upper, u_int lower)
 | 
			
		||||
	struct grid_line	*gl_history, *gl_upper, *gl_lower;
 | 
			
		||||
	u_int			 yy;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "upper=%u, lower=%u", upper, lower);
 | 
			
		||||
 | 
			
		||||
	/* Create a space for a new line. */
 | 
			
		||||
	yy = gd->hsize + gd->sy;
 | 
			
		||||
	gd->linedata = xrealloc(gd->linedata, yy + 1, sizeof *gd->linedata);
 | 
			
		||||
@@ -282,8 +276,6 @@ grid_clear(struct grid *gd, u_int px, u_int py, u_int nx, u_int ny)
 | 
			
		||||
{
 | 
			
		||||
	u_int	xx, yy;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "px=%u, py=%u, nx=%u, ny=%u", px, py, nx, ny);
 | 
			
		||||
 | 
			
		||||
	if (nx == 0 || ny == 0)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
@@ -319,8 +311,6 @@ grid_clear_lines(struct grid *gd, u_int py, u_int ny)
 | 
			
		||||
	struct grid_line	*gl;
 | 
			
		||||
	u_int			 yy;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "py=%u, ny=%u", py, ny);
 | 
			
		||||
 | 
			
		||||
	if (ny == 0)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
@@ -342,8 +332,6 @@ grid_move_lines(struct grid *gd, u_int dy, u_int py, u_int ny)
 | 
			
		||||
{
 | 
			
		||||
	u_int	yy;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "dy=%u, py=%u, ny=%u", dy, py, ny);
 | 
			
		||||
 | 
			
		||||
	if (ny == 0 || py == dy)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
@@ -381,8 +369,6 @@ grid_move_cells(struct grid *gd, u_int dx, u_int px, u_int py, u_int nx)
 | 
			
		||||
	struct grid_line	*gl;
 | 
			
		||||
	u_int			 xx;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "dx=%u, px=%u, py=%u, nx=%u", dx, px, py, nx);
 | 
			
		||||
 | 
			
		||||
	if (nx == 0 || px == dx)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
@@ -592,8 +578,6 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx,
 | 
			
		||||
	u_int			 xx;
 | 
			
		||||
	const struct grid_line	*gl;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx);
 | 
			
		||||
 | 
			
		||||
	if (lastgc != NULL && *lastgc == NULL) {
 | 
			
		||||
		memcpy(&lastgc1, &grid_default_cell, sizeof lastgc1);
 | 
			
		||||
		*lastgc = &lastgc1;
 | 
			
		||||
@@ -661,8 +645,6 @@ grid_duplicate_lines(struct grid *dst, u_int dy, struct grid *src, u_int sy,
 | 
			
		||||
	struct grid_line	*dstl, *srcl;
 | 
			
		||||
	u_int			 yy;
 | 
			
		||||
 | 
			
		||||
	GRID_DEBUG(src, "dy=%u, sy=%u, ny=%u", dy, sy, ny);
 | 
			
		||||
 | 
			
		||||
	if (dy + ny > dst->hsize + dst->sy)
 | 
			
		||||
		ny = dst->hsize + dst->sy - dy;
 | 
			
		||||
	if (sy + ny > src->hsize + src->sy)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										10
									
								
								tmux.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								tmux.h
									
									
									
									
									
								
							@@ -663,16 +663,6 @@ struct utf8_data {
 | 
			
		||||
	u_int	width;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* Grid output. */
 | 
			
		||||
#if defined(DEBUG) && \
 | 
			
		||||
    ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
 | 
			
		||||
     (defined(__GNUC__) && __GNUC__ >= 3))
 | 
			
		||||
#define GRID_DEBUG(gd, fmt, ...) log_debug2("%s: (sx=%u, sy=%u, hsize=%u) " \
 | 
			
		||||
    fmt, __func__, (gd)->sx, (gd)->sy, (gd)->hsize, ## __VA_ARGS__)
 | 
			
		||||
#else
 | 
			
		||||
#define GRID_DEBUG(...)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/* Grid attributes. */
 | 
			
		||||
#define GRID_ATTR_BRIGHT 0x1
 | 
			
		||||
#define GRID_ATTR_DIM 0x2
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user