summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-04-20 21:09:07 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-04-20 21:09:07 -0700
commitf325a231ae4c618c5e03351f712043e6c2350799 (patch)
treef114562d885381e70ba83da3957ad82e85e09f21
parent35ae145926959146adce3d19ec844c2584a05ee4 (diff)
downloadtxr-f325a231ae4c618c5e03351f712043e6c2350799.tar.gz
txr-f325a231ae4c618c5e03351f712043e6c2350799.tar.bz2
txr-f325a231ae4c618c5e03351f712043e6c2350799.zip
Use TAG_SHFIT instead of hard-coded 2.
* arith.c (comp_trunc, logtrunc, ash): The constant 2 appears here, which corresponds to TAG_SHIFT: the number of tag bits in an int_ptr_t word. It must be replaced by TAG_SHIFT.
-rw-r--r--arith.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arith.c b/arith.c
index 241dd56f..d22adb9b 100644
--- a/arith.c
+++ b/arith.c
@@ -2267,7 +2267,7 @@ static val comp_trunc(val a, val bits)
cnum an, bn;
val b;
const cnum num_mask = (NUM_MAX << 1) | 1;
- const int num_bits = CHAR_BIT * sizeof (cnum) - 2;
+ const int num_bits = CHAR_BIT * sizeof (cnum) - TAG_SHIFT;
if (!fixnump(bits))
goto bad2;
@@ -2330,7 +2330,7 @@ val logtrunc(val a, val bits)
cnum an, bn;
val b;
const cnum num_mask = (NUM_MAX << 1) | 1;
- const int num_bits = CHAR_BIT * sizeof (cnum) - 2;
+ const int num_bits = CHAR_BIT * sizeof (cnum) - TAG_SHIFT;
if (!fixnump(bits))
goto bad2;
@@ -2397,7 +2397,7 @@ val ash(val a, val bits)
cnum an, bn;
val b;
int hb;
- const int num_bits = CHAR_BIT * sizeof (cnum) - 2;
+ const int num_bits = CHAR_BIT * sizeof (cnum) - TAG_SHIFT;
if (!fixnump(bits))
goto bad2;