From df890a1662b57c5b12c10cbc9de4e99937978250 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 1 Apr 2011 17:25:26 +0000 Subject: Move an isqrt() call outside a macro, from Michael W Bombardieri. ok ray --- usr.bin/diff/diffreg.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'usr.bin/diff/diffreg.c') diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 8beed5500ad..328ce07dddd 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diffreg.c,v 1.79 2010/07/16 21:47:02 ray Exp $ */ +/* $OpenBSD: diffreg.c,v 1.80 2011/04/01 17:25:26 nicm Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -642,12 +642,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; + int oldc, tc, oldl, sq; + u_int numtries, bound; - /* 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)); + if (flags & D_MINIMAL) + bound = UINT_MAX; + else { + sq = isqrt(n); + bound = MAX(256, sq); + } k = 0; c[0] = newcand(0, 0, 0); -- cgit v1.2.3-59-g8ed1b