summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-01-23 18:26:34 -0800
committerMichael Forney <mforney@mforney.org>2021-01-23 18:26:34 -0800
commita8834acf73c4c5bfa337fd3fb1ffc82151423a54 (patch)
tree2eb2a1d0a2642e1bc5b0044b02519a6071a52db4
parented2b1d5c610f0ff2d49780f69b6343d22f878a63 (diff)
downloadplan9front-a8834acf73c4c5bfa337fd3fb1ffc82151423a54.tar.xz
[9front] cc: remove unnecessary 128-bit add function
Instead, just change the comparisons from <=/>= to </>.
-rw-r--r--sys/src/cmd/cc/com.c17
1 files 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;