mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-04 22:58:46 +00:00
:: style procedure declarations; remove old parsing code
This commit is contained in:
+3
-3
@@ -1,18 +1,18 @@
|
||||
proc new_string(s: string) -> string {
|
||||
new_string :: proc(s: string) -> string {
|
||||
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 {
|
||||
new_c_string :: proc(s: string) -> ^u8 {
|
||||
c := make([]u8, len(s)+1);
|
||||
copy(c, []u8(s));
|
||||
c[len(s)] = 0;
|
||||
return &c[0];
|
||||
}
|
||||
|
||||
proc to_odin_string(c: ^u8) -> string {
|
||||
to_odin_string :: proc(c: ^u8) -> string {
|
||||
len := 0;
|
||||
for (c+len)^ != 0 {
|
||||
len++;
|
||||
|
||||
Reference in New Issue
Block a user