aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2021-07-11 17:20:57 +0100
committerGitHub <noreply@github.com>2021-07-11 17:20:57 +0100
commit3600b2e209dd1826f7aa75de904854b142244dc0 (patch)
tree65ffe5965bfc1d12c598aa6ffc7a6a527919737f /src/check_type.cpp
parentebcabb8a27ace67c3cd869a573df62b260000ee8 (diff)
parenteb36a0f3b138fd0058b75736f652e8fcf8422d8c (diff)
Merge pull request #1057 from odin-lang/new-big-int-library-integration
New Big Int Library Integration
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index cc4ffebca..4b4df4f3a 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -207,7 +207,7 @@ bool check_custom_align(CheckerContext *ctx, Ast *node, i64 *align_) {
if (is_type_untyped(type) || is_type_integer(type)) {
if (o.value.kind == ExactValue_Integer) {
BigInt v = o.value.value_integer;
- if (v.len > 1) {
+ if (v.used > 1) {
gbAllocator a = heap_allocator();
String str = big_int_to_string(a, &v);
error(node, "#align too large, %.*s", LIT(str));
@@ -1998,16 +1998,16 @@ i64 check_array_count(CheckerContext *ctx, Operand *o, Ast *e) {
if (is_type_untyped(type) || is_type_integer(type)) {
if (o->value.kind == ExactValue_Integer) {
BigInt count = o->value.value_integer;
- if (o->value.value_integer.neg) {
+ if (big_int_is_neg(&o->value.value_integer)) {
gbAllocator a = heap_allocator();
String str = big_int_to_string(a, &count);
error(e, "Invalid negative array count, %.*s", LIT(str));
gb_free(a, str.text);
return 0;
}
- switch (count.len) {
+ switch (count.used) {
case 0: return 0;
- case 1: return count.d.word;
+ case 1: return big_int_to_u64(&count);
}
gbAllocator a = heap_allocator();
String str = big_int_to_string(a, &count);