From patchwork Mon Oct 22 05:36:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= X-Patchwork-Id: 10651699 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 70C0C921 for ; Mon, 22 Oct 2018 05:36:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6355F286C5 for ; Mon, 22 Oct 2018 05:36:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57B042880A; Mon, 22 Oct 2018 05:36:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 483E1287B5 for ; Mon, 22 Oct 2018 05:36:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727322AbeJVNxX (ORCPT ); Mon, 22 Oct 2018 09:53:23 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:44241 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727225AbeJVNxX (ORCPT ); Mon, 22 Oct 2018 09:53:23 -0400 Received: by mail-pf1-f194.google.com with SMTP id r9-v6so19317413pff.11 for ; Sun, 21 Oct 2018 22:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wQSghAW43n2kSUyJXLAX/nCRZmdm8YvOrQOt802OqMA=; b=by/uqDDqU63OfNaLKFm7LKIS79R8IaQ70e8koY/M03QgTozxy/UZoM6qSClqVreinf T28mnRju3ubQZXj1e5rfZ/LDlMj7LwXIFfJq6jpEueOFip+YzOIsb0kAf/vGoS3eyAtY S5dt3LPL66u501YDWMBk+qRVETNqHAU+SMaO3p2LRWAayCgprEtb3srZPFIkDyhkGseH bK4l3DjwSKSorASWFBLS4xKCveYNWC0zaqThs1nkE4rz5r6ds4n8kWf/dAESnCkOt3UP zNfPDoNi1ysVUoNQ2Cce8snvnRDrpGu/JVUWGJbIIFp0HlXsj/78Ixk6RTu1carlrxSr TRJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wQSghAW43n2kSUyJXLAX/nCRZmdm8YvOrQOt802OqMA=; b=KI26H7YfGTNi0nDTfzVgD0fR7+bZwCQ6ynKB6gSir8CDswb2Qp2O78BjzNnL+NFlUR oVbQzWiRDfpKpGbdJMavIBLobKYpsKwHnSdFENWOjLDXta+ybAbcVlEz6i046SISpJyz KM9QUDB9UK5CEoj10gvCOc0u9mTTMLDeSRwf0/Ooz7cfgiztUV0G+PxvhfNCa4dID4+C WzRhAgUhXZlT6/bb+DMZF5kvROAH8bRIBndBEFmtEsHFSFG4fGGpnXPgAclTU8Fd6KlK aQinH7sCWxkKHUEcfk4+vcD20qXAzd+Jj/JaMHoiMNYcssw5XT7H66L6q5HrXIIPkBks f8nw== X-Gm-Message-State: ABuFfoiC6l2rq1T7P2U/9ZG9v0c99Zx3QidqecImRaxLvf3UiMpkmcQe XHkfxsN68Co7mPTRdSucHcmjchMZ X-Google-Smtp-Source: ACcGV61d/ynQOsq+x2NP7ZFXTFvOD24z3gDzbjGDGCPw2SfZxsc2lZSKnU6FDvfkuiGq0xKZW/KgWA== X-Received: by 2002:a65:56cc:: with SMTP id w12-v6mr18489251pgs.224.1540186583731; Sun, 21 Oct 2018 22:36:23 -0700 (PDT) Received: from localhost.localdomain (c-67-188-192-166.hsd1.ca.comcast.net. [67.188.192.166]) by smtp.gmail.com with ESMTPSA id n63-v6sm38004733pfn.9.2018.10.21.22.36.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 21 Oct 2018 22:36:23 -0700 (PDT) From: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= To: git@vger.kernel.org Cc: sandals@crustytoothpaste.net, =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= Subject: [PATCH 1/3] sha256: avoid redefinition for MIN Date: Sun, 21 Oct 2018 22:36:03 -0700 Message-Id: <20181022053605.81048-2-carenas@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181022053605.81048-1-carenas@gmail.com> References: <20181022053605.81048-1-carenas@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP it is already defined whenever "sys/param.h" is available Signed-off-by: Carlo Marcelo Arenas Belón --- sha256/block/sha256.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sha256/block/sha256.c b/sha256/block/sha256.c index 18350c161a..0d4939cc2c 100644 --- a/sha256/block/sha256.c +++ b/sha256/block/sha256.c @@ -130,7 +130,9 @@ static void blk_SHA256_Transform(blk_SHA256_CTX *ctx, const unsigned char *buf) } } +#ifndef MIN #define MIN(x, y) ((x) < (y) ? (x) : (y)) +#endif void blk_SHA256_Update(blk_SHA256_CTX *ctx, const void *data, size_t len) { const unsigned char *in = data; From patchwork Mon Oct 22 05:36:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= X-Patchwork-Id: 10651701 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 92483181E for ; Mon, 22 Oct 2018 05:36:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C46E286C5 for ; Mon, 22 Oct 2018 05:36:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70C32287E7; Mon, 22 Oct 2018 05:36:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 689E6287E7 for ; Mon, 22 Oct 2018 05:36:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727357AbeJVNxZ (ORCPT ); Mon, 22 Oct 2018 09:53:25 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:43175 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727225AbeJVNxZ (ORCPT ); Mon, 22 Oct 2018 09:53:25 -0400 Received: by mail-pf1-f193.google.com with SMTP id q1-v6so2005685pfh.10 for ; Sun, 21 Oct 2018 22:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XvUInMaowIvzgsxpJ92dp7O2DKX5+9tJRrcatATnCNs=; b=hupesOoGb4q/XdkcKFkWeWt4tVsRRtZX6aFgn5b1irymnuQzK8NnD0eXrsukKmPZnE 92z554po3tvr/azbFt0YCBQjl1SMn0v1wpsC45XgG9TFD/msHD8bFilTrfFYep2Xu9aW NZ8kX6YitWt/dtx+0U7DkoR8M4KlVpK4ky55pcjBKQej0Bytd2UqCORtWO3W0Zb+OwsE 2PTq4Nanw/Xd8d9Hv9qKVkcpPpMmbzgdxEyu4n4vIMsqvP7Mjh0Jhn1jxSI1klRJtR2E 5/dtjY7WToB0dybZjJ3KyCMjAkJkPpeSV9m8aEHCSQNi6hl711Lz/1X0/nauqDteCIBT KQEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XvUInMaowIvzgsxpJ92dp7O2DKX5+9tJRrcatATnCNs=; b=joLuzCgHMF6/MZJS8HxplA42KiUL+oNZa9610tZs2TRVNSFs8M7RMgLBvEqkCOkYwU Bqr45DejXpwzAiathXUp18paXmIxaiTWc0wRxINSpufRc9yNKtVhQGdo6HaVp/JxSDdv euSvKqszAPYzZmEaYz+US3ZCQSYv7niBBaW7uad/82CbveWjzSEo9uODc3jfhi+HljM1 TozAqGg8c0YWVTRShLKW13ZUy07WMIpeVVMjT37LzCh/zKzqHtqU3lXIcJ2beXpTX+4+ /EJ50ROf69RFKURBrNl5qSfDYs8o7NuCgfX+d83rqNLNMex4hUAEGlC/LpwQqk2kJX5+ jzcw== X-Gm-Message-State: ABuFfoiRvQnGIJJdMlAJKywFGSbkVYFptTUTGl4HzbSB/jkttaO/1llR NMTk73tU3BrJaWARZb3KwQDmaCZN X-Google-Smtp-Source: ACcGV63Xvg1dl2O6qKmaaRd1cbGcB/gFbf4O2gVsiE7621pOJOrYSZ0MKrtn5n0pq6nHZZKOzrkZyA== X-Received: by 2002:a63:d14a:: with SMTP id c10-v6mr41895508pgj.384.1540186585539; Sun, 21 Oct 2018 22:36:25 -0700 (PDT) Received: from localhost.localdomain (c-67-188-192-166.hsd1.ca.comcast.net. [67.188.192.166]) by smtp.gmail.com with ESMTPSA id n63-v6sm38004733pfn.9.2018.10.21.22.36.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 21 Oct 2018 22:36:25 -0700 (PDT) From: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= To: git@vger.kernel.org Cc: sandals@crustytoothpaste.net, =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= Subject: [PATCH 2/3] git-compat-util: define MIN through compat Date: Sun, 21 Oct 2018 22:36:04 -0700 Message-Id: <20181022053605.81048-3-carenas@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181022053605.81048-1-carenas@gmail.com> References: <20181022053605.81048-1-carenas@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP this macro is commonly defined in system headers (usually ) but if it is not define it here so it can be used elsewhere Signed-off-by: Carlo Marcelo Arenas Belón --- git-compat-util.h | 5 +++++ sha256/block/sha256.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/git-compat-util.h b/git-compat-util.h index 5f2e90932f..7a0b48452b 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -218,6 +218,11 @@ #else #include #endif + +#ifndef MIN +#define MIN(x, y) ((x) < (y) ? (x) : (y)) +#endif + #ifdef NO_INTPTR_T /* * On I16LP32, ILP32 and LP64 "long" is the safe bet, however diff --git a/sha256/block/sha256.c b/sha256/block/sha256.c index 0d4939cc2c..5fba943c79 100644 --- a/sha256/block/sha256.c +++ b/sha256/block/sha256.c @@ -130,9 +130,6 @@ static void blk_SHA256_Transform(blk_SHA256_CTX *ctx, const unsigned char *buf) } } -#ifndef MIN -#define MIN(x, y) ((x) < (y) ? (x) : (y)) -#endif void blk_SHA256_Update(blk_SHA256_CTX *ctx, const void *data, size_t len) { const unsigned char *in = data; From patchwork Mon Oct 22 05:36:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= X-Patchwork-Id: 10651703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B0CE51815 for ; Mon, 22 Oct 2018 05:36:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A25F1287B5 for ; Mon, 22 Oct 2018 05:36:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96B50286C5; Mon, 22 Oct 2018 05:36:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8920C287EF for ; Mon, 22 Oct 2018 05:36:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727384AbeJVNx2 (ORCPT ); Mon, 22 Oct 2018 09:53:28 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:41689 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727225AbeJVNx2 (ORCPT ); Mon, 22 Oct 2018 09:53:28 -0400 Received: by mail-pg1-f193.google.com with SMTP id 23-v6so18469408pgc.8 for ; Sun, 21 Oct 2018 22:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v3U7WBELZ/j8RQiTv3P7AFraPEM5u8LTRUHcwNegCNQ=; b=Dg55OM+CpV6+EZL2OvxsBh18JGnPtJaUm2V/qiaS4no0+xok8lIF6ts2jsP0+Nd8Kr 4SwkaUbkDdcsniz66/RUzVGDLlv/P4EBYffow5nTWp8i/lP20ozkpmbUp33sX/iQWkWW veklqMmktq0q4uXbFG2Bpgexv3MAvW0JR+ydkSqedu91JYDxl4b3I0vhgpXi4hEc0j2P XRLDIbnqFXkMjEDmyDJByQbIXUVd4Wg5LWndxa1WN0NIzgbjpLKD7S0TzYr5wk+4Qu/B XhX5C3b+/pIDHhXSVaYmMLian1DIfVdeahWyUjpR0FpKHdDpDua+drAdTFAwykIxHBSv 1Mbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=v3U7WBELZ/j8RQiTv3P7AFraPEM5u8LTRUHcwNegCNQ=; b=myzQNCf4hxIPoZFhimEjfz8YD4xl0L8GKJIGSm8oxnkPZmhdUhJkUuT5q7RH+rfoTe rPDtnFPqJoFpEwyPTn1hft3D9guVMjMZX654oZpa+Iw+beik6y/aiTueGhsMqS04r7Z9 nZx4TVpD5Gl5Nd5ji0pmHSWwOvSnOmL69wk2A1SupGPLmMdT4zV9t0o1M3TJ4H+h/Stv ug4EaKgBl2BzvHb+vRQC/xVIQQlapu9rxexVwNM5YExj17fkuhxds1hZJKvjZO/OcfvS vp+tDsbbG+EK0pbdh2oxMQA5Uuu7nQWtr8RXf0/zhkBGkYEMtqAzzRmlBbkWeY7V1uSG Hmrg== X-Gm-Message-State: ABuFfojg0KmpJexPcyZWAVFiIxS/RElExpbVThPABqwtyAjve6JxmMyF Z39qgwfy6wUUJRwBEMFfHUkXtm4/ X-Google-Smtp-Source: ACcGV62xQy6kBy1FlfNaLmM4llmfVsGZXP65V9uOo/IBRvaCYaOz1JSFs2JFCOCGgCn8Cxw1T5st6g== X-Received: by 2002:a63:f210:: with SMTP id v16-v6mr40769636pgh.371.1540186588540; Sun, 21 Oct 2018 22:36:28 -0700 (PDT) Received: from localhost.localdomain (c-67-188-192-166.hsd1.ca.comcast.net. [67.188.192.166]) by smtp.gmail.com with ESMTPSA id n63-v6sm38004733pfn.9.2018.10.21.22.36.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 21 Oct 2018 22:36:28 -0700 (PDT) From: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= To: git@vger.kernel.org Cc: sandals@crustytoothpaste.net, =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= Subject: [PATCH 3/3] xdiff: use compat's MIN instead Date: Sun, 21 Oct 2018 22:36:05 -0700 Message-Id: <20181022053605.81048-4-carenas@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181022053605.81048-1-carenas@gmail.com> References: <20181022053605.81048-1-carenas@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Carlo Marcelo Arenas Belón --- xdiff/xdiffi.c | 2 +- xdiff/xemit.c | 6 +++--- xdiff/xhistogram.c | 6 +++--- xdiff/xmacros.h | 4 +--- xdiff/xprepare.c | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c index 1f1f4a3c78..0754dc17ed 100644 --- a/xdiff/xdiffi.c +++ b/xdiff/xdiffi.c @@ -204,7 +204,7 @@ static long xdl_split(unsigned long const *ha1, long off1, long lim1, fbest = fbest1 = -1; for (d = fmax; d >= fmin; d -= 2) { - i1 = XDL_MIN(kvdf[d], lim1); + i1 = MIN(kvdf[d], lim1); i2 = i1 - d; if (lim2 < i2) i1 = lim2 + d, i2 = lim2; diff --git a/xdiff/xemit.c b/xdiff/xemit.c index 7778dc2b19..43d455b404 100644 --- a/xdiff/xemit.c +++ b/xdiff/xemit.c @@ -217,8 +217,8 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb, post_context_calculation: lctx = xecfg->ctxlen; - lctx = XDL_MIN(lctx, xe->xdf1.nrec - (xche->i1 + xche->chg1)); - lctx = XDL_MIN(lctx, xe->xdf2.nrec - (xche->i2 + xche->chg2)); + lctx = MIN(lctx, xe->xdf1.nrec - (xche->i1 + xche->chg1)); + lctx = MIN(lctx, xe->xdf2.nrec - (xche->i2 + xche->chg2)); e1 = xche->i1 + xche->chg1 + lctx; e2 = xche->i2 + xche->chg2 + lctx; @@ -242,7 +242,7 @@ int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb, * its new end. */ if (xche->next) { - long l = XDL_MIN(xche->next->i1, + long l = MIN(xche->next->i1, xe->xdf1.nrec - 1); if (l - xecfg->ctxlen <= e1 || get_func_line(xe, xecfg, NULL, l, e1) < 0) { diff --git a/xdiff/xhistogram.c b/xdiff/xhistogram.c index ec85f5992b..562cab6d14 100644 --- a/xdiff/xhistogram.c +++ b/xdiff/xhistogram.c @@ -129,7 +129,7 @@ static int scanA(struct histindex *index, int line1, int count1) NEXT_PTR(index, ptr) = rec->ptr; rec->ptr = ptr; /* cap rec->cnt at MAX_CNT */ - rec->cnt = XDL_MIN(MAX_CNT, rec->cnt + 1); + rec->cnt = MIN(MAX_CNT, rec->cnt + 1); LINE_MAP(index, ptr) = rec; goto continue_scan; } @@ -193,14 +193,14 @@ static int try_lcs(struct histindex *index, struct region *lcs, int b_ptr, as--; bs--; if (1 < rc) - rc = XDL_MIN(rc, CNT(index, as)); + rc = MIN(rc, CNT(index, as)); } while (ae < LINE_END(1) && be < LINE_END(2) && CMP(index, 1, ae + 1, 2, be + 1)) { ae++; be++; if (1 < rc) - rc = XDL_MIN(rc, CNT(index, ae)); + rc = MIN(rc, CNT(index, ae)); } if (b_next <= be) diff --git a/xdiff/xmacros.h b/xdiff/xmacros.h index 2809a28ca9..495b9dfac4 100644 --- a/xdiff/xmacros.h +++ b/xdiff/xmacros.h @@ -23,10 +23,8 @@ #if !defined(XMACROS_H) #define XMACROS_H +#include "../git-compat-util.h" - - -#define XDL_MIN(a, b) ((a) < (b) ? (a): (b)) #define XDL_MAX(a, b) ((a) > (b) ? (a): (b)) #define XDL_ABS(v) ((v) >= 0 ? (v): -(v)) #define XDL_ISDIGIT(c) ((c) >= '0' && (c) <= '9') diff --git a/xdiff/xprepare.c b/xdiff/xprepare.c index abeb8fb84e..7436064498 100644 --- a/xdiff/xprepare.c +++ b/xdiff/xprepare.c @@ -451,7 +451,7 @@ static int xdl_trim_ends(xdfile_t *xdf1, xdfile_t *xdf2) { recs1 = xdf1->recs; recs2 = xdf2->recs; - for (i = 0, lim = XDL_MIN(xdf1->nrec, xdf2->nrec); i < lim; + for (i = 0, lim = MIN(xdf1->nrec, xdf2->nrec); i < lim; i++, recs1++, recs2++) if ((*recs1)->ha != (*recs2)->ha) break;