mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: byte => u8
This commit is contained in:
@@ -14,9 +14,9 @@ fn do_send_int(ch chan int) {
|
||||
}
|
||||
}
|
||||
|
||||
fn do_send_byte(ch chan byte) {
|
||||
fn do_send_u8(ch chan byte) {
|
||||
for i in 0 .. 300 {
|
||||
ch <- byte(i)
|
||||
ch <- u8(i)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ fn test_select() {
|
||||
recch := chan i64{cap: 0}
|
||||
go do_rec_i64(recch)
|
||||
go do_send_int(chi)
|
||||
go do_send_byte(chb)
|
||||
go do_send_u8(chb)
|
||||
go do_send_i64(chl)
|
||||
mut sum := i64(0)
|
||||
mut rl := i64(0)
|
||||
|
||||
@@ -26,9 +26,9 @@ fn do_send_int(mut ch Channel) {
|
||||
}
|
||||
}
|
||||
|
||||
fn do_send_byte(mut ch Channel) {
|
||||
fn do_send_u8(mut ch Channel) {
|
||||
for i in 0 .. 300 {
|
||||
ii := byte(i)
|
||||
ii := u8(i)
|
||||
ch.push(&ii)
|
||||
}
|
||||
}
|
||||
@@ -47,14 +47,14 @@ fn test_select() {
|
||||
mut recch := new_channel<i64>(0)
|
||||
go do_rec_i64(mut recch)
|
||||
go do_send_int(mut chi)
|
||||
go do_send_byte(mut chb)
|
||||
go do_send_u8(mut chb)
|
||||
go do_send_i64(mut chl)
|
||||
mut channels := [chi, recch, chl, chb]
|
||||
directions := [Direction.pop, .push, .pop, .pop]
|
||||
mut sum := i64(0)
|
||||
mut rl := i64(0)
|
||||
mut ri := int(0)
|
||||
mut rb := byte(0)
|
||||
mut rb := u8(0)
|
||||
mut sl := i64(0)
|
||||
mut objs := [voidptr(&ri), &sl, &rl, &rb]
|
||||
for _ in 0 .. 1200 {
|
||||
|
||||
@@ -23,9 +23,9 @@ fn do_send_int(mut ch Channel) {
|
||||
ch.close()
|
||||
}
|
||||
|
||||
fn do_send_byte(mut ch Channel) {
|
||||
fn do_send_u8(mut ch Channel) {
|
||||
for i in 0 .. 300 {
|
||||
ii := byte(i)
|
||||
ii := u8(i)
|
||||
ch.push(&ii)
|
||||
}
|
||||
ch.close()
|
||||
@@ -46,14 +46,14 @@ fn test_select() {
|
||||
mut recch := new_channel<i64>(0)
|
||||
go do_rec_i64(mut recch)
|
||||
go do_send_int(mut chi)
|
||||
go do_send_byte(mut chb)
|
||||
go do_send_u8(mut chb)
|
||||
go do_send_i64(mut chl)
|
||||
mut channels := [chi, recch, chl, chb]
|
||||
directions := [Direction.pop, .push, .pop, .pop]
|
||||
mut sum := i64(0)
|
||||
mut rl := i64(0)
|
||||
mut ri := int(0)
|
||||
mut rb := byte(0)
|
||||
mut rb := u8(0)
|
||||
mut sl := i64(0)
|
||||
mut objs := [voidptr(&ri), &sl, &rl, &rb]
|
||||
for j in 0 .. 1101 {
|
||||
|
||||
@@ -228,5 +228,5 @@ pub fn (mut sem Semaphore) destroy() {
|
||||
return
|
||||
}
|
||||
}
|
||||
panic(unsafe { tos_clone(&byte(C.strerror(res))) })
|
||||
panic(unsafe { tos_clone(&u8(C.strerror(res))) })
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ pub fn (mut sem Semaphore) wait() {
|
||||
continue // interrupted by signal
|
||||
}
|
||||
else {
|
||||
panic(unsafe { tos_clone(&byte(C.strerror(C.errno))) })
|
||||
panic(unsafe { tos_clone(&u8(C.strerror(C.errno))) })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,7 +166,7 @@ pub fn (mut sem Semaphore) try_wait() bool {
|
||||
return false
|
||||
}
|
||||
else {
|
||||
panic(unsafe { tos_clone(&byte(C.strerror(C.errno))) })
|
||||
panic(unsafe { tos_clone(&u8(C.strerror(C.errno))) })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -195,7 +195,7 @@ pub fn (mut sem Semaphore) timed_wait(timeout time.Duration) bool {
|
||||
break
|
||||
}
|
||||
else {
|
||||
panic(unsafe { tos_clone(&byte(C.strerror(e))) })
|
||||
panic(unsafe { tos_clone(&u8(C.strerror(e))) })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -207,5 +207,5 @@ pub fn (sem Semaphore) destroy() {
|
||||
if res == 0 {
|
||||
return
|
||||
}
|
||||
panic(unsafe { tos_clone(&byte(C.strerror(res))) })
|
||||
panic(unsafe { tos_clone(&u8(C.strerror(res))) })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user