Date: Wed, 22 Mar 2017 21:35:01 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315743 - head/usr.bin/diff Message-ID: <201703222135.v2MLZ1Gn026460@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703222135.v2MLZ1Gn026460>