mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
Disable var and const declarations
This commit is contained in:
+3
-3
@@ -1,19 +1,19 @@
|
||||
proc new_string(s: string) -> string {
|
||||
var c = make([]u8, len(s)+1);
|
||||
c := make([]u8, len(s)+1);
|
||||
copy(c, []u8(s));
|
||||
c[len(s)] = 0;
|
||||
return string(c[0..<len(s)]);
|
||||
}
|
||||
|
||||
proc new_c_string(s: string) -> ^u8 {
|
||||
var c = make([]u8, len(s)+1);
|
||||
c := make([]u8, len(s)+1);
|
||||
copy(c, []u8(s));
|
||||
c[len(s)] = 0;
|
||||
return &c[0];
|
||||
}
|
||||
|
||||
proc to_odin_string(c: ^u8) -> string {
|
||||
var len = 0;
|
||||
len := 0;
|
||||
for (c+len)^ != 0 {
|
||||
len++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user