From 3bcccf88d578360bcc97e5903b316b2cfac39b03 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 9 Jan 2021 23:43:34 +0000 Subject: [PATCH] vet all core packages --- core/bufio/reader.odin | 4 ++-- core/bufio/writer.odin | 2 +- core/encoding/base32/base32.odin | 1 - core/encoding/cel/cel.odin | 4 ++-- core/encoding/json/marshal.odin | 1 - core/log/log.odin | 1 - core/path/path.odin | 2 -- 7 files changed, 5 insertions(+), 10 deletions(-) diff --git a/core/bufio/reader.odin b/core/bufio/reader.odin index f35706f9b..b26a2769d 100644 --- a/core/bufio/reader.odin +++ b/core/bufio/reader.odin @@ -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; diff --git a/core/bufio/writer.odin b/core/bufio/writer.odin index 97f24a224..28870dcea 100644 --- a/core/bufio/writer.odin +++ b/core/bufio/writer.odin @@ -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; diff --git a/core/encoding/base32/base32.odin b/core/encoding/base32/base32.odin index dad9d3e04..82dfb9422 100644 --- a/core/encoding/base32/base32.odin +++ b/core/encoding/base32/base32.odin @@ -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); diff --git a/core/encoding/cel/cel.odin b/core/encoding/cel/cel.odin index 897b4adfd..f0cd49866 100644 --- a/core/encoding/cel/cel.odin +++ b/core/encoding/cel/cel.odin @@ -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); diff --git a/core/encoding/json/marshal.odin b/core/encoding/json/marshal.odin index 7bdc3abc3..9d5f04355 100644 --- a/core/encoding/json/marshal.odin +++ b/core/encoding/json/marshal.odin @@ -5,7 +5,6 @@ import "core:math/bits" import "core:runtime" import "core:strconv" import "core:strings" -import "core:reflect" Marshal_Error :: enum { None, diff --git a/core/log/log.odin b/core/log/log.odin index c090eed5a..93cca2a88 100644 --- a/core/log/log.odin +++ b/core/log/log.odin @@ -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. diff --git a/core/path/path.odin b/core/path/path.odin index abdd213f9..7bda85cf8 100644 --- a/core/path/path.odin +++ b/core/path/path.odin @@ -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 {