summaryrefslogtreecommitdiffstats
path: root/struct.c
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 /struct.c
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 'struct.c')
-rw-r--r--struct.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/struct.c b/struct.c
index 8adf6323..e601cbcd 100644
--- a/struct.c
+++ b/struct.c
@@ -97,7 +97,7 @@ struct struct_type {
struct struct_inst {
struct struct_type *type;
- cnum id : sizeof (cnum) * CHAR_BIT - TAG_SHIFT;
+ cnum id : NUM_BIT;
unsigned lazy : 1;
unsigned dirty : 1;
val slot[FLEX_ARRAY];