svn commit: r315743 - head/usr.bin/diff

Baptiste Daroussin bapt at FreeBSD.org
Wed Mar 22 21:35:02 UTC 2017


Author: bapt
Date: Wed Mar 22 21:35:01 2017
New Revision: 315743
URL: https://svnweb.freebsd.org/changeset/base/315743

Log:
  Use MAX and MIN macros from sys/param.h

Modified:
  head/usr.bin/diff/diffreg.c

Modified: head/usr.bin/diff/diffreg.c
==============================================================================
--- head/usr.bin/diff/diffreg.c	Wed Mar 22 21:32:44 2017	(r315742)
+++ head/usr.bin/diff/diffreg.c	Wed Mar 22 21:35:01 2017	(r315743)
@@ -100,9 +100,6 @@ __FBSDID("$FreeBSD$");
 # define TIMESPEC_NS(timespec) 0
 #endif
 
-#define MINIMUM(a, b)	(((a) < (b)) ? (a) : (b))
-#define MAXIMUM(a, b)	(((a) > (b)) ? (a) : (b))
-
 /*
  * diff - compare two files.
  */
@@ -709,7 +706,7 @@ stone(int *a, int n, int *b, int *c, int
 		bound = UINT_MAX;
 	else {
 		sq = isqrt(n);
-		bound = MAXIMUM(256, sq);
+		bound = MAX(256, sq);
 	}
 
 	k = 0;
@@ -1446,10 +1443,10 @@ dump_context_vec(FILE *f1, FILE *f2, int
 		return;
 
 	b = d = 0;		/* gcc */
-	lowa = MAXIMUM(1, cvp->a - diff_context);
-	upb = MINIMUM(len[0], context_vec_ptr->b + diff_context);
-	lowc = MAXIMUM(1, cvp->c - diff_context);
-	upd = MINIMUM(len[1], context_vec_ptr->d + diff_context);
+	lowa = MAX(1, cvp->a - diff_context);
+	upb = MIN(len[0], context_vec_ptr->b + diff_context);
+	lowc = MAX(1, cvp->c - diff_context);
+	upd = MIN(len[1], context_vec_ptr->d + diff_context);
 
 	diff_output("***************");
 	if ((flags & D_PROTOTYPE)) {
@@ -1549,10 +1546,10 @@ dump_unified_vec(FILE *f1, FILE *f2, int
 		return;
 
 	b = d = 0;		/* gcc */
-	lowa = MAXIMUM(1, cvp->a - diff_context);
-	upb = MINIMUM(len[0], context_vec_ptr->b + diff_context);
-	lowc = MAXIMUM(1, cvp->c - diff_context);
-	upd = MINIMUM(len[1], context_vec_ptr->d + diff_context);
+	lowa = MAX(1, cvp->a - diff_context);
+	upb = MIN(len[0], context_vec_ptr->b + diff_context);
+	lowc = MAX(1, cvp->c - diff_context);
+	upd = MIN(len[1], context_vec_ptr->d + diff_context);
 
 	diff_output("@@ -");
 	uni_range(lowa, upb);


More information about the svn-src-head mailing list