Guile pointer set and get fixes

This commit is contained in:
retropikzel 2024-07-22 20:53:37 +03:00
parent 409df95d5c
commit bc385580d6
1 changed files with 4 additions and 4 deletions

View File

@ -108,16 +108,16 @@
(lambda (pointer type offset value)
(let ((p (pointer->bytevector pointer (+ offset 100)))
(native-type (pffi-type->native-type type)))
(cond ((equal? native-type int8) (bytevector-s8-set! p offset value (native-endianness)))
((equal? native-type uint8) (bytevector-u8-set! p offset value (native-endianness)))
(cond ((equal? native-type int8) (bytevector-s8-set! p offset value))
((equal? native-type uint8) (bytevector-u8-set! p offset value))
((equal? native-type int16) (bytevector-s16-set! p offset value (native-endianness)))
((equal? native-type uint16) (bytevector-u16-set! p offset value (native-endianness)))
((equal? native-type int32) (bytevector-s32-set! p offset value (native-endianness)))
((equal? native-type uint32) (bytevector-u32-set! p offset value (native-endianness)))
((equal? native-type int64) (bytevector-s64-set! p offset value (native-endianness)))
((equal? native-type uint64) (bytevector-u64-set! p offset value (native-endianness)))
((equal? native-type short) (bytevector-s8-set! p offset value (native-endianness)))
((equal? native-type unsigned-short) (bytevector-u8-set! p offset value (native-endianness)))
((equal? native-type short) (bytevector-s8-set! p offset value))
((equal? native-type unsigned-short) (bytevector-u8-set! p offset value))
((equal? native-type int) (bytevector-sint-set! p offset value (native-endianness) (pffi-size-of type)))
((equal? native-type unsigned-int) (bytevector-uint-set! p offset value (native-endianness) (pffi-size-of type)))
((equal? native-type long) (bytevector-s64-set! p offset value (native-endianness)))