aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-04-30 16:28:13 +0100
committerGinger Bill <bill@gingerbill.org>2017-04-30 16:28:13 +0100
commit7057034b75f18cb2369e922053f74cda87738776 (patch)
tree9c30ac5ffdee92dbbf9f85beb9aed6e6151bbcd1 /core
parent1430ca30a3a0677fb395d2c5c190e86f02ed2b06 (diff)
v0.2.0v0.2.0
Diffstat (limited to 'core')
-rw-r--r--core/os_linux.odin8
-rw-r--r--core/os_x.odin12
2 files changed, 10 insertions, 10 deletions
diff --git a/core/os_linux.odin b/core/os_linux.odin
index 1de14b0f9..0ac376d69 100644
--- a/core/os_linux.odin
+++ b/core/os_linux.odin
@@ -165,12 +165,12 @@ close :: proc(fd: Handle) {
}
read :: proc(fd: Handle, data: []byte) -> (int, Errno) {
- sz := _unix_read(fd, ^data[0], len(data));
+ sz := _unix_read(fd, &data[0], len(data));
return sz, 0;
}
write :: proc(fd: Handle, data: []byte) -> (int, Errno) {
- sz := _unix_write(fd, ^data[0], len(data));
+ sz := _unix_write(fd, &data[0], len(data));
return sz, 0;
}
@@ -194,7 +194,7 @@ stat :: proc(path: string) -> (Stat, int) #inline {
s: Stat;
cstr := strings.new_c_string(path);
defer free(cstr);
- ret_int := _unix_stat(cstr, ^s);
+ ret_int := _unix_stat(cstr, &s);
return s, int(ret_int);
}
@@ -271,7 +271,7 @@ exit :: proc(code: int) {
}
current_thread_id :: proc() -> int {
- // return cast(int) _unix_gettid();
+ // return int(_unix_gettid());
return 0;
}
diff --git a/core/os_x.odin b/core/os_x.odin
index fc2bcd3d3..9fb138ae5 100644
--- a/core/os_x.odin
+++ b/core/os_x.odin
@@ -67,7 +67,7 @@ Stat :: struct #ordered {
gen_num : u32, // File generation number ...?
_spare : i32, // RESERVED
_reserve1,
- _reserve2 : i64, // RESERVED
+ _reserve2 : i64, // RESERVED
};
// File type
@@ -147,7 +147,7 @@ unix_dlerror :: proc() -> ^u8
// TODO(zangent): Change this to just `open` when Bill fixes overloading.
open_simple :: proc(path: string, mode: int) -> (Handle, Errno) {
-
+
cstr := strings.new_c_string(path);
handle := unix_open(cstr, mode);
free(cstr);
@@ -169,7 +169,7 @@ close :: proc(fd: Handle) {
write :: proc(fd: Handle, data: []byte) -> (AddressSize, Errno) {
assert(fd != -1);
- bytes_written := unix_write(fd, ^data[0], len(data));
+ bytes_written := unix_write(fd, &data[0], len(data));
if(bytes_written == -1) {
return 0, 1;
}
@@ -179,7 +179,7 @@ write :: proc(fd: Handle, data: []byte) -> (AddressSize, Errno) {
read :: proc(fd: Handle, data: []byte) -> (AddressSize, Errno) {
assert(fd != -1);
- bytes_read := unix_read(fd, ^data[0], len(data));
+ bytes_read := unix_read(fd, &data[0], len(data));
if(bytes_read == -1) {
return 0, 1;
}
@@ -211,7 +211,7 @@ stat :: proc(path: string) -> (Stat, bool) #inline {
s: Stat;
cstr := strings.new_c_string(path);
defer free(cstr);
- ret_int := unix_stat(cstr, ^s);
+ ret_int := unix_stat(cstr, &s);
return s, ret_int==0;
}
@@ -309,4 +309,4 @@ dlclose :: proc(handle: rawptr) -> bool #inline {
}
dlerror :: proc() -> string {
return strings.to_odin_string(unix_dlerror());
-} \ No newline at end of file
+}