Browse Source

vet all core packages

gingerBill 4 years ago
parent
commit
3bcccf88d5

+ 2 - 2
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;

+ 1 - 1
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;

+ 0 - 1
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);

+ 2 - 2
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);
 
 

+ 0 - 1
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,

+ 0 - 1
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.

+ 0 - 2
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 {