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:
@ -66,7 +66,7 @@ pub enum OpenMode {
|
||||
}
|
||||
|
||||
[inline]
|
||||
fn (om OpenMode) to_byte() byte {
|
||||
fn (om OpenMode) to_u8() byte {
|
||||
return match om {
|
||||
.write {
|
||||
`w`
|
||||
@ -88,7 +88,7 @@ pub fn open(name string, level CompressionLevel, mode OpenMode) ?&Zip {
|
||||
if name.len == 0 {
|
||||
return error('szip: name of file empty')
|
||||
}
|
||||
p_zip := unsafe { &Zip(C.zip_open(&char(name.str), int(level), char(mode.to_byte()))) }
|
||||
p_zip := unsafe { &Zip(C.zip_open(&char(name.str), int(level), char(mode.to_u8()))) }
|
||||
if isnil(p_zip) {
|
||||
return error('szip: cannot open/create/append new zip archive')
|
||||
}
|
||||
@ -134,7 +134,7 @@ pub fn (mut zentry Zip) close_entry() {
|
||||
// All slashes MUST be forward slashes '/' as opposed to backwards slashes '\'
|
||||
// for compatibility with Amiga and UNIX file systems etc.
|
||||
pub fn (mut zentry Zip) name() string {
|
||||
name := unsafe { &byte(C.zip_entry_name(zentry)) }
|
||||
name := unsafe { &u8(C.zip_entry_name(zentry)) }
|
||||
if name == 0 {
|
||||
return ''
|
||||
}
|
||||
@ -195,7 +195,7 @@ pub fn (mut zentry Zip) create_entry(name string) ? {
|
||||
// NOTE: remember to release the memory allocated for an output buffer.
|
||||
// for large entries, please take a look at zip_entry_extract function.
|
||||
pub fn (mut zentry Zip) read_entry() ?voidptr {
|
||||
mut buf := &byte(0)
|
||||
mut buf := &u8(0)
|
||||
mut bsize := usize(0)
|
||||
res := C.zip_entry_read(zentry, unsafe { &voidptr(&buf) }, &bsize)
|
||||
if res == -1 {
|
||||
|
Reference in New Issue
Block a user