From be68bf9f26122b764a43cf61369ca54c203d1df3 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 13 Sep 2021 11:29:46 +0100 Subject: Only store `field_index` remove `field_src_index` (for the time being) --- src/types.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/types.cpp') diff --git a/src/types.cpp b/src/types.cpp index 23834bfc1..8eb505287 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -2432,7 +2432,7 @@ Selection lookup_field_from_index(Type *type, i64 index) { for (isize i = 0; i < max_count; i++) { Entity *f = type->Struct.fields[i]; if (f->kind == Entity_Variable) { - if (f->Variable.field_src_index == index) { + if (f->Variable.field_index == index) { auto sel_array = array_make(a, 1); sel_array[0] = cast(i32)i; return make_selection(f, sel_array, false); -- cgit v1.2.3 From 526a42c6caac9bc39b9217e58c297d084c3d694a Mon Sep 17 00:00:00 2001 From: gingerBill Date: Mon, 13 Sep 2021 16:44:01 +0100 Subject: Remove custom alignment limit --- src/check_type.cpp | 8 +------- src/types.cpp | 4 ++-- 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src/types.cpp') diff --git a/src/check_type.cpp b/src/check_type.cpp index 8d129eb68..00a4c4ab2 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -215,13 +215,7 @@ bool check_custom_align(CheckerContext *ctx, Ast *node, i64 *align_) { error(node, "#align must be a power of 2, got %lld", align); return false; } - - // NOTE(bill): Success!!! - i64 custom_align = gb_clamp(align, 1, build_context.max_align); - if (custom_align < align) { - warning(node, "Custom alignment has been clamped to %lld from %lld", align, custom_align); - } - *align_ = custom_align; + *align_ = align; return true; } } diff --git a/src/types.cpp b/src/types.cpp index 8eb505287..7a5ea489b 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -2972,7 +2972,7 @@ i64 type_align_of_internal(Type *t, TypePath *path) { return 1; } if (t->Union.custom_align > 0) { - return gb_clamp(t->Union.custom_align, 1, build_context.max_align); + return gb_max(t->Union.custom_align, 1); } i64 max = 1; @@ -2993,7 +2993,7 @@ i64 type_align_of_internal(Type *t, TypePath *path) { case Type_Struct: { if (t->Struct.custom_align > 0) { - return gb_clamp(t->Struct.custom_align, 1, build_context.max_align); + return gb_max(t->Struct.custom_align, 1); } if (t->Struct.is_raw_union) { i64 max = 1; -- cgit v1.2.3