From owner-svn-src-head@freebsd.org Wed Mar 22 21:35:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB648D118BF; Wed, 22 Mar 2017 21:35:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68E25166; Wed, 22 Mar 2017 21:35:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2MLZ1FP026461; Wed, 22 Mar 2017 21:35:01 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2MLZ1Gn026460; Wed, 22 Mar 2017 21:35:01 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201703222135.v2MLZ1Gn026460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 22 Mar 2017 21:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315743 - head/usr.bin/diff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Mar 2017 21:35:02 -0000 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);