summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-07-27 22:17:03 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-07-27 22:17:03 -0700
commit15933c5dc8298e19de7e2916fac5368c96c765c3 (patch)
treed4c65c4bfacdfd8e2a5437eb24c6fb4775b8c41a
parentafdcf81a2c4556b4a6107afd9869616267c9bdeb (diff)
downloadtxr-15933c5dc8298e19de7e2916fac5368c96c765c3.tar.gz
txr-15933c5dc8298e19de7e2916fac5368c96c765c3.tar.bz2
txr-15933c5dc8298e19de7e2916fac5368c96c765c3.zip
struct: get rid of pointer typedef.
* lib.h (slot_cache_t): Typedef removed. (struct sym): Use slot_cache_set_t *. * struct.c (struct_type_finalize, lookup_slot, lookup_static_slot, lookup_static_slot_desc): Likewise.
-rw-r--r--lib.h4
-rw-r--r--struct.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/lib.h b/lib.h
index 7f227b53..e3b89087 100644
--- a/lib.h
+++ b/lib.h
@@ -130,14 +130,14 @@ typedef struct {
cnum id;
cnum slot;
} slot_cache_entry_t;
+
typedef slot_cache_entry_t slot_cache_set_t[4];
-typedef slot_cache_set_t *slot_cache_t;
struct sym {
obj_common;
val name;
val package;
- slot_cache_t slot_cache;
+ slot_cache_set_t *slot_cache;
};
struct package {
diff --git a/struct.c b/struct.c
index 1efc64f1..ef67a037 100644
--- a/struct.c
+++ b/struct.c
@@ -243,7 +243,7 @@ static val struct_type_finalize(val obj)
for (iter = st->slots; iter; iter = cdr(iter)) {
val slot = car(iter);
- slot_cache_t slot_cache = slot->s.slot_cache;
+ slot_cache_set_t *slot_cache = slot->s.slot_cache;
int i, j;
remhash(slot_hash, cons(slot, id));
@@ -1097,7 +1097,7 @@ static void cache_set_insert(slot_cache_entry_t *set, cnum id, cnum slot)
static loc lookup_slot(val inst, struct struct_inst *si, val sym)
{
- slot_cache_t slot_cache = sym->s.slot_cache;
+ slot_cache_set_t *slot_cache = sym->s.slot_cache;
cnum id = si->id;
if (slot_cache != 0) {
@@ -1130,7 +1130,7 @@ static loc lookup_slot(val inst, struct struct_inst *si, val sym)
}
}
} else {
- slot_cache = coerce(slot_cache_t,
+ slot_cache = coerce(slot_cache_set_t *,
chk_calloc(SLOT_CACHE_SIZE,
sizeof (slot_cache_set_t)));
slot_cache_set_t *set = &slot_cache[id % SLOT_CACHE_SIZE];
@@ -1159,7 +1159,7 @@ static loc lookup_slot(val inst, struct struct_inst *si, val sym)
static struct stslot *lookup_static_slot_desc(struct struct_type *st, val sym)
{
- slot_cache_t slot_cache = sym->s.slot_cache;
+ slot_cache_set_t *slot_cache = sym->s.slot_cache;
cnum id = st->id;
if (slot_cache != 0) {
@@ -1182,7 +1182,7 @@ static struct stslot *lookup_static_slot_desc(struct struct_type *st, val sym)
}
}
} else {
- slot_cache = coerce(slot_cache_t,
+ slot_cache = coerce(slot_cache_set_t *,
chk_calloc(SLOT_CACHE_SIZE,
sizeof (slot_cache_set_t)));
slot_cache_set_t *set = &slot_cache[id % SLOT_CACHE_SIZE];