From f0a4526250194d105447a521a73bcde3690b1c43 Mon Sep 17 00:00:00 2001 From: Joshua Mark Manton Date: Sun, 3 Jun 2018 11:22:42 -0700 Subject: [PATCH 1/3] Fix alloc.odin using old `raw` file --- core/mem/alloc.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/mem/alloc.odin b/core/mem/alloc.odin index 6c9664917..2685dd5b5 100644 --- a/core/mem/alloc.odin +++ b/core/mem/alloc.odin @@ -59,7 +59,7 @@ free_slice :: proc(array: $T/[]$E, loc := #caller_location) { free_ptr(raw_data(array), loc); } free_map :: proc(m: $T/map[$K]$V, loc := #caller_location) { - raw := transmute(raw.Map)m; + raw := transmute(Raw_Map)m; free_dynamic_array(raw.hashes, loc); free_ptr(raw.entries.data, loc); } From 2570296b01c3724f5a507d5b24f39e5e5540c7a9 Mon Sep 17 00:00:00 2001 From: Joshua Mark Manton Date: Sun, 3 Jun 2018 11:25:46 -0700 Subject: [PATCH 2/3] fix core opengl ODIN_OS reference and pointer math stuff --- core/opengl/opengl.odin | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/opengl/opengl.odin b/core/opengl/opengl.odin index 29845fba2..453ab98fc 100644 --- a/core/opengl/opengl.odin +++ b/core/opengl/opengl.odin @@ -1,15 +1,16 @@ package opengl -when ODIN_OS == "windows" { +import "core:os" +import "core:mem" + +when os.OS == "windows" { foreign import lib "system:opengl32.lib" import win32 "core:sys/win32" -} else when ODIN_OS == "linux" { +} else when os.OS == "linux" { foreign import lib "system:gl" } -export "core:opengl_constants.odin" - -#assert(ODIN_OS != "osx"); +#assert(os.OS != "osx"); @(default_calling_convention="c", link_prefix="gl") foreign lib { @@ -48,7 +49,7 @@ get_gl_proc_address :: proc(name: string) -> rawptr { name = name[..len(name)-1]; } // NOTE(bill): null terminated - assert((&name[0] + len(name))^ == 0); + assert(mem.ptr_offset(&name[0], cast(uintptr)len(name))^ == 0); res := win32.get_gl_proc_address(cstring(&name[0])); if res == nil { res = win32.get_proc_address(_libgl, cstring(&name[0])); From 7ed1d931cb10ba15268dad91cdd781e7bc0a8a25 Mon Sep 17 00:00:00 2001 From: Joshua Mark Manton Date: Sun, 3 Jun 2018 11:27:57 -0700 Subject: [PATCH 3/3] fix quick_sort_proc calling quick_sort instead of recursively calling itself --- core/sort/sort.odin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/sort/sort.odin b/core/sort/sort.odin index b69102b8e..4b69c8c81 100644 --- a/core/sort/sort.odin +++ b/core/sort/sort.odin @@ -69,8 +69,8 @@ quick_sort_proc :: proc(array: $A/[]$T, f: proc(T, T) -> int) { j -= 1; } - quick_sort(a[0..i], f); - quick_sort(a[i..n], f); + quick_sort_proc(a[0..i], f); + quick_sort_proc(a[i..n], f); } quick_sort :: proc(array: $A/[]$T) {