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

Diff for /src/usr.bin/mg/display.c between version 1.14 and 1.15

version 1.14, 2002/06/25 14:24:53 version 1.15, 2002/07/01 18:01:40
Line 118 
Line 118 
         static int first_run = 1;          static int first_run = 1;
         VIDEO *vp;          VIDEO *vp;
   
         if (newrow < 1 || newcol < 1) {          if (newrow < 1 || newcol < 1)
                 return -1;                  return (FALSE);
         }  
   
         rowchanged = (newrow != nrow);          rowchanged = (newrow != nrow);
         colchanged = (newcol != ncol);          colchanged = (newcol != ncol);
Line 129 
Line 128 
                 void *tmp;                                      \                  void *tmp;                                      \
                 if ((tmp = realloc((a), (n))) == NULL) {        \                  if ((tmp = realloc((a), (n))) == NULL) {        \
                         panic("out of memory in display code"); \                          panic("out of memory in display code"); \
                 }       \                  }                                               \
                 (a) = tmp;                                      \                  (a) = tmp;                                      \
         } while (0)          } while (0)
   
         /* No update needed */          /* No update needed */
         if (!first_run && !force && !rowchanged && !colchanged) {          if (!first_run && !force && !rowchanged && !colchanged) {
                 return 0;                  return (TRUE);
         }          }
   
         if (first_run) {          if (first_run) {
Line 173 
Line 172 
                 /*                  /*
                  * Zero-out the entries we just allocated                   * Zero-out the entries we just allocated
                  */                   */
                 for (i = vidstart; i < 2 * (newrow - 1); i++) {                  for (i = vidstart; i < 2 * (newrow - 1); i++)
                         memset(&video[i], 0, sizeof(VIDEO));                          memset(&video[i], 0, sizeof(VIDEO));
                 }  
   
                 /*                  /*
                  * Reinitialize vscreen and pscreen arrays completely.                   * Reinitialize vscreen and pscreen arrays completely.
Line 189 
Line 187 
                 }                  }
         }          }
         if (rowchanged || colchanged || first_run) {          if (rowchanged || colchanged || first_run) {
                 for (i = 0; i < 2 * (newrow - 1); i++) {                  for (i = 0; i < 2 * (newrow - 1); i++)
                         TRYREALLOC(video[i].v_text, newcol * sizeof(char));                          TRYREALLOC(video[i].v_text, newcol * sizeof(char));
                 }  
                 TRYREALLOC(blanks.v_text, newcol * sizeof(char));                  TRYREALLOC(blanks.v_text, newcol * sizeof(char));
         }          }
   
Line 204 
Line 201 
                 ttcol = ncol;                  ttcol = ncol;
   
         first_run = 0;          first_run = 0;
         return 0;          return (TRUE);
 }  }
   
 #undef TRYREALLOC  #undef TRYREALLOC

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15