(defun %mem-ref (ptr type &optional (offset 0))
   "Dereference an object of TYPE at OFFSET bytes from PTR."
-  (let* ((type (convert-foreign-type type))
+  (let* ((type (cffi-type->ecl-type type))
          (type-size (ffi:size-of-foreign-type type)))
     (si:foreign-data-ref-elt
      (si:foreign-data-recast ptr (+ offset type-size) :void) offset type)))
(defun %mem-set (value ptr type &optional (offset 0))
   "Set an object of TYPE at OFFSET bytes from PTR."
-  (let* ((type (convert-foreign-type type))
+  (let* ((type (cffi-type->ecl-type type))
          (type-size (ffi:size-of-foreign-type type)))
     (si:foreign-data-set-elt
      (si:foreign-data-recast ptr (+ offset type-size) :void)

Why in %mem-ref/%mem-set  is used
 (+ offset type-size)
instead of
 (* offset type-size)?

Or I do not understand something?

Thanks!

--
WBR, Yaroslav Kavenchuk.
_______________________________________________
cffi-devel mailing list
cffi-devel@common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel

Reply via email to