From b780cff8e43bb9834ecd44f33ae8d33bb8528d82 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 19 Feb 2026 23:58:49 -0500 Subject: Code cleanup --- src/types.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/types.c') 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) { -- cgit v1.2.3