From a8834acf73c4c5bfa337fd3fb1ffc82151423a54 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 23 Jan 2021 18:26:34 -0800 Subject: [PATCH] [9front] cc: remove unnecessary 128-bit add function Instead, just change the comparisons from <=/>= to . --- sys/src/cmd/cc/com.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/sys/src/cmd/cc/com.c b/sys/src/cmd/cc/com.c index 6dfc7d421..1b661317f 100644 --- a/sys/src/cmd/cc/com.c +++ b/sys/src/cmd/cc/com.c @@ -1360,19 +1360,6 @@ cmp(Big x, Big y) } return 0; } -static Big -add(Big x, int y) -{ - uvlong ob; - - ob = x.b; - x.b += y; - if(y > 0 && x.b < ob) - x.a++; - if(y < 0 && x.b > ob) - x.a--; - return x; -} Big big(vlong a, uvlong b) @@ -1468,14 +1455,14 @@ compar(Node *n, int reverse) case OHS: if(cmp(x, lo) <= 0) goto useless; - if(cmp(x, add(hi, 1)) >= 0) + if(cmp(x, hi) > 0) goto useless; break; case OLE: case OLS: case OGT: case OHI: - if(cmp(x, add(lo, -1)) <= 0) + if(cmp(x, lo) < 0) goto useless; if(cmp(x, hi) >= 0) goto useless;