Skip to content

Commit

Permalink
fix &C.void
Browse files Browse the repository at this point in the history
  • Loading branch information
medvednikov committed Oct 14, 2023
1 parent 8034383 commit aee999e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion kernel/modules/lib/stubs/file.v
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn pclose(stream &FILE) int {
}

[export: 'write']
pub fn write(fd int, buf &C.void, count u64) i64 {
pub fn write(fd int, buf voidptr, count u64) i64 {
if fd != 1 && fd != 2 {
lib.kpanic(voidptr(0), c'write to fd != 1 && fd != 2 is a stub')
}
Expand Down
2 changes: 1 addition & 1 deletion kernel/modules/lib/stubs/misc.v
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ pub fn kexit(code int) {
}

[export: 'qsort']
pub fn qsort(ptr voidptr, count u64, size u64, comp fn (a &C.void, b &C.void) int) {
pub fn qsort(ptr voidptr, count u64, size u64, comp fn (a voidptr, b voidptr) int) {
lib.kpanic(voidptr(0), c'qsort is a stub')
}
4 changes: 2 additions & 2 deletions kernel/modules/lib/stubs/string.v
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub fn memset64(dest voidptr, c int, size u64) voidptr {
}

[export: 'memmove']
pub fn memmove(dest &C.void, src &C.void, size u64) &C.void {
pub fn memmove(dest voidptr, src voidptr, size u64) voidptr {
unsafe {
mut destm := &u8(dest)
srcm := &u8(src)
Expand All @@ -67,7 +67,7 @@ pub fn memmove(dest &C.void, src &C.void, size u64) &C.void {
}

[export: 'memcmp']
pub fn memcmp(_s1 &C.void, _s2 &C.void, size u64) int {
pub fn memcmp(_s1 voidptr, _s2 voidptr, size u64) int {
unsafe {
s1 := &u8(_s1)
s2 := &u8(_s2)
Expand Down

0 comments on commit aee999e

Please sign in to comment.