aboutsummaryrefslogtreecommitdiff
path: root/src/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/types.c')
-rw-r--r--src/types.c5
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) {