aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-02-01 17:52:55 +0000
committerGinger Bill <bill@gingerbill.org>2017-02-01 17:52:55 +0000
commit4e7082a68dd5261c3c36eccf92a62a0ce84995a8 (patch)
tree01b5d690870b28b43a5e5c0c434495e56059babc /core
parent502e63b9c50e71735c7989e59155a490bca991d2 (diff)
Change internals of `context`; Disable `immutable`
Diffstat (limited to 'core')
-rw-r--r--core/_preload.odin20
-rw-r--r--core/utf8.odin4
2 files changed, 22 insertions, 2 deletions
diff --git a/core/_preload.odin b/core/_preload.odin
index 24c682c8d..107e61dd2 100644
--- a/core/_preload.odin
+++ b/core/_preload.odin
@@ -321,6 +321,21 @@ __string_decode_rune :: proc(s: string) -> (rune, int) #inline {
}
+Raw_Any :: struct #ordered {
+ type_info: ^Type_Info,
+ data: rawptr,
+}
+
+Raw_String :: struct #ordered {
+ data: ^byte,
+ count: int,
+};
+
+Raw_Slice :: struct #ordered {
+ data: rawptr,
+ count: int,
+};
+
Raw_Dynamic_Array :: struct #ordered {
data: rawptr,
count: int,
@@ -360,6 +375,11 @@ __dynamic_array_append :: proc(array_: rawptr, elem_size, elem_align: int,
items: rawptr, item_count: int) -> int {
array := cast(^Raw_Dynamic_Array)array_;
+ if item_count <= 0 || items == nil {
+ return array.count;
+ }
+
+
ok := true;
if array.capacity <= array.count+item_count {
capacity := 2 * array.capacity + max(8, item_count);
diff --git a/core/utf8.odin b/core/utf8.odin
index 8720e1f20..d1798547d 100644
--- a/core/utf8.odin
+++ b/core/utf8.odin
@@ -30,7 +30,7 @@ HICB :: 0b1011_1111;
Accept_Range :: struct { lo, hi: u8 }
-immutable accept_ranges := [5]Accept_Range{
+accept_ranges := [5]Accept_Range{
{0x80, 0xbf},
{0xa0, 0xbf},
{0x80, 0x9f},
@@ -38,7 +38,7 @@ immutable accept_ranges := [5]Accept_Range{
{0x80, 0x8f},
};
-immutable accept_sizes := [256]byte{
+accept_sizes := [256]byte{
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x00-0x0f
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x10-0x1f
0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // 0x20-0x2f