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

@ -11,7 +11,7 @@ pub:
element_size int // size in bytes of one element in the array.
pub mut:
data voidptr
offset int // in bytes (should be `size_t`)
offset int // in bytes (should be `usize`)
len int // length of the array.
cap int // capacity of the array.
}
@ -150,7 +150,7 @@ pub fn (mut a array) sort_with_compare(callback fn (voidptr, voidptr) int) {
$if freestanding {
panic('sort does not work with -freestanding')
} $else {
unsafe { vqsort(a.data, size_t(a.len), size_t(a.element_size), callback) }
unsafe { vqsort(a.data, usize(a.len), usize(a.element_size), callback) }
}
}