<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="">I have this C wrapper <br style=""></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=""></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">DMatch* cv_create_DMatch3(int _queryIdx, int _trainIdx, float _distance) {<br style="" class="">    return new DMatch(_queryIdx, _trainIdx, _distance);<br style="" class="">}<br style="" class=""></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=""></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">it is a wrapper for these struct members</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=""></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"><a style="" class=""
 href="http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_descriptor_matchers.html?highlight=dmatch#DMatch">http://docs.opencv.org/modules/features2d/doc/common_interfaces_of_descriptor_matchers.html?highlight=dmatch#DMatch</a><br style="" class=""></div><br style="" class=""><br style="" class="">here is my lisp wrapper for it:<br style="" class=""><br style="" class="">(defctype dmatch :pointer)<br style="" class=""><br style="" class="">(defcfun ("cv_create_DMatch3" dmatch3) (:pointer dmatch) <br style="" class="">  "DMatch constructor"<br style="" class="">  (-query-idx :int)<br style="" class="">  (-train-idx :int)<br style="" class="">  (-distance :float))<br style="" class=""><br style="" class="">In C I can do this:<br style="" class=""><br style="" class="">  DMatch* a = cv_create_DMatch3(1, 2, 3.0);<br style="" class="">  cout << a->distance ;<br style="" class=""><br style="" class="">and
 the output is 3<br style="" class=""><br style="" class="">but in lisp when I do this:<br style="" class=""><br style="" class="">(defparameter a (dmatch3 1 2 3f0))<br style="" class=""><br style="" class="">LCV> (mem-aref a :int 0) <br style="" class="">1<br style="" class="">LCV> (mem-aref a :int 1) <br style="" class="">2<br style="" class="">LCV> (mem-aref a :float 2) <br style="" class="">#<SINGLE-FLOAT quiet NaN> <--- this is output<br><br><br>Any help on figuring out the reason would be much appreciated<br style="" class=""><br style="" class=""><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=""></div></div></body></html>