summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/diff_internals.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2011-04-01 17:25:26 +0000
committernicm <nicm@openbsd.org>2011-04-01 17:25:26 +0000
commitdf890a1662b57c5b12c10cbc9de4e99937978250 (patch)
tree59db7eef8a86337edb349187d9986ac40fac9b67 /usr.bin/cvs/diff_internals.c
parent"or" should be on a line on its own here so it is not emphasised as (diff)
downloadwireguard-openbsd-df890a1662b57c5b12c10cbc9de4e99937978250.tar.xz
wireguard-openbsd-df890a1662b57c5b12c10cbc9de4e99937978250.zip
Move an isqrt() call outside a macro, from Michael W Bombardieri.
ok ray
Diffstat (limited to 'usr.bin/cvs/diff_internals.c')
-rw-r--r--usr.bin/cvs/diff_internals.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/usr.bin/cvs/diff_internals.c b/usr.bin/cvs/diff_internals.c
index e7b0e8c455f..b451422dd07 100644
--- a/usr.bin/cvs/diff_internals.c
+++ b/usr.bin/cvs/diff_internals.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff_internals.c,v 1.33 2010/07/28 21:19:30 nicm Exp $ */
+/* $OpenBSD: diff_internals.c,v 1.34 2011/04/01 17:25:26 nicm Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
* All rights reserved.
@@ -538,12 +538,15 @@ static int
stone(int *a, int n, int *b, int *c, int flags)
{
int i, k, y, j, l;
- int oldc, tc, oldl;
- u_int numtries;
-
- /* XXX move the isqrt() out of the macro to avoid multiple calls */
- const u_int bound = (flags & D_MINIMAL) ? UINT_MAX :
- MAX(256, isqrt(n));
+ int oldc, tc, oldl, sq;
+ u_int numtries, bound;
+
+ if (flags & D_MINIMAL)
+ bound = UINT_MAX;
+ else {
+ sq = isqrt(n);
+ bound = MAX(256, sq);
+ }
k = 0;
c[0] = newcand(0, 0, 0);