[BACK]Return to grid.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/grid.c between version 1.80 and 1.81

version 1.80, 2018/02/16 09:51:41 version 1.81, 2018/04/18 14:31:42
Line 166 
Line 166 
   
 /* Check grid y position. */  /* Check grid y position. */
 static int  static int
 grid_check_y(struct grid *gd, u_int py)  grid_check_y(struct grid *gd, const char* from, u_int py)
 {  {
         if (py >= gd->hsize + gd->sy) {          if (py >= gd->hsize + gd->sy) {
                 log_debug("y out of range: %u", py);                  log_debug("%s: y out of range: %u", from, py);
                 return (-1);                  return (-1);
         }          }
         return (0);          return (0);
Line 407 
Line 407 
 const struct grid_line *  const struct grid_line *
 grid_peek_line(struct grid *gd, u_int py)  grid_peek_line(struct grid *gd, u_int py)
 {  {
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, __func__, py) != 0)
                 return (NULL);                  return (NULL);
         return (&gd->linedata[py]);          return (&gd->linedata[py]);
 }  }
Line 441 
Line 441 
 void  void
 grid_get_cell(struct grid *gd, u_int px, u_int py, struct grid_cell *gc)  grid_get_cell(struct grid *gd, u_int px, u_int py, struct grid_cell *gc)
 {  {
         if (grid_check_y(gd, py) != 0 || px >= gd->linedata[py].cellsize) {          if (grid_check_y(gd, __func__, py) != 0 ||
               px >= gd->linedata[py].cellsize) {
                 memcpy(gc, &grid_default_cell, sizeof *gc);                  memcpy(gc, &grid_default_cell, sizeof *gc);
                 return;                  return;
         }          }
Line 455 
Line 456 
         struct grid_line        *gl;          struct grid_line        *gl;
         struct grid_cell_entry  *gce;          struct grid_cell_entry  *gce;
   
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, __func__, py) != 0)
                 return;                  return;
   
         grid_expand_line(gd, py, px + 1, 8);          grid_expand_line(gd, py, px + 1, 8);
Line 481 
Line 482 
         struct grid_cell        *gcp;          struct grid_cell        *gcp;
         u_int                    i;          u_int                    i;
   
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, __func__, py) != 0)
                 return;                  return;
   
         grid_expand_line(gd, py, px + slen, 8);          grid_expand_line(gd, py, px + slen, 8);
Line 514 
Line 515 
                 return;                  return;
         }          }
   
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, __func__, py) != 0)
                 return;                  return;
         if (grid_check_y(gd, py + ny - 1) != 0)          if (grid_check_y(gd, __func__, py + ny - 1) != 0)
                 return;                  return;
   
         for (yy = py; yy < py + ny; yy++) {          for (yy = py; yy < py + ny; yy++) {
Line 543 
Line 544 
         if (ny == 0)          if (ny == 0)
                 return;                  return;
   
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, __func__, py) != 0)
                 return;                  return;
         if (grid_check_y(gd, py + ny - 1) != 0)          if (grid_check_y(gd, __func__, py + ny - 1) != 0)
                 return;                  return;
   
         for (yy = py; yy < py + ny; yy++) {          for (yy = py; yy < py + ny; yy++) {
Line 563 
Line 564 
         if (ny == 0 || py == dy)          if (ny == 0 || py == dy)
                 return;                  return;
   
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, __func__, py) != 0)
                 return;                  return;
         if (grid_check_y(gd, py + ny - 1) != 0)          if (grid_check_y(gd, __func__, py + ny - 1) != 0)
                 return;                  return;
         if (grid_check_y(gd, dy) != 0)          if (grid_check_y(gd, __func__, dy) != 0)
                 return;                  return;
         if (grid_check_y(gd, dy + ny - 1) != 0)          if (grid_check_y(gd, __func__, dy + ny - 1) != 0)
                 return;                  return;
   
         /* Free any lines which are being replaced. */          /* Free any lines which are being replaced. */
Line 603 
Line 604 
         if (nx == 0 || px == dx)          if (nx == 0 || px == dx)
                 return;                  return;
   
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, __func__, py) != 0)
                 return;                  return;
         gl = &gd->linedata[py];          gl = &gd->linedata[py];
   

Legend:
Removed from v.1.80  
changed lines
  Added in v.1.81