<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div>here is the defcfun and deffun combo</div><div><br></div><div 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;">;; void cvSplit(const CvArr* src, CvArr* dst0, CvArr* dst1, CvArr* dst2, CvArr* dst3)
<br>;; Note: I had to use "CV-MERGE" instead of "MERGE" for the Common Lisp name of CV-MERGE so I named this
<br>;; function CV-SPLIT so they would match.
<br>(cffi:defcfun ("cvSplit" %split) :void
<br> (src cv-arr)
<br> (dest-0 cv-arr)
<br> (dest-1 cv-arr)
<br> (dest-2 cv-arr)
<br> (dest-3 cv-arr))
<br> <br>(defun cv-split (src dest-0 &optional (dest-1 (cffi:null-pointer)) (dest-2 (cffi:null-pointer)) (dest-3
(cffi:null-pointer)))
<br> "Divides a multi-channel array into several single-channel arrays."
<br> (%split src dest-0 dest-1 dest-2 dest-3)) </div><div 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></div><div 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></div><div 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 works as expected ...no errors at all</div><div 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></div><div 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;">my attempt at a macro(new to macros) below works in one piece of code when the defun it is in is evaluated at the repl then ran at the repl<br></div><div 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>;; #define cvCvtPixToPlane cvSplit
<br>(defmacro cvt-pix-to-plane (src dest-0 &optional (dest-1 (cffi:null-pointer))
<br> (dest-2 (cffi:null-pointer)) (dest-3 (cffi:null-pointer)))
<br> "Macro for CV-SPLIT"
<br> `(cv-split ,src ,dest-0 ,dest-1 ,dest-2
,dest-3))</div><div 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></div><div 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;">but in the same code when used the exact same way inside emacs (using slime/sbcl on ubuntu saucy) when it is placed inside a newly opened file (.lisp) or even my well used test.lisp file and ran with slime-compile-and-load-file i get<br></div><div 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></div><div 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></div><div 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;"> error: <br> Objects of type SB-SYS:SYSTEM-AREA-POINTER can't be dumped into fasl files.<br> --> CL-OPENCV::CV-SPLIT <br> ==><br> #.(SB-SYS:INT-SAP #X00000000)</div><div 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></div><div 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;">can you help
me figure out the issue and write macros with null-pointers correctly<br></div></div></body></html>