From 62466ab9194957d8cc3ee5566abf3984d0f0113e Mon Sep 17 00:00:00 2001 From: retropikzel Date: Sat, 22 Jun 2024 10:40:36 +0300 Subject: [PATCH] Fix guile pointer access on pointer access --- retropikzel/pffi/v0-2-2/guile.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/retropikzel/pffi/v0-2-2/guile.scm b/retropikzel/pffi/v0-2-2/guile.scm index b626c42..3efc2c9 100644 --- a/retropikzel/pffi/v0-2-2/guile.scm +++ b/retropikzel/pffi/v0-2-2/guile.scm @@ -114,7 +114,7 @@ ((equal? native-type unsigned-long) (bytevector-u64-set! p offset value (native-endianness))) ((equal? native-type float) (bytevector-u64-set! p offset value (native-endianness))) ((equal? native-type double) (bytevector-u64-set! p offset value (native-endianness))) - ((equal? native-type '*) (bytevector-sint-set! p offset value (native-endianness) (pffi-size-of type))))))) + ((equal? native-type '*) (bytevector-u32-set! p offset (pointer-address value) (native-endianness) (pffi-size-of type))))))) (define pffi-pointer-get (lambda (pointer type offset) @@ -136,7 +136,7 @@ ((equal? native-type unsigned-long) (bytevector-u64-ref p offset (native-endianness))) ((equal? native-type float) (bytevector-u64-ref p offset (native-endianness))) ((equal? native-type double) (bytevector-u64-ref p offset (native-endianness))) - ((equal? native-type '*) (bytevector-sint-ref p offset (native-endianness) (pffi-size-of type))))))) + ((equal? native-type '*) (make-pointer (bytevector-u32-ref p offset (native-endianness)))))))) (define pffi-pointer-deref (lambda (pointer)