mirror of
https://github.com/vlang/v.git
synced 2025-09-14 06:52:36 +03:00
all: byte => u8
This commit is contained in:
parent
b49d873217
commit
d4a0d6f73c
221 changed files with 1365 additions and 1365 deletions
|
@ -6,8 +6,8 @@ __global global_allocator dlmalloc.Dlmalloc
|
|||
|
||||
[unsafe]
|
||||
pub fn memcpy(dest &C.void, src &C.void, n usize) &C.void {
|
||||
dest_ := unsafe { &byte(dest) }
|
||||
src_ := unsafe { &byte(src) }
|
||||
dest_ := unsafe { &u8(dest) }
|
||||
src_ := unsafe { &u8(src) }
|
||||
unsafe {
|
||||
for i in 0 .. int(n) {
|
||||
dest_[i] = src_[i]
|
||||
|
@ -24,7 +24,7 @@ fn __malloc(n usize) &C.void {
|
|||
|
||||
[unsafe]
|
||||
fn strlen(_s &C.void) usize {
|
||||
s := unsafe { &byte(_s) }
|
||||
s := unsafe { &u8(_s) }
|
||||
mut i := 0
|
||||
for ; unsafe { s[i] } != 0; i++ {}
|
||||
return usize(i)
|
||||
|
@ -63,8 +63,8 @@ fn memset(s &C.void, c int, n usize) &C.void {
|
|||
|
||||
[unsafe]
|
||||
fn memmove(dest &C.void, src &C.void, n usize) &C.void {
|
||||
dest_ := unsafe { &byte(dest) }
|
||||
src_ := unsafe { &byte(src) }
|
||||
dest_ := unsafe { &u8(dest) }
|
||||
src_ := unsafe { &u8(src) }
|
||||
mut temp_buf := unsafe { malloc(int(n)) }
|
||||
for i in 0 .. int(n) {
|
||||
unsafe {
|
||||
|
@ -90,14 +90,14 @@ fn __calloc(nmemb usize, size usize) &C.void {
|
|||
}
|
||||
|
||||
fn getchar() int {
|
||||
x := byte(0)
|
||||
x := u8(0)
|
||||
sys_read(0, &x, 1)
|
||||
return int(x)
|
||||
}
|
||||
|
||||
fn memcmp(a &C.void, b &C.void, n usize) int {
|
||||
a_ := unsafe { &byte(a) }
|
||||
b_ := unsafe { &byte(b) }
|
||||
a_ := unsafe { &u8(a) }
|
||||
b_ := unsafe { &u8(b) }
|
||||
for i in 0 .. int(n) {
|
||||
if unsafe { a_[i] != b_[i] } {
|
||||
unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue