mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
vet all core packages
This commit is contained in:
@@ -305,13 +305,13 @@ reader_write_to :: proc(b: ^Reader, w: io.Writer) -> (n: i64, err: io.Error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
m: i64;
|
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);
|
m, err = io.write_to(nr, w);
|
||||||
n += m;
|
n += m;
|
||||||
return n, err;
|
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);
|
m, err = io.read_from(nw, b.rd);
|
||||||
n += m;
|
n += m;
|
||||||
return n, err;
|
return n, err;
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ writer_read_from :: proc(b: ^Writer, r: io.Reader) -> (n: i64, err: io.Error) {
|
|||||||
return 0, b.err;
|
return 0, b.err;
|
||||||
}
|
}
|
||||||
if writer_buffered(b) == 0 {
|
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);
|
n, err = io.read_from(w, r);
|
||||||
b.err = err;
|
b.err = err;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ decode :: proc(data: string, DEC_TBL := DEC_TABLE, allocator := context.allocato
|
|||||||
}
|
}
|
||||||
|
|
||||||
outi := 0;
|
outi := 0;
|
||||||
olen := len(data);
|
|
||||||
data := data;
|
data := data;
|
||||||
|
|
||||||
out := make([]byte, len(data) / 8 * 5, allocator);
|
out := make([]byte, len(data) / 8 * 5, allocator);
|
||||||
|
|||||||
@@ -677,9 +677,9 @@ match_values :: proc(left, right: ^Value) -> bool {
|
|||||||
return false;
|
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!
|
// TODO(bill): Calculate value as you go!
|
||||||
x, y := a, b;
|
x, y := a_, b_;
|
||||||
match_values(&x, &y);
|
match_values(&x, &y);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import "core:math/bits"
|
|||||||
import "core:runtime"
|
import "core:runtime"
|
||||||
import "core:strconv"
|
import "core:strconv"
|
||||||
import "core:strings"
|
import "core:strings"
|
||||||
import "core:reflect"
|
|
||||||
|
|
||||||
Marshal_Error :: enum {
|
Marshal_Error :: enum {
|
||||||
None,
|
None,
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package log
|
|||||||
|
|
||||||
import "core:runtime"
|
import "core:runtime"
|
||||||
import "core:fmt"
|
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.
|
// 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.
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
package path
|
package path
|
||||||
|
|
||||||
import "core:strings"
|
import "core:strings"
|
||||||
import "core:runtime"
|
|
||||||
import "core:unicode/utf8"
|
|
||||||
|
|
||||||
// is_separator checks whether the byte is a valid separator character
|
// is_separator checks whether the byte is a valid separator character
|
||||||
is_separator :: inline proc(c: byte) -> bool {
|
is_separator :: inline proc(c: byte) -> bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user