uint32_t *ctf_sxlate; /* Translation table for unindexed symtypetab
entries. */
unsigned long ctf_nsyms; /* Number of entries in symtab xlate table. */
- uint32_t *ctf_txlate; /* Translation table for type IDs. */
+ ctf_type_t **ctf_txlate; /* Translation table for type IDs. */
uint32_t *ctf_ptrtab; /* Translation table for pointer-to lookups. */
size_t ctf_ptrtab_len; /* Num types storable in ptrtab currently. */
uint32_t *ctf_pptrtab; /* Parent types pointed to by child dicts. */
#define LCTF_INDEX_TO_TYPEPTR(fp, i) \
((i > fp->ctf_stypes) ? \
- &(ctf_dtd_lookup (fp, ctf_index_to_type (fp, i))->dtd_data) : \
- (ctf_type_t *)((uintptr_t)(fp)->ctf_buf + (fp)->ctf_txlate[(i)]))
+ ctf_dtd_lookup (fp, ctf_index_to_type (fp, i))->dtd_data : \
+ (fp)->ctf_txlate[(i)])
/* The non *INFO variants of these macros acquire the relevant info from the
suffixed type, if the type is prefixed. (Internally to libctf, all types
because later-added types will call grow_ptrtab() automatically, as
needed. */
- fp->ctf_txlate = calloc (typemax + 1, sizeof (uint32_t));
+ fp->ctf_txlate = calloc (typemax + 1, sizeof (ctf_type_t *));
fp->ctf_ptrtab = calloc (typemax + 1, sizeof (uint32_t));
fp->ctf_ptrtab_len = typemax + 1;
fp->ctf_stypes = typemax;
assert (!(fp->ctf_flags & LCTF_NO_STR));
- xp = fp->ctf_txlate;
- *xp++ = 0; /* Type id 0 is used as a sentinel value. */
+ xp = &fp->ctf_txlate[1];
/* In this second pass through the types, we fill in each entry of the type
and pointer tables and add names to the appropriate hashes.