aboutsummaryrefslogtreecommitdiff
path: root/core/runtime
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-03-05 12:56:36 +0000
committergingerBill <bill@gingerbill.org>2021-03-05 12:56:36 +0000
commit1988856eedc1a9714c42a22ea369d8154dcf7589 (patch)
tree4a7aa777e005e6ff35036e80adb310243913c234 /core/runtime
parent15dbc99cb975675b89f5efe714d5209bce972014 (diff)
Minimize the size of `runtime.Source_Code_Location` to use `i32` instead of `int`
Diffstat (limited to 'core/runtime')
-rw-r--r--core/runtime/core.odin2
-rw-r--r--core/runtime/error_checks.odin22
2 files changed, 12 insertions, 12 deletions
diff --git a/core/runtime/core.odin b/core/runtime/core.odin
index b89e77ebd..7e01146e5 100644
--- a/core/runtime/core.odin
+++ b/core/runtime/core.odin
@@ -246,7 +246,7 @@ args__: []cstring;
Source_Code_Location :: struct {
file_path: string,
- line, column: int,
+ line, column: i32,
procedure: string,
}
diff --git a/core/runtime/error_checks.odin b/core/runtime/error_checks.odin
index 8874cce00..b172ae9c8 100644
--- a/core/runtime/error_checks.odin
+++ b/core/runtime/error_checks.odin
@@ -17,11 +17,11 @@ type_assertion_trap :: proc "contextless" () -> ! {
}
-bounds_check_error :: proc "contextless" (file: string, line, column: int, index, count: int) {
+bounds_check_error :: proc "contextless" (file: string, line, column: i32, index, count: int) {
if 0 <= index && index < count {
return;
}
- handle_error :: proc "contextless" (file: string, line, column: int, index, count: int) {
+ handle_error :: proc "contextless" (file: string, line, column: i32, index, count: int) {
context = default_context();
print_caller_location(Source_Code_Location{file, line, column, ""});
print_string(" Index ");
@@ -34,7 +34,7 @@ bounds_check_error :: proc "contextless" (file: string, line, column: int, index
handle_error(file, line, column, index, count);
}
-slice_handle_error :: proc "contextless" (file: string, line, column: int, lo, hi: int, len: int) -> ! {
+slice_handle_error :: proc "contextless" (file: string, line, column: i32, lo, hi: int, len: int) -> ! {
context = default_context();
print_caller_location(Source_Code_Location{file, line, column, ""});
print_string(" Invalid slice indices: ");
@@ -47,25 +47,25 @@ slice_handle_error :: proc "contextless" (file: string, line, column: int, lo, h
bounds_trap();
}
-slice_expr_error_hi :: proc "contextless" (file: string, line, column: int, hi: int, len: int) {
+slice_expr_error_hi :: proc "contextless" (file: string, line, column: i32, hi: int, len: int) {
if 0 <= hi && hi <= len {
return;
}
slice_handle_error(file, line, column, 0, hi, len);
}
-slice_expr_error_lo_hi :: proc "contextless" (file: string, line, column: int, lo, hi: int, len: int) {
+slice_expr_error_lo_hi :: proc "contextless" (file: string, line, column: i32, lo, hi: int, len: int) {
if 0 <= lo && lo <= len && lo <= hi && hi <= len {
return;
}
slice_handle_error(file, line, column, lo, hi, len);
}
-dynamic_array_expr_error :: proc "contextless" (file: string, line, column: int, low, high, max: int) {
+dynamic_array_expr_error :: proc "contextless" (file: string, line, column: i32, low, high, max: int) {
if 0 <= low && low <= high && high <= max {
return;
}
- handle_error :: proc "contextless" (file: string, line, column: int, low, high, max: int) {
+ handle_error :: proc "contextless" (file: string, line, column: i32, low, high, max: int) {
context = default_context();
print_caller_location(Source_Code_Location{file, line, column, ""});
print_string(" Invalid dynamic array values: ");
@@ -81,11 +81,11 @@ dynamic_array_expr_error :: proc "contextless" (file: string, line, column: int,
}
-type_assertion_check :: proc "contextless" (ok: bool, file: string, line, column: int, from, to: typeid) {
+type_assertion_check :: proc "contextless" (ok: bool, file: string, line, column: i32, from, to: typeid) {
if ok {
return;
}
- handle_error :: proc "contextless" (file: string, line, column: int, from, to: typeid) {
+ handle_error :: proc "contextless" (file: string, line, column: i32, from, to: typeid) {
context = default_context();
print_caller_location(Source_Code_Location{file, line, column, ""});
print_string(" Invalid type assertion from ");
@@ -98,7 +98,7 @@ type_assertion_check :: proc "contextless" (ok: bool, file: string, line, column
handle_error(file, line, column, from, to);
}
-type_assertion_check2 :: proc "contextless" (ok: bool, file: string, line, column: int, from, to: typeid, from_data: rawptr) {
+type_assertion_check2 :: proc "contextless" (ok: bool, file: string, line, column: i32, from, to: typeid, from_data: rawptr) {
if ok {
return;
}
@@ -130,7 +130,7 @@ type_assertion_check2 :: proc "contextless" (ok: bool, file: string, line, colum
return id;
}
- handle_error :: proc "contextless" (file: string, line, column: int, from, to: typeid, from_data: rawptr) {
+ handle_error :: proc "contextless" (file: string, line, column: i32, from, to: typeid, from_data: rawptr) {
context = default_context();
actual := variant_type(from, from_data);