summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-09-12 23:31:23 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-09-12 23:31:23 -0700
commit7b399ee696036fe6d1acbbb64cd8a15d6a53078d (patch)
tree0e6953b8fbbae180c76b852fd8981effe7871d79 /lib.h
parent10680dee1019909374df8990afba41eff8371238 (diff)
downloadtxr-7b399ee696036fe6d1acbbb64cd8a15d6a53078d.tar.gz
txr-7b399ee696036fe6d1acbbb64cd8a15d6a53078d.tar.bz2
txr-7b399ee696036fe6d1acbbb64cd8a15d6a53078d.zip
Define bit width of NUM type in one place.
* lib.h (NUM_BIT): New preprocessor symbol. * arith.c (CNUM_BIT): Preprocessor symbol removed; this same quantity is already known as PTR_BIT in lib.h. (mul, square): Replace CNUM_BIT with PTR_BIT. (comp_trunc, logtrunc, sign_extend, ash): Replace num_bits with NUM_BIT. * struct.c (struct_inst): Replace calculation with NUM_BIT.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index 2cfb714a..f4e24ca6 100644
--- a/lib.h
+++ b/lib.h
@@ -62,6 +62,7 @@ typedef double_uintptr_t dbl_ucnum;
#define NUM_MIN (INT_PTR_MIN/4)
#define PTR_BIT (SIZEOF_PTR * CHAR_BIT)
+#define NUM_BIT (PTR_BIT - TAG_SHIFT)
#ifdef __GNUC__
#define NORETURN __attribute__((noreturn))