Smoke::t_class is now also used for classes not wrapped by Smoke & remove global-space part from enum symbols.
Wed Sep 9 15:22:32 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Smoke::t_class is now also used for classes not wrapped by Smoke & remove global-space part from enum symbols.
diff -rN -u old-smoke/src/objects/stack.lisp new-smoke/src/objects/stack.lisp
--- old-smoke/src/objects/stack.lisp 2014-10-30 07:05:46.000000000 +0100
+++ new-smoke/src/objects/stack.lisp 2014-10-30 07:05:46.000000000 +0100
@@ -105,13 +105,13 @@
"Returns the Lisp representation for STACK-ITEM of the basic C type TYPE."
(declare (optimize (speed 3)))
(ecase (type-id type)
- (0 (if-let ((translation (gethash (name type) *to-lisp-translations*)))
- (let ((pointer (foreign-slot-value stack-item 'smoke-stack-item
- 'voidp)))
- (prog1 (funcall (car translation) pointer)
- (when (stack-p type)
- (funcall (cdr translation) pointer))))
- (error "Do not know how to convert the type ~A to Lisp." type)))
+ ((0 13) (if-let ((translation (gethash (name type) *to-lisp-translations*)))
+ (let ((pointer (foreign-slot-value stack-item 'smoke-stack-item
+ 'voidp)))
+ (prog1 (funcall (car translation) pointer)
+ (when (stack-p type)
+ (funcall (cdr translation) pointer))))
+ (error "Do not know how to convert the type ~A to Lisp." type)))
(1 (foreign-slot-value stack-item 'smoke-stack-item 'bool))
(2 (code-char (foreign-slot-value stack-item 'smoke-stack-item 'char)))
(3 (code-char (foreign-slot-value stack-item 'smoke-stack-item 'uchar)))
diff -rN -u old-smoke/src/objects/type.lisp new-smoke/src/objects/type.lisp
--- old-smoke/src/objects/type.lisp 2014-10-30 07:05:46.000000000 +0100
+++ new-smoke/src/objects/type.lisp 2014-10-30 07:05:46.000000000 +0100
@@ -104,7 +104,7 @@
(defun class-p (type)
"Returns T when TYPE is a smoke class"
(and (eql (type-id type) 13)
- (/= -1 (type-slot-value type 'class))))
+ (not (zerop (type-slot-value type 'class)))))
(defun type-id (type)
"Returns the ID of TYPE."
diff -rN -u old-smoke/src/overload-resolution.lisp new-smoke/src/overload-resolution.lisp
--- old-smoke/src/overload-resolution.lisp 2014-10-30 07:05:46.000000000 +0100
+++ new-smoke/src/overload-resolution.lisp 2014-10-30 07:05:46.000000000 +0100
@@ -338,8 +338,11 @@
(10 (object.typep 'single-float))
(11 (object.typep 'double-float))
(12 (object.typep 'enum)) ;; FIXME enum-type
- (13 (and (object.typep 'smoke-standard-object)
- (smoke-type= (get-class type) (object.type-of))))))
+ (13 (if (class-p type)
+ (and (object.typep 'smoke-standard-object)
+ (smoke-type= (get-class type) (object.type-of)))
+ (when-let (test (gethash (name type) *from-lisp-translations*))
+ (funcall test object (using-typep)))))))
(defun make-cleanup-pointer (pointer cleanup-function)
@@ -504,7 +507,9 @@
(defun call-using-args (object-or-class name arguments)
"Calls the method NAME of OBJECT-OR-CLASS with ARGUMENTS."
- (declare (optimize (speed 3)))
+ (declare (optimize (speed 3))
+ (type (or smoke-standard-class smoke-standard-object)
+ object-or-class))
(multiple-value-bind (method sequence)
(find-best-viable-function name
arguments
diff -rN -u old-smoke/src/smoke-to-clos.lisp new-smoke/src/smoke-to-clos.lisp
--- old-smoke/src/smoke-to-clos.lisp 2014-10-30 07:05:46.000000000 +0100
+++ new-smoke/src/smoke-to-clos.lisp 2014-10-30 07:05:46.000000000 +0100
@@ -4,8 +4,10 @@
"Returns an expression that defines a constant for the enum METHOD.
The second return value is the expression to export the constant."
(let ((symbol
- (if (string= (name (get-class method))
- "Qt")
+ (if (or (string= (name (get-class method))
+ "Qt")
+ (string= (name (get-class method))
+ "QGlobalSpace"))
(lispify (concatenate 'string "+" (name method)
"+")
package)