Cleanup C++ to Lisp translation
src/objects/type.lisp
Sun Aug 2 12:12:41 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Cleanup C++ to Lisp translation
--- old-smoke/src/objects/type.lisp 2014-10-30 08:12:04.000000000 +0100
+++ new-smoke/src/objects/type.lisp 2014-10-30 08:12:04.000000000 +0100
@@ -77,8 +77,8 @@
form))
(defmacro allocation-flag-p (type flag)
- ;; Can't just use #'get-type-flag since it
- ;; can only be one of :stack, :reference and :pointer.
+ ;; Can't just use #'get-type-flag since it can only be one of
+ ;; :stack, :reference and :pointer.
;; (:stack + :pointer = :reference) <=> (#x10 + #x20 = #x30)
`(= ,(foreign-enum-value 'smoke-type-flags flag)
(logand #x30
@@ -121,11 +121,11 @@
;; No need to convert the entire C string to lisp like in:
;; (null (name type)))
(declare (optimize (speed 3)))
- (= 0 (mem-ref (mem-aref (smoke-array-pointer
- (smoke-module-types (smoke type)))
- 'smoke-type
- (the smoke-index (id type)))
- :char)))
+ (zerop (mem-ref (mem-aref (smoke-array-pointer
+ (smoke-module-types (smoke type)))
+ 'smoke-type
+ (the smoke-index (id type)))
+ :char)))
(defgeneric get-class (smoke-symbol)
@@ -133,9 +133,7 @@
(defmethod get-class ((type smoke-type))
"Return the smoke-class of TYPE."
- (assert (/= -1 (type-slot-value type 'class))
+ (assert (class-p type)
(type)
- "The type ~S is not a smoke class." (name type))
- (make-smoke-class-from-id
- (smoke type)
- (type-slot-value type 'class)))
+ "The type ~S is not a smoke class." type)
+ (make-smoke-class-from-id (smoke type) (type-slot-value type 'class)))