From: Lars B. <la...@no...> - 2004-11-13 09:11:58
|
A few days ago, I mailed about an FFI problem: http://sourceforge.net/mailarchive/forum.php?thread_id=5922832&forum_id=24772 I now understand the cause of the problem. The patch below is obviously not the right solution (in so many ways) but it solves my immediate needs. Should I keep working on this, and if so, which direction should I take? Add declarations in def-foreign-struct-accessor? Index: sdl/sdl.lisp =================================================================== RCS file: /cvsroot/cl-sdl/cl-sdl-timot/sdl/sdl.lisp,v retrieving revision 1.17 diff -u -r1.17 sdl.lisp --- sdl/sdl.lisp 3 Nov 2003 17:35:42 -0000 1.17 +++ sdl/sdl.lisp 13 Nov 2004 08:55:15 -0000 @@ -274,6 +274,8 @@ (format-version unsigned-int) (ref-count int)) +(uffi:def-type surface-pointer (* surface)) + (def-foreign-struct-accessors (surface) w h pixels format flags pitch offset locked format-version) Index: sdl/cl-sdl.lisp =================================================================== RCS file: /cvsroot/cl-sdl/cl-sdl-timot/sdl/cl-sdl.lisp,v retrieving revision 1.7 diff -u -r1.7 cl-sdl.lisp --- sdl/cl-sdl.lisp 5 Aug 2003 08:34:56 -0000 1.7 +++ sdl/cl-sdl.lisp 13 Nov 2004 08:55:14 -0000 @@ -77,6 +77,7 @@ (values)) (defun draw-pixel (surface x y r g b &key (check-lock-p t) (update-p t) (clipping-p t)) + (declare (type sdl::surface-pointer surface)) (check-types x y (unsigned-byte 16)) (check-types r g b (unsigned-byte 8)) (block clipped |