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

parser: deprecate size_t (#11443)

This commit is contained in:
Enzo
2021-09-08 12:09:32 +02:00
committed by GitHub
parent 892971024e
commit e3b65092d6
31 changed files with 160 additions and 152 deletions

View File

@@ -221,7 +221,7 @@ pub fn (mut f File) writeln(s string) ?int {
// write_string writes the string `s` into the file
// It returns how many bytes were actually written.
pub fn (mut f File) write_string(s string) ?int {
unsafe { f.write_full_buffer(s.str, size_t(s.len)) ? }
unsafe { f.write_full_buffer(s.str, usize(s.len)) ? }
return s.len
}
@@ -274,8 +274,8 @@ pub fn (mut f File) write_ptr(data voidptr, size int) int {
// write_full_buffer writes a whole buffer of data to the file, starting from the
// address in `buffer`, no matter how many tries/partial writes it would take.
[unsafe]
pub fn (mut f File) write_full_buffer(buffer voidptr, buffer_len size_t) ? {
if buffer_len <= size_t(0) {
pub fn (mut f File) write_full_buffer(buffer voidptr, buffer_len usize) ? {
if buffer_len <= usize(0) {
return
}
if !f.is_opened {