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

Diff for /src/usr.bin/cvs/diff.c between version 1.48 and 1.49

version 1.48, 2005/07/10 21:50:25 version 1.49, 2005/07/11 01:26:47
Line 752 
Line 752 
   
         member = (int *)file[1];          member = (int *)file[1];
         equiv(sfile[0], slen[0], sfile[1], slen[1], member);          equiv(sfile[0], slen[0], sfile[1], slen[1], member);
         if ((tmp = realloc(member, (slen[1] + 2) * sizeof(int))) == NULL)          if ((tmp = realloc(member, (slen[1] + 2) * sizeof(int))) == NULL) {
                   free(member);
                   member = NULL;
                   cvs_log(LP_ERRNO, "failed to resize member");
                 goto closem;                  goto closem;
           }
         member = (int *)tmp;          member = (int *)tmp;
   
         class = (int *)file[0];          class = (int *)file[0];
         unsort(sfile[0], slen[0], class);          unsort(sfile[0], slen[0], class);
         if ((tmp = realloc(class, (slen[0] + 2) * sizeof(int))) == NULL)          if ((tmp = realloc(class, (slen[0] + 2) * sizeof(int))) == NULL) {
                   free(class);
                   class = NULL;
                   cvs_log(LP_ERRNO, "failed to resize class");
                 goto closem;                  goto closem;
           }
         class = (int *)tmp;          class = (int *)tmp;
   
         if ((klist = malloc((slen[0] + 2) * sizeof(int))) == NULL) {          if ((klist = malloc((slen[0] + 2) * sizeof(int))) == NULL) {
Line 779 
Line 787 
         free(member);          free(member);
         free(class);          free(class);
   
         J = realloc(J, (diff_len[0] + 2) * sizeof(int));          if ((tmp = realloc(J, (diff_len[0] + 2) * sizeof(int))) == NULL) {
                   free(J);
                   J = NULL;
                   cvs_log(LP_ERRNO, "failed to resize J");
                   status |= 2;
                   goto closem;
           }
           J = (int *)tmp;
         unravel(klist[i]);          unravel(klist[i]);
         free(clist);          free(clist);
         free(klist);          free(klist);
   
         ixold = realloc(ixold, (diff_len[0] + 2) * sizeof(long));          if ((tmp = realloc(ixold, (diff_len[0] + 2) * sizeof(long))) == NULL) {
         ixnew = realloc(ixnew, (diff_len[1] + 2) * sizeof(long));                  free(ixold);
                   ixold = NULL;
                   cvs_log(LP_ERRNO, "failed to resize ixold");
                   status |= 2;
                   goto closem;
           }
           ixold = (long *)tmp;
           if ((tmp = realloc(ixnew, (diff_len[1] + 2) * sizeof(long))) == NULL) {
                   free(ixnew);
                   ixnew = NULL;
                   cvs_log(LP_ERRNO, "failed to resize ixnew");
                   status |= 2;
                   goto closem;
           }
           ixnew = (long *)tmp;
         check(f1, f2);          check(f1, f2);
         output(file1, f1, file2, f2);          output(file1, f1, file2, f2);
   
Line 992 
Line 1021 
 static int  static int
 newcand(int x, int y, int pred)  newcand(int x, int y, int pred)
 {  {
         struct cand *q;          struct cand *q, *tmp;
           int newclistlen;
   
         if (clen == clistlen) {          if (clen == clistlen) {
                 clistlen = clistlen * 11 / 10;                  newclistlen = clistlen * 11 / 10;
                 clist = realloc(clist, clistlen * sizeof(cand));                  tmp = realloc(clist, newclistlen * sizeof(cand));
                 if (clist == NULL) {                  if (tmp == NULL) {
                         cvs_log(LP_ERRNO, "failed to resize clist");                          cvs_log(LP_ERRNO, "failed to resize clist");
                         return (-1);                          return (-1);
                 }                  }
                   clist = tmp;
                   clistlen = newclistlen;
         }          }
         q = clist + clen;          q = clist + clen;
         q->x = x;          q->x = x;
Line 1344 
Line 1376 
                  * Allocate change records as needed.                   * Allocate change records as needed.
                  */                   */
                 if (context_vec_ptr == context_vec_end - 1) {                  if (context_vec_ptr == context_vec_end - 1) {
                           struct context_vec *tmp;
                         ptrdiff_t offset = context_vec_ptr - context_vec_start;                          ptrdiff_t offset = context_vec_ptr - context_vec_start;
                         max_context <<= 1;                          max_context <<= 1;
                         context_vec_start = realloc(context_vec_start,                          if ((tmp = realloc(context_vec_start,
                             max_context * sizeof(struct context_vec));                              max_context * sizeof(struct context_vec))) == NULL) {
                                   free(context_vec_start);
                                   context_vec_start = NULL;
                                   cvs_log(LP_ERRNO,
                                       "failed to resize context_vec_start");
                                   return;
                           }
                           context_vec_start = tmp;
                         context_vec_end = context_vec_start + max_context;                          context_vec_end = context_vec_start + max_context;
                         context_vec_ptr = context_vec_start + offset;                          context_vec_ptr = context_vec_start + offset;
                 }                  }

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.49