vet all core packages

This commit is contained in:
gingerBill
2021-01-09 23:43:34 +00:00
parent 9e8c46b8de
commit 3bcccf88d5
7 changed files with 5 additions and 10 deletions

View File

@@ -305,13 +305,13 @@ reader_write_to :: proc(b: ^Reader, w: io.Writer) -> (n: i64, err: io.Error) {
}
m: i64;
if nr, cerr := io.to_writer_to(b.rd); cerr == nil {
if nr, ok := io.to_writer_to(b.rd); ok {
m, err = io.write_to(nr, w);
n += m;
return n, err;
}
if nw, cerr := io.to_reader_from(w); cerr == nil {
if nw, ok := io.to_reader_from(w); ok {
m, err = io.read_from(nw, b.rd);
n += m;
return n, err;

View File

@@ -172,7 +172,7 @@ writer_read_from :: proc(b: ^Writer, r: io.Reader) -> (n: i64, err: io.Error) {
return 0, b.err;
}
if writer_buffered(b) == 0 {
if w, cerr := io.to_reader_from(b.wr); cerr != nil {
if w, ok := io.to_reader_from(b.wr); !ok {
n, err = io.read_from(w, r);
b.err = err;
return;

View File

@@ -97,7 +97,6 @@ decode :: proc(data: string, DEC_TBL := DEC_TABLE, allocator := context.allocato
}
outi := 0;
olen := len(data);
data := data;
out := make([]byte, len(data) / 8 * 5, allocator);

View File

@@ -677,9 +677,9 @@ match_values :: proc(left, right: ^Value) -> bool {
return false;
}
calculate_binary_value :: proc(p: ^Parser, op: Kind, a, b: Value) -> (Value, bool) {
calculate_binary_value :: proc(p: ^Parser, op: Kind, a_, b_: Value) -> (Value, bool) {
// TODO(bill): Calculate value as you go!
x, y := a, b;
x, y := a_, b_;
match_values(&x, &y);

View File

@@ -5,7 +5,6 @@ import "core:math/bits"
import "core:runtime"
import "core:strconv"
import "core:strings"
import "core:reflect"
Marshal_Error :: enum {
None,

View File

@@ -2,7 +2,6 @@ package log
import "core:runtime"
import "core:fmt"
import "core:sync"
// NOTE(bill, 2019-12-31): These are defined in `package runtime` as they are used in the `context`. This is to prevent an import definition cycle.

View File

@@ -6,8 +6,6 @@
package path
import "core:strings"
import "core:runtime"
import "core:unicode/utf8"
// is_separator checks whether the byte is a valid separator character
is_separator :: inline proc(c: byte) -> bool {