Skip to content

Commit 31af0e5

Browse files
authored
call the C function wrappers instead of the C functions directly in .v files (#26737)
1 parent cd0451a commit 31af0e5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎vlib/builtin/array.v‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ pub fn (mut a array) sort_with_compare(callback fn (voidptr, voidptr) int) {
980980
// See also .sort_with_compare()
981981
pub fn (a &array) sorted_with_compare(callback fn (voidptr, voidptr) int) array {
982982
mut r := a.clone()
983-
unsafe { C.qsort(r.data, usize(r.len), usize(r.element_size), voidptr(callback)) }
983+
unsafe { vqsort(r.data, usize(r.len), usize(r.element_size), callback) }
984984
return r
985985
}
986986

‎vlib/builtin/map.v‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ fn map_map_eq(a map, b map) bool {
228228
}
229229
va := a.key_values.value(i)
230230
vb := b.get(k, va)
231-
if unsafe { C.memcmp(va, vb, a.value_bytes) } != 0 {
231+
if unsafe { vmemcmp(va, vb, a.value_bytes) } != 0 {
232232
return false
233233
}
234234
}
@@ -242,7 +242,7 @@ fn map_clone_string(dest voidptr, pkey voidptr) {
242242
cloned := s.clone()
243243
// Use memcpy for native backend compatibility
244244
// (*&string(dest)) = cloned doesn't reliably store full struct
245-
C.memcpy(dest, voidptr(&cloned), sizeof(string))
245+
vmemcpy(dest, voidptr(&cloned), sizeof(string))
246246
}
247247
}
248248

0 commit comments

Comments
 (0)