Save before Demo 001

This commit is contained in:
Ginger Bill
2016-08-25 19:52:51 +01:00
parent f93cf3827b
commit 3a189b9c1c
7 changed files with 140 additions and 142 deletions
+7 -1
View File
@@ -143,7 +143,10 @@ struct Type {
};
Type *get_base_type(Type *t) {
while (t->kind == Type_Named) {
for (;;) {
if (t == NULL || t->kind != Type_Named) {
break;
}
t = t->Named.base;
}
return t;
@@ -583,6 +586,8 @@ gb_global i64 basic_type_sizes[] = {
8, // Basic_f64
};
i64 type_size_of(BaseTypeSizes s, gbAllocator allocator, Type *t);
i64 type_align_of(BaseTypeSizes s, gbAllocator allocator, Type *t);
i64 type_offset_of(BaseTypeSizes s, gbAllocator allocator, Type *t, i64 index);
@@ -668,6 +673,7 @@ b32 type_set_offsets(BaseTypeSizes s, gbAllocator allocator, Type *t) {
i64 type_size_of(BaseTypeSizes s, gbAllocator allocator, Type *t) {
t = get_base_type(t);
switch (t->kind) {
case Type_Basic: {
GB_ASSERT(is_type_typed(t));