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

Diff for /src/usr.bin/diff/diffreg.c between version 1.83 and 1.84

version 1.83, 2014/08/27 15:22:40 version 1.84, 2015/01/16 06:40:07
Line 64 
Line 64 
  *      @(#)diffreg.c   8.1 (Berkeley) 6/6/93   *      @(#)diffreg.c   8.1 (Berkeley) 6/6/93
  */   */
   
 #include <sys/param.h>  
 #include <sys/stat.h>  #include <sys/stat.h>
 #include <sys/wait.h>  #include <sys/wait.h>
   
Line 77 
Line 76 
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
 #include <unistd.h>  #include <unistd.h>
   #include <limits.h>
   
 #include "diff.h"  #include "diff.h"
 #include "pathnames.h"  #include "pathnames.h"
 #include "xmalloc.h"  #include "xmalloc.h"
   
   #define MINIMUM(a, b)   (((a) < (b)) ? (a) : (b))
   #define MAXIMUM(a, b)   (((a) > (b)) ? (a) : (b))
   
 /*  /*
  * diff - compare two files.   * diff - compare two files.
  */   */
Line 495 
Line 498 
 static FILE *  static FILE *
 opentemp(const char *file)  opentemp(const char *file)
 {  {
         char buf[BUFSIZ], *tempdir, tempfile[MAXPATHLEN];          char buf[BUFSIZ], *tempdir, tempfile[PATH_MAX];
         ssize_t nread;          ssize_t nread;
         int ifd, ofd;          int ifd, ofd;
   
Line 653 
Line 656 
                 bound = UINT_MAX;                  bound = UINT_MAX;
         else {          else {
                 sq = isqrt(n);                  sq = isqrt(n);
                 bound = MAX(256, sq);                  bound = MAXIMUM(256, sq);
         }          }
   
         k = 0;          k = 0;
Line 1360 
Line 1363 
                 return;                  return;
   
         b = d = 0;              /* gcc */          b = d = 0;              /* gcc */
         lowa = MAX(1, cvp->a - diff_context);          lowa = MAXIMUM(1, cvp->a - diff_context);
         upb = MIN(len[0], context_vec_ptr->b + diff_context);          upb = MINIMUM(len[0], context_vec_ptr->b + diff_context);
         lowc = MAX(1, cvp->c - diff_context);          lowc = MAXIMUM(1, cvp->c - diff_context);
         upd = MIN(len[1], context_vec_ptr->d + diff_context);          upd = MINIMUM(len[1], context_vec_ptr->d + diff_context);
   
         diff_output("***************");          diff_output("***************");
         if ((flags & D_PROTOTYPE)) {          if ((flags & D_PROTOTYPE)) {
Line 1463 
Line 1466 
                 return;                  return;
   
         b = d = 0;              /* gcc */          b = d = 0;              /* gcc */
         lowa = MAX(1, cvp->a - diff_context);          lowa = MAXIMUM(1, cvp->a - diff_context);
         upb = MIN(len[0], context_vec_ptr->b + diff_context);          upb = MINIMUM(len[0], context_vec_ptr->b + diff_context);
         lowc = MAX(1, cvp->c - diff_context);          lowc = MAXIMUM(1, cvp->c - diff_context);
         upd = MIN(len[1], context_vec_ptr->d + diff_context);          upd = MINIMUM(len[1], context_vec_ptr->d + diff_context);
   
         diff_output("@@ -");          diff_output("@@ -");
         uni_range(lowa, upb);          uni_range(lowa, upb);

Legend:
Removed from v.1.83  
changed lines
  Added in v.1.84