1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

all: ~500 more byte=>u8

This commit is contained in:
Alexander Medvednikov
2022-04-15 18:25:45 +03:00
parent ae6a25f44e
commit fbb9e65c0f
148 changed files with 544 additions and 494 deletions

View File

@ -11,7 +11,7 @@ pub fn validate_str(str string) bool {
return validate(str.str, str.len)
}
pub fn validate(data &byte, len int) bool {
pub fn validate(data &u8, len int) bool {
mut state := Utf8State{}
for i := 0; i < len; i++ {
s := unsafe { data[i] }
@ -46,7 +46,7 @@ fn (mut s Utf8State) seq(r0 bool, r1 bool, is_tail bool) bool {
return false
}
fn (mut s Utf8State) next_state(c byte) {
fn (mut s Utf8State) next_state(c u8) {
// sequence 1
if s.index == 0 {
if (c >= 0x00 + 1 && c <= 0x7F) || c == 0x00 {