summaryrefslogtreecommitdiffstats
path: root/arith.c
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
commit2a93dcfebf39ce77d3cfd3a180cacae8e8a5aacc (patch)
treef114562d885381e70ba83da3957ad82e85e09f21 /arith.c
parent2c9edd94dbb46a8ce69c3aaf04bedb9c09a5b0d2 (diff)
downloadtxr-2a93dcfebf39ce77d3cfd3a180cacae8e8a5aacc.tar.gz
txr-2a93dcfebf39ce77d3cfd3a180cacae8e8a5aacc.tar.bz2
txr-2a93dcfebf39ce77d3cfd3a180cacae8e8a5aacc.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.
Diffstat (limited to 'arith.c')
-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;