Support the new smokegenerator (r1015073).
src/objects/type.lisp
Thu Aug 27 13:43:13 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Support the new smokegenerator (r1015073).
* support const correctness
* remove workarounds for the old smoke
The old smoke is no longer supported.
Thanks to Arno Rehn for making the smokegenerator work with cl-smoke.
--- old-smoke/src/objects/type.lisp 2014-10-30 08:11:32.000000000 +0100
+++ new-smoke/src/objects/type.lisp 2014-10-30 08:11:32.000000000 +0100
@@ -58,10 +58,9 @@
(type-slot-value type 'name))
(defun smoke-type= (type1 type2)
- (and t ;(pointer-eq (smoke type1)
- ; (smoke type2))
- (= (id type1)
- (id type2))))
+ (if (eq (smoke type1) (smoke type2))
+ (= (id type1) (id type2))
+ (string= (name type1) (name type2))))
(defun get-type-flag (type flag)
(declare (optimize (speed 3)))
@@ -120,12 +119,14 @@
;; For efficiency just check if the first byte is a null byte;
;; No need to convert the entire C string to lisp like in:
;; (null (name type)))
- (declare (optimize (speed 3)))
- (zerop (mem-ref (mem-aref (smoke-array-pointer
- (smoke-module-types (smoke type)))
- 'smoke-type
- (the smoke-index (id type)))
- :char)))
+ (null-pointer-p (mem-ref
+ (foreign-slot-pointer
+ (mem-aref (smoke-array-pointer
+ (smoke-module-types (smoke type)))
+ 'smoke-type
+ (the smoke-index (id type)))
+ 'smoke-type 'name)
+ :pointer)))
(defgeneric get-class (smoke-symbol)