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:
@@ -22,7 +22,7 @@ pub fn fd_write(fd int, s string) {
|
||||
return
|
||||
}
|
||||
remaining = remaining - written
|
||||
sp = unsafe { voidptr(sp + written)}
|
||||
sp = unsafe { voidptr(sp + written) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@ pub fn (f &File) read_from(pos u64, mut buf []u8) ?int {
|
||||
|
||||
// read_into_ptr reads at most max_size bytes from the file and writes it into ptr.
|
||||
// Returns the amount of bytes read or an error.
|
||||
pub fn (f &File) read_into_ptr(ptr &byte, max_size int) ?int {
|
||||
pub fn (f &File) read_into_ptr(ptr &u8, max_size int) ?int {
|
||||
return fread(ptr, 1, max_size, f.cfile)
|
||||
}
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ fn test_read_raw() ? {
|
||||
f.close()
|
||||
f = os.open_file(tfile, 'r') ?
|
||||
p := f.read_raw<Point>() ?
|
||||
b := f.read_raw<byte>() ?
|
||||
b := f.read_raw<u8>() ?
|
||||
c := f.read_raw<Color>() ?
|
||||
x := f.read_raw<Permissions>() ?
|
||||
f.close()
|
||||
@@ -309,8 +309,8 @@ fn test_read_raw_at() ? {
|
||||
mut at := u64(3)
|
||||
p := f.read_raw_at<Point>(at) ?
|
||||
at += sizeof(Point)
|
||||
b := f.read_raw_at<byte>(at) ?
|
||||
at += sizeof(byte)
|
||||
b := f.read_raw_at<u8>(at) ?
|
||||
at += sizeof(u8)
|
||||
c := f.read_raw_at<Color>(at) ?
|
||||
at += sizeof(Color)
|
||||
x := f.read_raw_at<Permissions>(at) ?
|
||||
@@ -345,7 +345,7 @@ fn test_seek() ? {
|
||||
//
|
||||
f.seek(i64(sizeof(Point)), .start) ?
|
||||
assert f.tell() ? == sizeof(Point)
|
||||
b := f.read_raw<byte>() ?
|
||||
b := f.read_raw<u8>() ?
|
||||
assert b == another_byte
|
||||
|
||||
f.seek(i64(sizeof(Color)), .current) ?
|
||||
|
||||
@@ -10,7 +10,7 @@ fn C.PeekNamedPipe(hNamedPipe voidptr, lpBuffer voidptr, nBufferSize int, lpByte
|
||||
|
||||
type FN_NTSuspendResume = fn (voidptr)
|
||||
|
||||
fn ntdll_fn(name &byte) FN_NTSuspendResume {
|
||||
fn ntdll_fn(name &u8) FN_NTSuspendResume {
|
||||
ntdll := C.GetModuleHandleA(c'NTDLL')
|
||||
if ntdll == 0 {
|
||||
return FN_NTSuspendResume(0)
|
||||
|
||||
Reference in New Issue
Block a user