[cffi-devel] How do i cast variables

Joeish W joeish80829 at yahoo.com
Tue Oct 22 22:48:50 UTC 2013


take this for instance 

CvPointpoints[2];


id like to be able to cast  points[2] to the CvPoint struct  more info here http://docs.opencv.org/modules/core/doc/old_basic_structures.html?highlight=cvpoint#CvPoint


here is my struct which works for other things



;; (cffi:foreign-type-size '(:struct cv-point)) = 8 
(cffi:defcstruct cv-point 
(x :int) 
(y :int)) 


put in a defparameter you cant just go 

(defparameter points (cffi:foreign-alloc :int :count 2))

(defparameter a ((:struct cv-point) points))


you get an illegal function call error...any help is appreciated
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20131022/868725b2/attachment.html>


More information about the cffi-devel mailing list