Fri Jul 24 15:32:23 CEST 2009 Tobias Rautenkranz * Fix conversion sequence from QByteArray to const char*. diff -rN -u old-smoke/src/overload-resolution.lisp new-smoke/src/overload-resolution.lisp --- old-smoke/src/overload-resolution.lisp 2014-10-30 08:12:20.000000000 +0100 +++ new-smoke/src/overload-resolution.lisp 2014-10-30 08:12:20.000000000 +0100 @@ -421,20 +421,37 @@ (or (call-using-type operator-conversion object type) (call-using-type constructor-conversion object type))) +(defun conversion-operator-name (to-type) + (concatenate 'string + "operator " + (if (class-p to-type) + (name (get-class to-type)) + (if (pointer-p to-type) + ;; Insert a space before the #\* + (let ((name (name to-type))) + (concatenate 'string + (subseq name 0 (1- (length name))) + " *")) + (name to-type))))) + +(defun coerce-to-type (object method) + (pointer-call method (pointer object))) + (defun+using-type operator-conversion object (object type) (when (object.typep 'smoke-standard-object) (let ((method (find-smoke-method (object.type-of) - (format nil "operator ~A" - (if (class-p type) - (name (get-class type)) - (name type)))))) + (conversion-operator-name type)))) (when (valid-p method) (assert (not (void-p type)) () "Conversion operators not supported by Smoke. Update to Smoke >= r955426.") - (make-match 'user-conversion - (lispify (name method) :cxx)))))) + (if (pointer-p type) + (make-match 'user-conversion + 'coerce-to-type + method) + (make-match 'user-conversion + (lispify (name method) :cxx))))))) (declaim (inline coerce-to-class)) (defun coerce-to-class (object to-class)