Skip to content

Commit

Permalink
port to clozure cl
Browse files Browse the repository at this point in the history
  • Loading branch information
wesen3000 committed Feb 9, 2009
1 parent 4087ca7 commit 76d976c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
10 changes: 8 additions & 2 deletions bezier.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@
(let* ((m (eval-bezier bezier 0.5))
(centre (circle-through-3-points a m b)))
(if (and centre
(sb-ext:float-nan-p (2d-point-x centre)))
#+sbcl
(sb-ext:float-nan-p (2d-point-x centre))
#-sbcl
nil)
(progn
(warn "NAN centre a1 ~A~%" bezier)
(make-line :a a :b b))
Expand All @@ -98,7 +101,10 @@
(let* ((centre (bezier-biarc bezier)))
;; (format t "centre; ~A~%" centre)
(if (and centre
(sb-ext:float-nan-p (2d-point-x centre)))
#+sbcl
(sb-ext:float-nan-p (2d-point-x centre))
#-sbcl
nil)
(progn (warn "NAN centre ~A~%" bezier)
(make-line :a a :b b))
(if centre
Expand Down
14 changes: 8 additions & 6 deletions pot-uffi.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
(max :double)
(epsilon :double))

;; (def-foreign-type potrace-progress-ptr (* potrace-progress))

(def-struct potrace-param
(turdsize :int)
(turnpolicy :int)
(alphamax :double)
(opticurve :int)
(opttolerance :double)
(progress (* potrace-progress)))
(progress (* (:struct potrace-progress))))

(def-foreign-type potrace-word :unsigned-long)

Expand All @@ -39,12 +41,12 @@
(def-struct potrace-curve
(n :int)
(tag (* :int))
(c (* (:array potrace-dpoint 3))))
(c (* (:array (:struct potrace-dpoint) 3))))

(def-struct potrace-path
(area :int)
(sign :int)
(curve potrace-curve)
(curve (:struct potrace-curve))
(next :pointer-self)
(childlist :pointer-self)
(priv :pointer-void))
Expand All @@ -54,7 +56,7 @@

(def-struct potrace-state
(status :int)
(plist (* potrace-path))
(plist (* (:struct potrace-path)))
(priv :pointer-void))

(def-function ("potrace_param_default" potrace-param-default)
Expand Down Expand Up @@ -120,8 +122,8 @@

(defun pot-round (num)
;; (format t "num: ~A num * 1000: ~A~%" num (* num 1000.0))
(if (or (sb-ext:float-nan-p num)
(sb-ext:float-infinity-p (* 1000.0 num))
(if (or #+sbcl(sb-ext:float-nan-p num)
#+sbcl(sb-ext:float-infinity-p (* 1000.0 num))
(> num most-positive-short-float)
(< num most-negative-short-float))
num
Expand Down

0 comments on commit 76d976c

Please sign in to comment.