aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/_preload.odin2
-rw-r--r--core/fmt.odin30
-rw-r--r--core/mem.odin4
-rw-r--r--core/os_windows.odin2
4 files changed, 19 insertions, 19 deletions
diff --git a/core/_preload.odin b/core/_preload.odin
index 0bcb45b52..24d1fc21f 100644
--- a/core/_preload.odin
+++ b/core/_preload.odin
@@ -164,7 +164,7 @@ alloc_align :: proc(size, alignment: int) -> rawptr #inline {
return a.procedure(a.data, Allocator_Mode.ALLOC, size, alignment, nil, 0, 0);
}
-free :: proc(ptr: rawptr) #inline {
+free_ptr :: proc(ptr: rawptr) #inline {
__check_context();
a := context.allocator;
if ptr != nil {
diff --git a/core/fmt.odin b/core/fmt.odin
index fe822b4c8..21b0c3fe7 100644
--- a/core/fmt.odin
+++ b/core/fmt.odin
@@ -58,38 +58,38 @@ Fmt_Info :: struct {
-fprint :: proc(fd: os.Handle, args: ..any) -> int {
+fprint :: proc(fd: os.Handle, args: ...any) -> int {
data: [DEFAULT_BUFFER_SIZE]byte;
buf := Buffer{data[:], 0};
- bprint(^buf, ..args);
+ bprint(^buf, ...args);
os.write(fd, buf.data[:buf.length]);
return buf.length;
}
-fprintln :: proc(fd: os.Handle, args: ..any) -> int {
+fprintln :: proc(fd: os.Handle, args: ...any) -> int {
data: [DEFAULT_BUFFER_SIZE]byte;
buf := Buffer{data[:], 0};
- bprintln(^buf, ..args);
+ bprintln(^buf, ...args);
os.write(fd, buf.data[:buf.length]);
return buf.length;
}
-fprintf :: proc(fd: os.Handle, fmt: string, args: ..any) -> int {
+fprintf :: proc(fd: os.Handle, fmt: string, args: ...any) -> int {
data: [DEFAULT_BUFFER_SIZE]byte;
buf := Buffer{data[:], 0};
- bprintf(^buf, fmt, ..args);
+ bprintf(^buf, fmt, ...args);
os.write(fd, buf.data[:buf.length]);
return buf.length;
}
-print :: proc(args: ..any) -> int {
- return fprint(os.stdout, ..args);
+print :: proc(args: ...any) -> int {
+ return fprint(os.stdout, ...args);
}
-println :: proc(args: ..any) -> int {
- return fprintln(os.stdout, ..args);
+println :: proc(args: ...any) -> int {
+ return fprintln(os.stdout, ...args);
}
-printf :: proc(fmt: string, args: ..any) -> int {
- return fprintf(os.stdout, fmt, ..args);
+printf :: proc(fmt: string, args: ...any) -> int {
+ return fprintf(os.stdout, fmt, ...args);
}
@@ -225,7 +225,7 @@ buffer_write_type :: proc(buf: ^Buffer, ti: ^Type_Info) {
}
-bprint :: proc(buf: ^Buffer, args: ..any) -> int {
+bprint :: proc(buf: ^Buffer, args: ...any) -> int {
fi: Fmt_Info;
fi.buf = buf;
@@ -241,7 +241,7 @@ bprint :: proc(buf: ^Buffer, args: ..any) -> int {
return buf.length;
}
-bprintln :: proc(buf: ^Buffer, args: ..any) -> int {
+bprintln :: proc(buf: ^Buffer, args: ...any) -> int {
fi: Fmt_Info;
fi.buf = buf;
@@ -888,7 +888,7 @@ fmt_arg :: proc(fi: ^Fmt_Info, arg: any, verb: rune) {
}
-bprintf :: proc(b: ^Buffer, fmt: string, args: ..any) -> int {
+bprintf :: proc(b: ^Buffer, fmt: string, args: ...any) -> int {
fi := Fmt_Info{};
end := fmt.count;
arg_index := 0;
diff --git a/core/mem.odin b/core/mem.odin
index 5f1bf378b..c27b709db 100644
--- a/core/mem.odin
+++ b/core/mem.odin
@@ -123,8 +123,8 @@ init_arena_from_context :: proc(using a: ^Arena, size: int) {
free_arena :: proc(using a: ^Arena) {
if backing.procedure != nil {
push_allocator backing {
- free(memory.data);
- memory = memory[0:0];
+ free(memory);
+ memory = nil;
offset = 0;
}
}
diff --git a/core/os_windows.odin b/core/os_windows.odin
index 4127d6242..5cc21d30a 100644
--- a/core/os_windows.odin
+++ b/core/os_windows.odin
@@ -235,7 +235,7 @@ read_entire_file :: proc(name: string) -> ([]byte, bool) {
win32.ReadFile(cast(win32.HANDLE)fd, ^data[total_read], to_read, ^single_read_length, nil);
if single_read_length <= 0 {
- free(data.data);
+ free(data);
return nil, false;
}