<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div style="" class=""><span style="" class="">I'm wrapping the C++ interface of OpenCv and C++ uses the 2d arrays.</span></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal"><br style="" class=""><span style="" class=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal"><span style="" class="">Someone from CFFI-DEVEL already showed me how to this though:</span></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica
Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal">((point 1 2) is just my OpenCV Point class wrapper)<br style="" class=""><span style="" class=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal"><br style="" class=""><span style="" class=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal"><span style="" class="">(cffi::foreign-array-alloc
<br style="" class=""> (make-array '(4 2) :initial-contents
<br style="" class=""> (list (list (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2)))
<br style="" class=""> (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2))))
<br style="" class=""> (list (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2)))
<br style="" class=""> (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2))))
<br style="" class=""> (list (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2)))
<br style="" class=""> (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2))))
<br style="" class=""> (list (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2)))
<br style="" class=""> (cffi:foreign-alloc :pointer :initial-element (c-pointer (point 1 2))))))
<br style="" class=""> '(:array :pointer 4 2))</span></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal"><br><span style="" class=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal"><br><span style="" class=""></span></div><div class="" style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal"><span style="" class="">I do appreciate your attention to this though...I had to go into CFFI and export foreign-array-alloc myself. Could I ask, if you are or know a CFFI developer if it might be possible to get this
function exported automatically. I have discovered a real world use for this function.<br style="" class=""><br style="" class=""></span></div><div style="display: block;" class="yahoo_quoted"> <div class="" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 10pt"> <div class="" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt"> <div style="" class="" dir="ltr"> <font style="" class="" face="Arial" size="2"> On Sunday, May 11, 2014 2:05 AM, Willem Rein Oudshoorn <woudshoo@xs4all.nl> wrote:<br style="" class=""> </font> </div> <blockquote class="" style=""> <div style="" class="">Joeish W <<a style="" class="" ymailto="mailto:joeish80829@yahoo.com" href="mailto:joeish80829@yahoo.com">joeish80829@yahoo.com</a>> writes:<br style="" class=""><br style="" class="">> I was hoping someone could look at this and help me
debug it.<br style="" class="">><br style="" class="">> I'm getting:<br style="" class="">><br style="" class="">> (FOREIGN-ALLOC :POINTER :INITIAL-ELEMENT (NULL-POINTER))<br style="" class="">> is not of type<br style="" class="">> SB-SYS:SYSTEM-AREA-POINTER. when I run it.<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">> (foreign-array-alloc #2A((<br style="" class="">><br style="" class="">> (foreign-alloc :pointer :initial-element (null-pointer)) <br style="" class="">> (foreign-alloc :pointer :initial-element (null-pointer))) <br style="" class="">> ((foreign-alloc :pointer :initial-element (null-pointer)) <br style="" class="">> (foreign-alloc :pointer :initial-element (null-pointer))) <br style="" class="">> ((foreign-alloc :pointer :initial-element (null-pointer)) <br style="" class="">> (foreign-alloc :pointer :initial-element (null-pointer))) <br
style="" class="">> ((foreign-alloc :pointer :initial-element (null-pointer)) <br style="" class="">> (foreign-alloc :pointer :initial-element (null-pointer)))) '(:array :pointer 4 2))<br style="" class=""><br style="" class="">A few points:<br style="" class=""><br style="" class="">1. #2A(...) does not evaluate its content so the array consists of the<br style="" class=""> unevaluated forms.<br style="" class="">2. As far as I kno, foreign-array-alloc is not exported from CFFI, so<br style="" class=""> you should not use them in your code.<br style="" class="">3. C does not have two dimensional arrays anyway, so what are you trying todo?<br style="" class=""><br style="" class="">Wim Oudshoorn.<br style="" class=""><br style="" class=""><br style="" class="">_______________________________________________<br style="" class="">Cffi-devel mailing list<br style="" class=""><a style="" class=""
ymailto="mailto:Cffi-devel@common-lisp.net" href="mailto:Cffi-devel@common-lisp.net">Cffi-devel@common-lisp.net</a><br style="" class=""><a style="" class="" href="http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel" target="_blank">http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel</a><br style="" class=""><br style="" class=""><br style="" class=""></div> </blockquote> </div> </div> </div> </div></body></html>