[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.17 and 1.18

version 1.17, 2009/12/03 22:50:10 version 1.18, 2010/04/06 21:35:44
Line 46 
Line 46 
             gc, sizeof gd->linedata[py].utf8data[px]);          \              gc, sizeof gd->linedata[py].utf8data[px]);          \
 } while (0)  } while (0)
   
 int     grid_check_x(struct grid *, u_int);  
 int     grid_check_y(struct grid *, u_int);  int     grid_check_y(struct grid *, u_int);
   
 #ifdef DEBUG  #ifdef DEBUG
 int  int
 grid_check_x(struct grid *gd, u_int px)  
 {  
         if ((px) >= (gd)->sx)  
                 log_fatalx("x out of range: %u", px);  
         return (0);  
 }  
   
 int  
 grid_check_y(struct grid *gd, u_int py)  grid_check_y(struct grid *gd, u_int py)
 {  {
         if ((py) >= (gd)->hsize + (gd)->sy)          if ((py) >= (gd)->hsize + (gd)->sy)
Line 67 
Line 58 
 }  }
 #else  #else
 int  int
 grid_check_x(struct grid *gd, u_int px)  
 {  
         if ((px) >= (gd)->sx) {  
                 log_debug("x out of range: %u", px);  
                 return (-1);  
         }  
         return (0);  
 }  
   
 int  
 grid_check_y(struct grid *gd, u_int py)  grid_check_y(struct grid *gd, u_int py)
 {  {
         if ((py) >= (gd)->hsize + (gd)->sy) {          if ((py) >= (gd)->hsize + (gd)->sy) {
Line 270 
Line 251 
 const struct grid_cell *  const struct grid_cell *
 grid_peek_cell(struct grid *gd, u_int px, u_int py)  grid_peek_cell(struct grid *gd, u_int px, u_int py)
 {  {
         if (grid_check_x(gd, px) != 0)  
                 return (&grid_default_cell);  
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, py) != 0)
                 return (&grid_default_cell);                  return (&grid_default_cell);
   
Line 284 
Line 263 
 struct grid_cell *  struct grid_cell *
 grid_get_cell(struct grid *gd, u_int px, u_int py)  grid_get_cell(struct grid *gd, u_int px, u_int py)
 {  {
         if (grid_check_x(gd, px) != 0)  
                 return (NULL);  
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, py) != 0)
                 return (NULL);                  return (NULL);
   
Line 298 
Line 275 
 grid_set_cell(  grid_set_cell(
     struct grid *gd, u_int px, u_int py, const struct grid_cell *gc)      struct grid *gd, u_int px, u_int py, const struct grid_cell *gc)
 {  {
         if (grid_check_x(gd, px) != 0)  
                 return;  
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, py) != 0)
                 return;                  return;
   
Line 311 
Line 286 
 const struct grid_utf8 *  const struct grid_utf8 *
 grid_peek_utf8(struct grid *gd, u_int px, u_int py)  grid_peek_utf8(struct grid *gd, u_int px, u_int py)
 {  {
         if (grid_check_x(gd, px) != 0)  
                 return (NULL);  
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, py) != 0)
                 return (NULL);                  return (NULL);
   
Line 325 
Line 298 
 struct grid_utf8 *  struct grid_utf8 *
 grid_get_utf8(struct grid *gd, u_int px, u_int py)  grid_get_utf8(struct grid *gd, u_int px, u_int py)
 {  {
         if (grid_check_x(gd, px) != 0)  
                 return (NULL);  
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, py) != 0)
                 return (NULL);                  return (NULL);
   
Line 339 
Line 310 
 grid_set_utf8(  grid_set_utf8(
     struct grid *gd, u_int px, u_int py, const struct grid_utf8 *gc)      struct grid *gd, u_int px, u_int py, const struct grid_utf8 *gc)
 {  {
         if (grid_check_x(gd, px) != 0)  
                 return;  
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, py) != 0)
                 return;                  return;
   
Line 364 
Line 333 
                 return;                  return;
         }          }
   
         if (grid_check_x(gd, px) != 0)  
                 return;  
         if (grid_check_x(gd, px + nx - 1) != 0)  
                 return;  
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, py) != 0)
                 return;                  return;
         if (grid_check_y(gd, py + ny - 1) != 0)          if (grid_check_y(gd, py + ny - 1) != 0)
Line 465 
Line 430 
         if (nx == 0 || px == dx)          if (nx == 0 || px == dx)
                 return;                  return;
   
         if (grid_check_x(gd, px) != 0)  
                 return;  
         if (grid_check_x(gd, px + nx - 1) != 0)  
                 return;  
         if (grid_check_x(gd, dx + nx - 1) != 0)  
                 return;  
         if (grid_check_y(gd, py) != 0)          if (grid_check_y(gd, py) != 0)
                 return;                  return;
         gl = &gd->linedata[py];          gl = &gd->linedata[py];

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18