Syntax change: cast(T)x => T(x); union_cast(T)x => x.(T); transmute(T)x => transmute(T, x); y:=^x => y:=&x;

Sorry for all the code breaking in this commit :(
This commit is contained in:
Ginger Bill
2017-04-30 15:09:36 +01:00
parent 54ea70df98
commit 784f3ecf7e
22 changed files with 650 additions and 730 deletions
+3 -3
View File
@@ -1,8 +1,8 @@
new_c_string :: proc(s: string) -> ^byte {
c := make([]byte, len(s)+1);
copy(c, cast([]byte)s);
copy(c, []byte(s));
c[len(s)] = 0;
return ^c[0];
return &c[0];
}
to_odin_string :: proc(c: ^byte) -> string {
@@ -10,5 +10,5 @@ to_odin_string :: proc(c: ^byte) -> string {
for (c+len)^ != 0 {
len++;
}
return cast(string)slice_ptr(c, len);
return string(slice_ptr(c, len));
}