mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-02 20:58:15 +00:00
Fix some -vet warnings; change import to core:math/bits
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
package json
|
package json
|
||||||
|
|
||||||
import "core:mem"
|
import "core:mem"
|
||||||
import "core:bits"
|
import "core:math/bits"
|
||||||
import "core:runtime"
|
import "core:runtime"
|
||||||
import "core:strconv"
|
import "core:strconv"
|
||||||
import "core:strings"
|
import "core:strings"
|
||||||
|
|||||||
@@ -436,8 +436,8 @@ is_valid_string_literal :: proc(s: string, spec: Specification) -> bool {
|
|||||||
i += 5;
|
i += 5;
|
||||||
|
|
||||||
for j := 0; j < 4; j += 1 {
|
for j := 0; j < 4; j += 1 {
|
||||||
c := hex[j];
|
c2 := hex[j];
|
||||||
switch c {
|
switch c2 {
|
||||||
case '0'..'9', 'a'..'z', 'A'..'Z':
|
case '0'..'9', 'a'..'z', 'A'..'Z':
|
||||||
// Okay
|
// Okay
|
||||||
case:
|
case:
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package json
|
package json
|
||||||
|
|
||||||
import "core:strconv"
|
|
||||||
|
|
||||||
Specification :: enum {
|
Specification :: enum {
|
||||||
JSON,
|
JSON,
|
||||||
JSON5,
|
JSON5,
|
||||||
|
|||||||
@@ -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]>>4]);
|
||||||
write_byte(buf, &i, digits[s[0]&0xf]);
|
write_byte(buf, &i, digits[s[0]&0xf]);
|
||||||
}
|
}
|
||||||
s := quote_rune(buf[i:], r);
|
s2 := quote_rune(buf[i:], r);
|
||||||
i += len(s);
|
i += len(s2);
|
||||||
}
|
}
|
||||||
write_byte(buf, &i, c);
|
write_byte(buf, &i, c);
|
||||||
return string(buf[:i]);
|
return string(buf[:i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user