aboutsummaryrefslogtreecommitdiff
path: root/builtins/table.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-02-17 22:15:45 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-02-17 22:15:45 -0500
commit4a5c651d43f106b8e19b485646c64cb576a75cfb (patch)
tree6fe289145c475cfc027bd9d8c98c80e8cbccf8c7 /builtins/table.c
parent95641182021b5ba76697f57706c12ad70340193f (diff)
Overload type names with constructor and namespace struct
Diffstat (limited to 'builtins/table.c')
-rw-r--r--builtins/table.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/builtins/table.c b/builtins/table.c
index e79f893b..94af0499 100644
--- a/builtins/table.c
+++ b/builtins/table.c
@@ -41,7 +41,7 @@
#define GET_ENTRY(t, i) ((t)->entries.data + (t)->entries.stride*(i))
#define ENTRIES_TYPE(type) (&(TypeInfo){.size=sizeof(array_t), .align=__alignof__(array_t), .tag=ArrayInfo, .ArrayInfo.item=(&(TypeInfo){.size=entry_size(type), .align=entry_align(type), .tag=OpaqueInfo})})
-TypeInfo MemoryPointer_typeinfo = {
+TypeInfo MemoryPointer = {
.size=sizeof(void*),
.align=__alignof__(void*),
.tag=PointerInfo,
@@ -51,11 +51,11 @@ TypeInfo MemoryPointer_typeinfo = {
},
};
-TypeInfo StrToVoidStarTable_type = {
+TypeInfo StrToVoidStarTable = {
.size=sizeof(table_t),
.align=__alignof__(table_t),
.tag=TableInfo,
- .TableInfo={.key=&Str_type.type, .value=&MemoryPointer_typeinfo},
+ .TableInfo={.key=&Str.type, .value=&MemoryPointer},
};
static inline size_t entry_size(const TypeInfo *info)
@@ -547,29 +547,29 @@ public table_t Table_from_entries(array_t entries, const TypeInfo *type)
void *Table_str_get(const table_t *t, const char *key)
{
- void **ret = Table_get(t, &key, &StrToVoidStarTable_type);
+ void **ret = Table_get(t, &key, &StrToVoidStarTable);
return ret ? *ret : NULL;
}
void *Table_str_get_raw(const table_t *t, const char *key)
{
- void **ret = Table_get_raw(t, &key, &StrToVoidStarTable_type);
+ void **ret = Table_get_raw(t, &key, &StrToVoidStarTable);
return ret ? *ret : NULL;
}
void *Table_str_reserve(table_t *t, const char *key, const void *value)
{
- return Table_reserve(t, &key, &value, &StrToVoidStarTable_type);
+ return Table_reserve(t, &key, &value, &StrToVoidStarTable);
}
void Table_str_set(table_t *t, const char *key, const void *value)
{
- Table_set(t, &key, &value, &StrToVoidStarTable_type);
+ Table_set(t, &key, &value, &StrToVoidStarTable);
}
void Table_str_remove(table_t *t, const char *key)
{
- return Table_remove(t, &key, &StrToVoidStarTable_type);
+ return Table_remove(t, &key, &StrToVoidStarTable);
}
void *Table_str_entry(const table_t *t, int64_t n)