Fix some -vet warnings; change import to core:math/bits

This commit is contained in:
Kevin Watters
2019-03-25 09:23:46 -04:00
parent b978959fae
commit e6f9b4fb11
4 changed files with 5 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
package json
import "core:mem"
import "core:bits"
import "core:math/bits"
import "core:runtime"
import "core:strconv"
import "core:strings"

View File

@@ -436,8 +436,8 @@ is_valid_string_literal :: proc(s: string, spec: Specification) -> bool {
i += 5;
for j := 0; j < 4; j += 1 {
c := hex[j];
switch c {
c2 := hex[j];
switch c2 {
case '0'..'9', 'a'..'z', 'A'..'Z':
// Okay
case:

View File

@@ -1,7 +1,5 @@
package json
import "core:strconv"
Specification :: enum {
JSON,
JSON5,

View File

@@ -230,8 +230,8 @@ quote :: proc(buf: []byte, s: string) -> string {
write_byte(buf, &i, digits[s[0]>>4]);
write_byte(buf, &i, digits[s[0]&0xf]);
}
s := quote_rune(buf[i:], r);
i += len(s);
s2 := quote_rune(buf[i:], r);
i += len(s2);
}
write_byte(buf, &i, c);
return string(buf[:i]);