diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2026-02-19 23:58:49 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2026-02-19 23:58:49 -0500 |
| commit | b780cff8e43bb9834ecd44f33ae8d33bb8528d82 (patch) | |
| tree | 69067a393b73a29e2e811f782872c48532e987af /src/types.c | |
| parent | fde2d5876236c9048ee1112be90c8af41c910149 (diff) | |
Code cleanup
Diffstat (limited to 'src/types.c')
| -rw-r--r-- | src/types.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/types.c b/src/types.c index 24453150..e37f5544 100644 --- a/src/types.c +++ b/src/types.c @@ -37,6 +37,7 @@ Text_t type_to_text(type_t *t) { case BoolType: return Text("Bool"); case ByteType: return Text("Byte"); case CStringType: return Text("CString"); + case PathType: return Text("Path"); case TextType: return Match(t, TextType)->lang ? Text$from_str(Match(t, TextType)->lang) : Text("Text"); case BigIntType: return Text("Int"); case IntType: return Texts("Int", (int32_t)Match(t, IntType)->bits); @@ -528,7 +529,6 @@ PUREFUNC size_t unpadded_struct_size(type_t *t) { } PUREFUNC size_t type_size(type_t *t) { - if (t == PATH_TYPE) return sizeof(Path_t); #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wswitch-default" @@ -542,6 +542,7 @@ PUREFUNC size_t type_size(type_t *t) { case BoolType: return sizeof(bool); case ByteType: return sizeof(uint8_t); case CStringType: return sizeof(char *); + case PathType: return sizeof(Path_t); case BigIntType: return sizeof(Int_t); case IntType: { switch (Match(t, IntType)->bits) { @@ -616,7 +617,6 @@ PUREFUNC size_t type_size(type_t *t) { } PUREFUNC size_t type_align(type_t *t) { - if (t == PATH_TYPE) return __alignof__(Path_t); #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wswitch-default" @@ -630,6 +630,7 @@ PUREFUNC size_t type_align(type_t *t) { case BoolType: return __alignof__(bool); case ByteType: return __alignof__(uint8_t); case CStringType: return __alignof__(char *); + case PathType: return __alignof__(Path_t); case BigIntType: return __alignof__(Int_t); case IntType: { switch (Match(t, IntType)->bits) { |
