Fix typos and make demo work with -vet

This commit is contained in:
gingerBill
2019-10-08 20:28:45 +01:00
parent 71b32ae117
commit 1b8c3ca22a
5 changed files with 10 additions and 9 deletions
+2 -2
View File
@@ -69,8 +69,8 @@ eprintf :: proc(fmt: string, args: ..any) -> int { return fprintf(context.stder
@(deprecated="prefer eprint") print_err :: proc(args: ..any) -> int { return eprint(..args); }
@(deprecated="prefer eprintf") println_err :: proc(args: ..any) -> int { return eprintln(..args); }
@(deprecated="prefer eprintln") printf_err :: proc(fmt: string, args: ..any) -> int { return eprintf(fmt, ..args); }
@(deprecated="prefer eprintf") printf_err :: proc(fmt: string, args: ..any) -> int { return eprintf(fmt, ..args); }
@(deprecated="prefer eprintln") println_err :: proc(args: ..any) -> int { return eprintln(..args); }
// aprint* procedures return a string that was allocated with the current context
+3 -3
View File
@@ -169,9 +169,9 @@ _split :: proc(s_, sep: string, sep_save, n_: int, allocator := context.allocato
n = l;
}
res := make([dynamic]string, n);
res := make([dynamic]string, n, allocator);
for i := 0; i < n-1; i += 1 {
r, w := utf8.decode_rune_in_string(s);
_, w := utf8.decode_rune_in_string(s);
res[i] = s[:w];
s = s[w:];
}
@@ -185,7 +185,7 @@ _split :: proc(s_, sep: string, sep_save, n_: int, allocator := context.allocato
n = count(s, sep) + 1;
}
res := make([dynamic]string, n);
res := make([dynamic]string, n, allocator);
n -= 1;