Spellcheck --> to head
Tue Jul 13 21:17:41 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Use libsmokebase instead of libsmokeqtcore.
hunk ./src/libsmoke/CMakeLists.txt 13
-find_library(smokeqtcore_LIB smokeqtcore)
-if (smokeqtcore_LIB)
- set(smokeqtcore_FOUND TRUE)
-endif (smokeqtcore_LIB)
+find_library(smokebase_LIB smokebase)
+if (smokebase_LIB)
+ set(smokebase_FOUND TRUE)
+endif (smokebase_LIB)
hunk ./src/libsmoke/CMakeLists.txt 18
-if (smokeqtcore_FOUND)
- message(STATUS "Found smokeqtcore: ${smokeqtcore}")
-else (smokeqtcore_FOUND)
- message(FATAL_ERROR "Could not find smokeqtcore")
-endif (smokeqtcore_FOUND)
+if (smokebase_FOUND)
+ message(STATUS "Found smokebase: ${smokebase}")
+else (smokebase_FOUND)
+ message(FATAL_ERROR "Could not find smokebase")
+endif (smokebase_FOUND)
hunk ./src/libsmoke/CMakeLists.txt 27
-target_link_libraries(clsmoke ${QT_LIBRARIES} ${smokeqtcore_LIB})
+target_link_libraries(clsmoke ${QT_LIBRARIES} ${smokebase_LIB})
Sat Apr 3 21:11:26 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* slot-value access for static attributes using the class instead of an object.
hunk ./src/overload-resolution.lisp 557
+(defmethod slot-missing (meta-class (class smoke-standard-class) slot-name operation &optional new-value)
+ (let ((method (find-smoke-method class (lisp-to-cxx (string slot-name)))))
+ (if (or (not (valid-p method)) (not (static-p method)))
+ (call-next-method)
+ (ecase operation
+ (setf [_$_]
+ (handler-case (funcall (fdefinition
+ (intern
+ (concatenate 'string "SET-"
+ (string-upcase
+ (string slot-name)))
+ :cxx))
+ class new-value)
+ (undefined-function ()
+ (error "The C++ attribute ~A of ~A is read only." slot-name class))
+ (no-applicable-cxx-method (condition)
+ (if (null (viable-functions (condition-method condition)
+ (length (condition-arguments condition))
+ (condition-class condition)))
+ (error "The C++ attribute ~A of ~A is read only." slot-name class)
+ (error condition)))))
+ (slot-boundp t)
+ (slot-makunbound (error "Can not unbind the C++ attribute ~A of ~A." slot-name class))
+ (slot-value (s-call method (null-pointer)))))))
+
hunk ./src/overload-resolution.lisp 583
- (let ((method (find-smoke-method (class-of object) (lisp-to-cxx (string slot-name)))))
+ (let ((method (find-smoke-method class (lisp-to-cxx (string slot-name)))))
Sat Apr 3 14:04:39 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Make the slot-* functions work for C++ class attributes.
Allow slot-value to be used to access C++ member variables of objects.
hunk ./src/objects/stack.lisp 143
- (get-class type))
+ (get-class type))
hunk ./src/objects/stack.lisp 146
- (cerror "Remove the old object."
- "The object at pointer ~A is ~A but should be a ~A."
- object (get-object object) type)
- (remove-object object)
+ (when (stack-p type)
+ ;; The first member varible of a class can have the
+ ;; same address as its object.
+ ;; e.g.: QSharedData::ref
+ (cerror "Remove the old object."
+ "The object at pointer ~A is ~A but should be a ~A."
+ object (get-object object) type)
+ (remove-object object))
hunk ./src/overload-resolution.lisp 532
-
hunk ./src/overload-resolution.lisp 556
+
+(defmethod slot-missing ((class smoke-standard-class) object slot-name operation &optional new-value)
+ (let ((method (find-smoke-method (class-of object) (lisp-to-cxx (string slot-name)))))
+ (if (not (valid-p method))
+ (call-next-method)
+ (ecase operation
+ (setf [_$_]
+ (handler-case (funcall (fdefinition
+ (intern
+ (concatenate 'string "SET-"
+ (string-upcase
+ (string slot-name)))
+ :cxx))
+ object new-value)
+ (undefined-function ()
+ (error "The C++ attribute ~A of ~A is read only." slot-name object))
+ (no-applicable-cxx-method (condition)
+ (if (null (viable-functions (condition-method condition)
+ (length (condition-arguments condition))
+ (condition-class condition)))
+ (error "The C++ attribute ~A of ~A is read only." slot-name object)
+ (error condition)))))
+ (slot-boundp t)
+ (slot-makunbound (error "Can not unbind the C++ attribute ~A of ~A." slot-name object))
+ (slot-value (s-call method (cast object (get-class method))))))))
Sat Apr 3 14:03:07 CEST 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix attribute vs method map to same Lisp name clash.
e.g.: setWidget() and set_widget are in Lisp both #'set-widget. Prefer the method
over the attribute; the attribute will be accessible with SLOT-VALUE.
hunk ./src/smoke-to-clos.lisp 141
- (setf (gethash (lispify name "CXX") generics)
- name))
+ (let ((lisp-name (lispify name "CXX")))
+ (unless (and (gethash lisp-name generics) (attribute-p method))
+ (setf (gethash lisp-name generics) name))))
Wed Mar 10 17:38:58 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Improve missing to-lisp-translator error message.
hunk ./src/objects/stack.lisp 115
- (cerror "Return the pointer"
- "Do not know how to convert the type ~A to Lisp." type))))
+ (cerror "Return the pointer"
+ "Missing type translator to convert the type ~A to Lisp."
+ type))))
Sat Feb 20 21:56:27 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Allow passing integers as enum arguments.
hunk ./src/overload-resolution.lisp 372
-(defun coerce-enum (enum)
+(defun coerce-from-enum (enum)
hunk ./src/overload-resolution.lisp 381
+(defun coerce-to-enum (number)
+ ;; we can skip the enum type because it is not checked at this
+ ;; point.
+ (make-instance 'enum :value number))
+
hunk ./src/overload-resolution.lisp 394
- (make-match 'promotion 'coerce-enum)))
+ (make-match 'promotion 'coerce-from-enum)))
hunk ./src/overload-resolution.lisp 396
- (make-match 'promotion 'coerce-enum)))
+ (make-match 'promotion 'coerce-from-enum)))
hunk ./src/overload-resolution.lisp 400
- (make-match 'promotion 'coerce-double-float)))))
+ (make-match 'promotion 'coerce-double-float)))
+ (12 (when (object.typep '(integer 0))
+ (make-match 'promotion 'coerce-to-enum)))))
Sat Feb 20 19:01:21 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix overload resolution exact match for long and ulong.
hunk ./src/overload-resolution.lisp 343
- (8 (object.typep '(c-integer :long)))
- (9 (object.typep '(c-integer :unsigned-long)))
+ (8 (object.typep '(and (c-integer :long)
+ (not (c-integer :int)))))
+ (9 (object.typep '(and (c-integer :unsigned-long)
+ (not (c-integer :unsigned-int)))))
Sat Feb 20 18:56:48 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Faster no overload resolution method lookup.
hunk ./src/libsmoke/smoke.cpp 198
- *m = get_smoke(smoke)->findMethod(class_name, method_name);
+ Smoke::ModuleIndex id_class(get_smoke(smoke), class_index);
+
+ Smoke::ModuleIndex id_method_name = get_smoke(smoke)->findMethodName(class_name, method_name);
+ *m = get_smoke(smoke)->findMethod(id_class, id_method_name);
Sat Feb 20 18:24:36 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Cache overload resolution on sbcl
hunk ./src/clos.lisp 464
- (find-best-viable-function (constructor-name class)
- arguments
- class)
+ (#-sbcl find-best-viable-function
+ #+sbcl find-best-viable-function-cached
+ (constructor-name class)
+ arguments
+ class nil)
hunk ./src/objects/type.lisp 122
+ (declare (optimize (speed 3)))
hunk ./src/objects/type.lisp 124
- (foreign-slot-pointer [_$_]
- (mem-aref (smoke-array-pointer
- (smoke-module-types (smoke type)))
- 'smoke-type
- (the smoke-index (id type)))
- 'smoke-type 'name)
- :pointer)))
+ (foreign-slot-pointer [_$_]
+ (mem-aref (smoke-array-pointer
+ (smoke-module-types (smoke type)))
+ 'smoke-type
+ (the smoke-index (id type)))
+ 'smoke-type 'name)
+ :pointer)))
hunk ./src/overload-resolution.lisp 198
-(eval-when (:compile-toplevel :load-toplevel :execute)
- (defun conversion-function (name &optional arg)
- (if arg
- `(if (using-typep)
- `(,,name
- (find-class ',(class-name ,arg)))
- #'(lambda (object)
- (funcall (fdefinition ,name)
- object ,arg)))
- `(if (using-typep)
- ,name
- (fdefinition ,name)))))
-
hunk ./src/overload-resolution.lisp 200
- `(,(symbolicate 'make- (eval type))
- :function-name ,(conversion-function name argument)
- ,@args))
+ (flet ((conversion-function (name &optional arg)
+ (if arg
+ `(if (using-typep)
+ `(,,name
+ ,(if (typep ,arg 'class)
+ `(find-class ',(class-name ,arg))
+ `(find-smoke-method (find-class ,(class-name
+ (find-smoke-class
+ (get-class ,arg))))
+ ,(name ,arg))))
+ #'(lambda (object)
+ (funcall (fdefinition ,name)
+ object ,arg)))
+ `(if (using-typep)
+ ,name
+ (fdefinition ,name)))))
+ `(,(symbolicate 'make- (eval type))
+ :function-name ,(conversion-function name argument)
+ ,@args)))
hunk ./src/overload-resolution.lisp 310
- (subtypep type ',lisp-type)
+ (multiple-value-bind (value valid-p)
+ (subtypep type ',lisp-type)
+ (unless valid-p
+ (throw 'unspecific-type type))
+ value)
hunk ./src/overload-resolution.lisp 347
- (12 (and (object.typep 'enum) ;; FIXME enum-type using type
- (smoke-type= type (enum-type object))))
+ (12 (when (object.typep 'enum)
+ (when (using-typep)
+ (throw 'unspecific-type object))
+ (smoke-type= type (enum-type object))))
hunk ./src/overload-resolution.lisp 530
- (find-best-viable-function name
- arguments
- (smoke-class-of object-or-class)
- (when (typep object-or-class
- 'smoke-standard-object)
- (const-p object-or-class)))
+ (#-sbcl find-best-viable-function
+ #+sbcl find-best-viable-function-cached
+ name
+ arguments
+ (smoke-class-of object-or-class)
+ (when (typep object-or-class
+ 'smoke-standard-object)
+ (const-p object-or-class)))
hunk ./src/overload-resolution.lisp 543
- (if (static-p method)
- (apply #'call-sequence method (null-pointer) sequence arguments)
- (apply #'call-sequence method (cast object-or-class (get-class method)) [_$_]
- sequence arguments))))
+ (apply #'call-sequence method
+ (if (static-p method)
+ (null-pointer)
+ (cast object-or-class (get-class method)))
+ sequence arguments)))
hunk ./src/sb-optimize.lisp 95
-;;; cache ==================================================================
+;;; Cache overload resolution / method lookup
+
+;;; FIXME the cached lookup should be faster
hunk ./src/sb-optimize.lisp 99
-;;; we could replace the call to #'find-best-viable-function in
-;;; #'call-using-args with a call to
-;;; #'find-best-viable-function-cached, but it is only doubles speed.
+;;; cache return value conversion
+;;;
+;;; Using the gf symbol instead of the method name would be better,
+;;; althoug we would have to invent one for constructors.
+;;;
+;;; Since the -using-types stuff was intended for for compile time
+;;; expansion it is not that well suited for this. i.e. passing
+;;; closures would be better than the actual syntax.
+;;;
+;;; For qt.tests the uncached calls make up 30 % of all calls.
+;;; qt.examples:colliding-mice (run for ~1 min) gets 20 % uncached
+;;; calls and qt.examples:class-browser get 10 %. (20 February 2010)
hunk ./src/sb-optimize.lisp 112
-(sb-int:defun-cached (find-best-viable-function-using-types-cached
+(sb-int:defun-cached (find-best-viable-function-using-layouts-cached
hunk ./src/sb-optimize.lisp 117
- (class class)
+ (sb-c::layout class)
hunk ./src/sb-optimize.lisp 122
- (sxhash arguments)
+ (the fixnum
+ (reduce [_$_]
+ #'logxor
+ (mapcar #'sb-c::layout-clos-hash
+ arguments)))
hunk ./src/sb-optimize.lisp 135
- (find-best-viable-function-using-types name arguments class const-p)
+ (find-best-viable-function-using-types
+ name (mapcar #'sb-pcl::wrapper-class* arguments)
+ class const-p)
hunk ./src/sb-optimize.lisp 142
+ (declare (optimize (speed 3)))
hunk ./src/sb-optimize.lisp 145
- (second s)))))
+ (eval (second s))))))
hunk ./src/sb-optimize.lisp 147
- [_$_]
+
hunk ./src/sb-optimize.lisp 154
- (find-best-viable-function-using-types-cached
+ (find-best-viable-function-using-layouts-cached
hunk ./src/sb-optimize.lisp 156
- (mapcar #'(lambda (o) (class-of o)) arguments)
+ (mapcar #'(lambda (o) (sb-c::layout-of o)) arguments)
Fri Feb 19 22:22:50 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* cleanup #'delete-object & optimize #'constructor-name.
hunk ./src/clos.lisp 455
- (let ((name-start (search "::" (name class) :from-end t)))
+ (declare (optimize (speed 3)))
+ (let* ((name (the simple-string (name class)))
+ (name-start (search "::" name :from-end t)))
hunk ./src/clos.lisp 459
- (subseq (name class) (+ name-start 2))
- (name class))))
+ (subseq name (+ name-start 2))
+ name)))
hunk ./src/smoke.lisp 76
- (let ((method-name (concatenate 'string "~" (name (class-of object)))))
- (s-call
- (make-smoke-method-from-name (class-of object) method-name)
- (pointer object)))
+ (delete-pointer (pointer object) (class-of object))
Fri Feb 19 22:10:24 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* No need to construct a SmokeBinding per Smoke module.
hunk ./src/bindings.lisp 8
-
hunk ./src/bindings.lisp 10
- (binding (null-pointer) :type foreign-pointer)
- (no-dispatch-binding (null-pointer) :type foreign-pointer)
hunk ./src/clos.lisp 340
- ((binding :pointer)
- (method smoke-index)
+ ((method smoke-index)
hunk ./src/clos.lisp 351
- :smoke (gethash (pointer-address
- (smoke-get-smoke binding))
- *smoke-modules*)
+ :smoke (smoke (class-of object))
hunk ./src/libsmoke/smoke.cpp 15
-/** Returns the Smoke module of a Smoke binding.
- * @related cl_smoke::Binding
- * @param binding the Binding
- *
- * @return the Smoke module
- */
-CL_SMOKE_EXPORT void*
-cl_smoke_get_smoke(smoke_binding binding)
-{
- return static_cast<NoDispatchBinding*>(binding)->get_smoke();
-}
-
hunk ./src/libsmoke/smoke.cpp 28
-cl_smoke_construct_binding(void* smoke, void* destruct, void* dispatch)
+cl_smoke_construct_binding(void* destruct, void* dispatch)
hunk ./src/libsmoke/smoke.cpp 31
- return new NoDispatchBinding(static_cast<Smoke*>(smoke),
- reinterpret_cast<NoDispatchBinding::destructed>(destruct));
+ return new NoDispatchBinding(reinterpret_cast<NoDispatchBinding::destructed>(destruct));
hunk ./src/libsmoke/smoke.cpp 33
- return new Binding(static_cast<Smoke*>(smoke),
- reinterpret_cast<NoDispatchBinding::destructed>(destruct),
+ return new Binding(reinterpret_cast<NoDispatchBinding::destructed>(destruct),
hunk ./src/libsmoke/smoke.cpp 187
- * @param smoke the smoke binding
+ * @param smoke the smoke module
hunk ./src/libsmoke/smoke.lisp 41
- (smoke :pointer)
hunk ./src/libsmoke/smoke.lisp 53
-(declaim (inline smoke-get-smoke))
-(defcfun (smoke-get-smoke "cl_smoke_get_smoke") :pointer
- (smoke-binding smoke-binding))
-
hunk ./src/libsmoke/smokebinding.cpp 26
- * @param smoke the Smoke module
hunk ./src/libsmoke/smokebinding.cpp 28
-NoDispatchBinding::NoDispatchBinding(Smoke *smoke, destructed destruct)
- : SmokeBinding(smoke),
+NoDispatchBinding::NoDispatchBinding(destructed destruct)
+ : SmokeBinding(NULL),
hunk ./src/libsmoke/smokebinding.cpp 57
- Q_ASSERT(classId >= 0 && classId <= smoke->numClasses);
- return const_cast<char*>(smoke->classes[classId].className);
+ qFatal("className() Not implemented");
hunk ./src/libsmoke/smokebinding.cpp 83
- * @param smoke the Smoke module
hunk ./src/libsmoke/smokebinding.cpp 86
-Binding::Binding(Smoke *smoke, destructed destruct,
- dispatch_method dispatch)
- : NoDispatchBinding(smoke, destruct),
+Binding::Binding(destructed destruct, dispatch_method dispatch)
+ : NoDispatchBinding(destruct),
hunk ./src/libsmoke/smokebinding.cpp 99
- int ret = dispatch(this, method, object, stack, abstract);
+ int ret = dispatch(method, object, stack, abstract);
hunk ./src/libsmoke/smokebinding.h 14
- NoDispatchBinding(Smoke *smoke, destructed destruct);
+ NoDispatchBinding(destructed destruct);
hunk ./src/libsmoke/smokebinding.h 26
- Smoke*
- get_smoke() const
- { return smoke; }
-
hunk ./src/libsmoke/smokebinding.h 33
- typedef int (*dispatch_method)(Binding* binding, Smoke::Index method,
+ typedef int (*dispatch_method)(Smoke::Index method,
hunk ./src/libsmoke/smokebinding.h 36
- Binding(Smoke *smoke, destructed destruct, dispatch_method dispatch);
+ Binding(destructed destruct, dispatch_method dispatch);
hunk ./src/smoke.lisp 82
+(eval-startup (:load-toplevel :execute)
+ (defparameter *binding* (smoke-construct-binding
+ (callback destructed)
+ (callback dispatch-method)))
+ (defparameter *no-dispatch-binding* (smoke-construct-binding
+ (callback destructed)
+ (null-pointer))))
+
hunk ./src/smoke.lisp 98
- (smoke-module-binding (smoke class))
- (smoke-module-no-dispatch-binding (smoke class))))
+ *binding*
+ *no-dispatch-binding*))
hunk ./src/smoke.lisp 112
- (let ((no-dispatch-binding
- (smoke-construct-binding smoke (callback destructed) (null-pointer)))
- (binding (smoke-construct-binding smoke (callback destructed)
- (callback dispatch-method))))
- (setf (smoke-module-pointer module) smoke
- (smoke-module-no-dispatch-binding module) no-dispatch-binding
- (smoke-module-binding module) binding)
- (init-smoke-module module)
- (setf (gethash (pointer-address smoke) *smoke-modules*) module)
- module))
+ (setf (smoke-module-pointer module) smoke)
+ (init-smoke-module module)
+ (setf (gethash (pointer-address smoke) *smoke-modules*) module)
+ module)
Thu Feb 18 20:57:00 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Don't dispatch virtual methods for builtin classes (reduces overhead).
hunk ./src/bindings.lisp 12
+ (no-dispatch-binding (null-pointer) :type foreign-pointer)
hunk ./src/clos.lisp 350
- (when (and object (typep (class-of object) 'cxx:class))
- ;; Do not allow overwriting methods of classes the users has
- ;; not derived from (like in C++), to reduce overhead.
+ (unless (null object)
hunk ./src/libsmoke/cl_smoke.h 37
-/** Casts the void pointer smoke_binding to the Binding class.
- * @param smoke the smoke binding
- *
- * @return pointer to the Binding instance
- */
-static inline
-Binding*
-get_smoke_binding(smoke_binding binding)
-{
- return static_cast<Binding*>(binding);
-}
-
hunk ./src/libsmoke/class.lisp 8
+ (:namespace #x08)
hunk ./src/libsmoke/class.lisp 25
+(declaim (inline smoke-class-id))
hunk ./src/libsmoke/smoke.cpp 24
- return get_smoke_binding(binding)->get_smoke();
+ return static_cast<NoDispatchBinding*>(binding)->get_smoke();
hunk ./src/libsmoke/smoke.cpp 29
+ * When method dispatching is not needed, a null pointer can be passed for @a dispatch.
hunk ./src/libsmoke/smoke.cpp 31
+ * @related cl_smoke::NoDispatchBinding
+ * @related cl_smoke_destruct_binding
hunk ./src/libsmoke/smoke.cpp 40
-cl_smoke_init(void* smoke, void* destruct, void* dispatch)
+cl_smoke_construct_binding(void* smoke, void* destruct, void* dispatch)
hunk ./src/libsmoke/smoke.cpp 42
- return new Binding(static_cast<Smoke*>(smoke),
- reinterpret_cast<Binding::destructed>(destruct),
- reinterpret_cast<Binding::dispatch_method>(dispatch));
+ if (NULL == dispatch)
+ return new NoDispatchBinding(static_cast<Smoke*>(smoke),
+ reinterpret_cast<NoDispatchBinding::destructed>(destruct));
+ else
+ return new Binding(static_cast<Smoke*>(smoke),
+ reinterpret_cast<NoDispatchBinding::destructed>(destruct),
+ reinterpret_cast<Binding::dispatch_method>(dispatch));
hunk ./src/libsmoke/smoke.cpp 51
-/** Deletes the smoke binding.
- * @related cl_smoke::Binding
+/** Deletes the Smoke binding.
+ * @related cl_smoke_construct_binding
hunk ./src/libsmoke/smoke.cpp 55
-cl_smoke_destruct(smoke_binding binding)
+cl_smoke_destruct_binding(smoke_binding binding)
hunk ./src/libsmoke/smoke.cpp 57
- delete get_smoke_binding(binding)->get_smoke();
- delete get_smoke_binding(binding);
+ // Destructor is virtual; thus we can do this.
+ delete static_cast<SmokeBinding*>(binding);
hunk ./src/libsmoke/smoke.cpp 61
-/** Gets a Smoke modules name.
+/** Gets a Smoke module name.
hunk ./src/libsmoke/smoke.cpp 209
- *m = get_smoke(smoke)->findMethod(get_smoke(smoke)->className(class_index),
- method_name);
+ Q_ASSERT(class_index >= 0 && class_index <= get_smoke(smoke)->numClasses);
+
+ const char* class_name = get_smoke(smoke)->className(class_index);
+ *m = get_smoke(smoke)->findMethod(class_name, method_name);
+
hunk ./src/libsmoke/smoke.cpp 236
- * @param object the objec
+ * @param object the object
hunk ./src/libsmoke/smoke.lisp 40
-(defcfun (smoke-init "cl_smoke_init") smoke-binding
+(defcfun (smoke-construct-binding "cl_smoke_construct_binding") smoke-binding
hunk ./src/libsmoke/smoke.lisp 45
-(defcfun (smoke-destruct "cl_smoke_destruct") :void
+(defcfun (smoke-destruct-destruct "cl_smoke_destruct_binding") :void
hunk ./src/libsmoke/smokebinding.cpp 9
-/** @class Binding
- * @brief The Smoke binding.
+/** @class NoDispatchBinding
+ * @brief The Smoke binding for classes we need no dispatching.
+ * This saves some overhead, since it does not call into Lisp.
+ * Idea stolen from CommonQt ;)
+ *
+ * Dispatches for non extended classes (not of class CXX:CLASS) are between
+ * 20% - 40% (for qt.examples:colliding-mice - qt.examples:class-browser). (18 February 2010)
hunk ./src/libsmoke/smokebinding.cpp 18
-
-/** @typedef Binding::destructed
+/** @typedef NoDispatchBinding::destructed
hunk ./src/libsmoke/smokebinding.cpp 25
+/** Constructor.
+ * @param smoke the Smoke module
+ * @param destruct destruct callback
+ */
+NoDispatchBinding::NoDispatchBinding(Smoke *smoke, destructed destruct)
+ : SmokeBinding(smoke),
+ destruct(destruct)
+{
+ Q_ASSERT(destruct);
+}
+
+/** Invoked when a Smoke object is destructed. */
+void
+NoDispatchBinding::deleted(Smoke::Index, void *object)
+{
+ destruct(object);
+}
+
+/** Invoked when a Smoke method gets called. */
+bool
+NoDispatchBinding::callMethod(Smoke::Index method, void* object,
+ Smoke::Stack stack, bool abstract)
+{
+ Q_ASSERT(!abstract);
+ return false;
+}
+
+/**
+ * @todo Returning a const char* would be better
+ */
+char*
+NoDispatchBinding::className(Smoke::Index classId)
+{
+ Q_ASSERT(classId >= 0 && classId <= smoke->numClasses);
+ return const_cast<char*>(smoke->classes[classId].className);
+}
+
+/** @function NoDispatchBinding::get_smoke()
+ * Gets the Smoke instance associated with the binding.
+ * @return a pointer to the Smoke instance
+ */
+
+/** @class Binding
+ * @brief The Smoke binding.
+ */
hunk ./src/libsmoke/smokebinding.cpp 91
- : SmokeBinding(smoke),
- destruct(destruct),
+ : NoDispatchBinding(smoke, destruct),
hunk ./src/libsmoke/smokebinding.cpp 94
- Q_ASSERT(smoke);
- Q_ASSERT(destruct);
hunk ./src/libsmoke/smokebinding.cpp 97
-/** Invoked when a Smoke object is destructed. */
-void
-Binding::deleted(Smoke::Index, void *object)
-{
- destruct(object);
-}
hunk ./src/libsmoke/smokebinding.cpp 109
-/**
- * @todo Returning a const char* would be better
- */
-char*
-Binding::className(Smoke::Index classId)
-{
- return const_cast<char*>(smoke->classes[classId].className);
-}
-
-/** Gets the Smoke instance associated with the binding.
- * @return a pointer to the Smoke instance
- */
-Smoke*
-Binding::get_smoke() const
-{
- return smoke;
-}
-
hunk ./src/libsmoke/smokebinding.h 9
-class Binding : public SmokeBinding
+class NoDispatchBinding : public SmokeBinding
hunk ./src/libsmoke/smokebinding.h 14
- typedef int (*dispatch_method)(Binding* binding, Smoke::Index method,
- void* object, Smoke::Stack args, int abstract);
-
- Binding(Smoke *smoke, destructed destruct, dispatch_method dispatch);
+ NoDispatchBinding(Smoke *smoke, destructed destruct);
hunk ./src/libsmoke/smokebinding.h 27
- get_smoke() const;
+ get_smoke() const
+ { return smoke; }
hunk ./src/libsmoke/smokebinding.h 32
+};
+
+class Binding : public NoDispatchBinding
+{
+ public:
+ typedef int (*dispatch_method)(Binding* binding, Smoke::Index method,
+ void* object, Smoke::Stack args, int abstract);
+
+ Binding(Smoke *smoke, destructed destruct, dispatch_method dispatch);
+
+
+ virtual bool
+ callMethod(Smoke::Index method, void* object,
+ Smoke::Stack stack, bool abstract);
+
+
+ private:
hunk ./src/smoke.lisp 85
- (with-foreign-object (stack 'smoke-stack-item 2)
- (setf (foreign-slot-value (mem-aref stack 'smoke-stack-item 1)
- 'smoke-stack-item 'voidp)
- (smoke-module-binding (smoke (class-of object))))
- (foreign-funcall-pointer [_$_]
- (foreign-slot-value (smoke-class-pointer (class-of object))
- 'smoke-class 'class-function)
- ()
- smoke-index 0 ;; set binding method index
- :pointer (pointer object)
- smoke-stack stack
- :void)))
+ (let ((class (class-of object)))
+ (with-foreign-object (stack 'smoke-stack-item 2)
+ (setf (foreign-slot-value (mem-aref stack 'smoke-stack-item 1)
+ 'smoke-stack-item 'voidp)
+ (if (typep class 'cxx:class)
+ (smoke-module-binding (smoke class))
+ (smoke-module-no-dispatch-binding (smoke class))))
+ (foreign-funcall-pointer [_$_]
+ (foreign-slot-value (smoke-class-pointer class)
+ 'smoke-class 'class-function)
+ ()
+ smoke-index 0 ;; set binding method index
+ :pointer (pointer object)
+ smoke-stack stack
+ :void))))
hunk ./src/smoke.lisp 104
- (let* ((binding (smoke-init smoke (callback destructed)
- (callback dispatch-method))))
+ (let ((no-dispatch-binding
+ (smoke-construct-binding smoke (callback destructed) (null-pointer)))
+ (binding (smoke-construct-binding smoke (callback destructed)
+ (callback dispatch-method))))
hunk ./src/smoke.lisp 109
+ (smoke-module-no-dispatch-binding module) no-dispatch-binding
Thu Feb 18 19:31:47 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix casting across Smoke modules.
hunk ./src/clos.lisp 434
- (id (class-of object)) (id class)))
+ (id (class-of object))
+ (smoke-class-id (smoke-module-pointer (smoke (class-of object)))
+ (name-pointer class))))
hunk ./src/objects/class.lisp 33
+(defun name-pointer (class)
+ (mem-ref (foreign-slot-pointer (smoke-class-pointer class)
+ 'smoke-class 'name)
+ :pointer))
+
Wed Feb 17 18:05:35 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Remove underlinking of libclsmoke and add a darwin case to the library definitons.
Thanks to Elliott Slaughter
hunk ./src/libsmoke/CMakeLists.txt 11
+
+# FIXME look for smoke.h
+find_library(smokeqtcore_LIB smokeqtcore)
+if (smokeqtcore_LIB)
+ set(smokeqtcore_FOUND TRUE)
+endif (smokeqtcore_LIB)
+
+if (smokeqtcore_FOUND)
+ message(STATUS "Found smokeqtcore: ${smokeqtcore}")
+else (smokeqtcore_FOUND)
+ message(FATAL_ERROR "Could not find smokeqtcore")
+endif (smokeqtcore_FOUND)
+
+
hunk ./src/libsmoke/CMakeLists.txt 27
+target_link_libraries(clsmoke ${QT_LIBRARIES} ${smokeqtcore_LIB})
hunk ./src/libsmoke/CMakeLists.txt 39
-install(TARGETS clsmoke clsmokeutil
- LIBRARY DESTINATION lib)
+install(TARGETS clsmoke clsmokeutil DESTINATION lib)
hunk ./src/libsmoke/smoke.lisp 3
-;; Load the qt smoke binding to prevent undefined aliens.
hunk ./src/libsmoke/smoke.lisp 4
- (define-foreign-library libsmokeqtcore
- (:unix "libsmokeqtcore.so.3")
- (t (:default "libsmokeqtcore")))
hunk ./src/libsmoke/smoke.lisp 5
+ (:darwin "libclsmoke.dylib")
hunk ./src/libsmoke/smoke.lisp 9
+ (:darwin "libclsmokeutil.dylib")
hunk ./src/libsmoke/smoke.lisp 12
- (use-foreign-library libsmokeqtcore)
hunk ./src/libsmoke/smoke.lisp 14
-
hunk ./src/smoke.lisp 175
+ (:darwin ,(format nil "~(~A~).3.dylib" library))
Tue Feb 16 22:56:19 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Load libsmokeqtcore instead of qt in the default case of cffi:define-foreign-library.
hunk ./src/libsmoke/smoke.lisp 5
- (define-foreign-library libsmokeqt
+ (define-foreign-library libsmokeqtcore
hunk ./src/libsmoke/smoke.lisp 7
- (t (:default "libsmokeqt")))
+ (t (:default "libsmokeqtcore")))
hunk ./src/libsmoke/smoke.lisp 14
- (use-foreign-library libsmokeqt)
+ (use-foreign-library libsmokeqtcore)
Tue Feb 16 22:52:02 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix derived-p for classes that are external in every module.
hunk ./src/objects/class.lisp 110
- (handler-case (make-smoke-class (name class))
- (undefined-class () class))
+ (make-smoke-class (name class))
hunk ./src/objects/class.lisp 119
-;(defun smoke-subclassp (class base-class) TODO
hunk ./src/objects/class.lisp 121
- (values
- (derived-real-p (real-class class) (real-class base-class))
- T))
+ (handler-case (derived-real-p (real-class class) (real-class base-class))
+ ;; The class is external in every module => no derived.
+ (undefined-class () nil)))
Mon Feb 15 16:31:33 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Build a shared library not a module.
Fixes on build error on OS X as reported by Elliott Slaughter.
hunk ./src/libsmoke/CMakeLists.txt 12
-add_library(clsmoke MODULE ${SMOKE_C_SOURCES})
+add_library(clsmoke SHARED ${SMOKE_C_SOURCES})
hunk ./src/libsmoke/CMakeLists.txt 18
-add_library(clsmokeutil MODULE smoke_util.cpp)
+add_library(clsmokeutil SHARED smoke_util.cpp)
Mon Feb 8 18:14:54 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* sbcl-bundle requires posix & unix
hunk ./cl-smoke.smoke.asd 10
- #+sbcl :sb-posix)
+ #+(and sbcl unix) :sb-posix)
hunk ./cl-smoke.smoke.asd 48
- #+sbcl (:file "sbcl-bundle")
+ #+(and sbcl unix) (:file "sbcl-bundle")
Thu Feb 4 16:11:29 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Test building libclsmoke.
hunk ./test.lisp 2
+cmake ./ || exit 1
+make || exit 1
Wed Feb 3 17:20:56 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix compiling libclsmoke with asserts enabled.
smoke_get_class was not declared in this scope
Reported by:
Elliott Slaughter
hunk ./src/libsmoke/smoke.cpp 181
- Q_ASSERT(!smoke_get_class(smoke, class_index)->external);
- Q_ASSERT(!smoke_get_class(smoke_base, base_index)->external);
+ Q_ASSERT(!cl_smoke_get_class(smoke, class_index)->external);
+ Q_ASSERT(!cl_smoke_get_class(smoke_base, base_index)->external);
Wed Feb 3 07:44:09 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Add missing :sb-posix dependency.
hunk ./cl-smoke.smoke.asd 9
- (:cffi :closer-mop :alexandria :trivial-garbage :bordeaux-threads)
+ (:cffi :closer-mop :alexandria :trivial-garbage :bordeaux-threads
+ #+sbcl :sb-posix)
Sat Jan 30 15:40:08 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Do not warn on missing parent class.
hunk ./src/clos.lisp 201
- (if real-class
- (push (class-name real-class) class-symbols)
- (warn "The class ~A could not be found in any module."
- (name class))))
+ (when real-class
+ (push (class-name real-class) class-symbols)))
Tue Jan 26 17:26:09 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix for r1077826. Not instantiable parent classes are external. (QAbstractPrintDialog)
hunk ./src/clos.lisp 196
-(defun smoke-class-symbol (smoke-class)
- "Returns the Lisp class-name of SMOKE-CLASS:"
- (if (external-p smoke-class)
- (class-name (find-smoke-class smoke-class))
- (lispify (name smoke-class))))
+(defun smoke-class-symbols (classes)
+ (let ((class-symbols))
+ (dolist (class classes class-symbols)
+ (if (external-p class)
+ (let ((real-class (find-smoke-class class nil)))
+ (if real-class
+ (push (class-name real-class) class-symbols)
+ (warn "The class ~A could not be found in any module."
+ (name class))))
+ (push (lispify (name class)) class-symbols)))))
hunk ./src/clos.lisp 227
- (mapcar #'smoke-class-symbol
- (smoke-class-direct-superclasses class))
+ (smoke-class-symbols
+ (smoke-class-direct-superclasses class))
Mon Jan 25 19:47:00 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Check enum type on overload resolution
hunk ./src/overload-resolution.lisp 340
- (12 (object.typep 'enum)) ;; FIXME enum-type
+ (12 (and (object.typep 'enum) ;; FIXME enum-type using type
+ (smoke-type= type (enum-type object))))
Mon Jan 25 19:46:41 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* single-float conversion
hunk ./src/overload-resolution.lisp 366
+(defun coerce-single-float (number)
+ (float number 0f0))
+
hunk ./src/overload-resolution.lisp 380
+ (10 (when (object.typep 'real)
+ (make-match 'promotion 'coerce-single-float)))
Mon Jan 25 19:41:22 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Add :arg3 for make-instance SMOKE-CLASS.
hunk ./src/clos.lisp 478
+ (arg3 nil arg3p)
hunk ./src/clos.lisp 493
+ (arg3p (list arg0 arg1 arg2 arg3))
Sat Jan 23 20:45:41 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* class & type size (and some more exports)
hunk ./src/objects/class.lisp 33
+(defun class-size (smoke-class)
+ (class-slot-value smoke-class 'size))
+
hunk ./src/objects/class.lisp 62
+(defun copy-constructor-p (class)
+ (/= 0 (get-class-flag class :copy-constructor)))
+
hunk ./src/objects/stack.lisp 114
- (error "Do not know how to convert the type ~A to Lisp." type)))
+ (prog1 (foreign-slot-value stack-item 'smoke-stack-item 'voidp)
+ (cerror "Return the pointer"
+ "Do not know how to convert the type ~A to Lisp." type))))
hunk ./src/objects/type.lisp 142
+;; Return the cffi keyword for the type
+(defun type-foreign-keyword (smoke-type)
+ (intern (nsubstitute #\- #\ (nstring-upcase (name smoke-type)))
+ :keyword))
+
+(defun type-size (smoke-type)
+ (if (class-p smoke-type)
+ (class-size (get-class smoke-type))
+ (foreign-type-size (type-foreign-keyword smoke-type))))
+
hunk ./src/package.lisp 16
- (:export #:init
- #:get-smoke-variable-for-pointer
+ (:export #:call
+ #:c-integer
hunk ./src/package.lisp 19
- #:make-smoke-classes
- #:eval-startup
- [_$_]
- #:delete-object
- #:smoke-call
- #:call
-
- #:name
+ #:class-p
+ #:class-size
+ #:const-p
hunk ./src/package.lisp 23
- #:smoke-type=
+ #:name
+ #:pointer
+ #:pointer-p
+ #:size
+ #:smoke
+ #:stack-p
+ #:type-foreign-keyword
+ #:type-id
+ #:type-size
+ #:virtual-destructor-p
hunk ./src/package.lisp 34
+ #:convert-argument
hunk ./src/package.lisp 39
+ #:*to-lisp-translations*
+
hunk ./src/package.lisp 42
- #:make-cleanup-pointer
+ #:define-smoke-module
+
+ #:define-takes-ownership
+ #:delete-object
+ #:remove-object
+
+ #:eval-startup
+
+ #:get-smoke-variable-for-pointer
+ #:init
+ #:object-to-lisp
+
hunk ./src/package.lisp 55
+ #:make-cleanup-pointer
hunk ./src/package.lisp 57
- #:const-p
- #:pointer
- #:define-smoke-module
- #:define-takes-ownership
+ #:make-smoke-classes
+ #:make-smoke-type
+ #:no-applicable-cxx-method
+ #:smoke-call
+ #:upcast
+
+ #:smoke-standard-object
+ #:smoke-type
+ #:smoke-type=
hunk ./src/smoke-to-clos.lisp 169
- ;; FIXME when loading the Lisp image we no longer need to
- ;; call #'ensure-class, but the class-map needs still
+ ;; FIXME when loading the Lisp image we no longer need
+ ;; to call #'ensure-class, but the class-map needs still
Sun Jan 17 22:04:08 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix class-map image loading and use the new static smoke methods.
indClass() and isDerivedFrom() are now static (r1076132 and also in KDE 4.4).
hunk ./src/class-map.lisp 11
- (assert value ()
- "Unknown smoke module ~A ~A."
- smoke (smoke-get-module-name (smoke-module-pointer smoke)))
+ (assert value () "Unknown smoke module ~A." smoke)
hunk ./src/libsmoke/class.lisp 22
- (smoke :pointer)
hunk ./src/libsmoke/smoke.cpp 133
- * @param smoke the smoke module
hunk ./src/libsmoke/smoke.cpp 136
-cl_smoke_find_class(Smoke::ModuleIndex* c, void* smoke, const char* name)
+cl_smoke_find_class(Smoke::ModuleIndex* c, const char* name)
hunk ./src/libsmoke/smoke.cpp 138
- *c = get_smoke(smoke)->findClass(name);
+ *c = Smoke::findClass(name);
hunk ./src/libsmoke/smoke.cpp 184
- return get_smoke(smoke)->isDerivedFrom(get_smoke(smoke), class_index,
+ return Smoke::isDerivedFrom(get_smoke(smoke), class_index,
hunk ./src/objects/class.lisp 64
- ((smoke-name :initarg :smoke-name
- :initform nil
- :documentation "The name of the Smoke module"))
+ ()
hunk ./src/objects/class.lisp 66
- (format stream "No Smoke class named ~S in the Smoke module ~S."
- (cell-error-name condition)
- (slot-value condition 'smoke-name))))
+ (format stream "No Smoke class named ~S."
+ (cell-error-name condition))))
hunk ./src/objects/class.lisp 76
-(defun make-smoke-class (smoke name)
- "Returns the class named NAME of the smoke module SMOKE.
+(defun make-smoke-class (name)
+ "Returns the class named NAME.
hunk ./src/objects/class.lisp 81
- (smoke-find-class c (smoke-module-pointer smoke) name)
+ (smoke-find-class c name)
hunk ./src/objects/class.lisp 84
- (error (make-condition 'undefined-class :name name :smoke-name (smoke-get-module-name (smoke-module-pointer smoke))))
+ (error (make-condition 'undefined-class :name name))
hunk ./src/objects/class.lisp 104
- (handler-case (make-smoke-class (smoke class) (name class))
+ (handler-case (make-smoke-class (name class))
hunk ./src/objects/method.lisp 20
- (call-next-method)
+ (print-unreadable-object (smoke-method stream :type t)
+ (princ "no method" stream))
hunk ./src/objects/method.lisp 140
- (format nil "~A~:[~; static~]" (access method) (static-p method)))
+ (format nil "~:[~;virtual ~]~A~:[~; static~]" [_$_]
+ (virtual-p method) (access method) (static-p method)))
hunk ./src/objects/method.lisp 214
+(defun virtual-p (method)
+ "Returns T when METHOD is internal and NIL otherwise."
+ (/= 0 (get-method-flag method :virtual)))
+
hunk ./src/smoke-to-clos.lisp 168
+ (eval-startup (:compile-toplevel :load-toplevel :execute)
+ ;; FIXME when loading the Lisp image we no longer need to
+ ;; call #'ensure-class, but the class-map needs still
+ ;; to be populated by #'add-id-class-map and #'add-id;
+ ;; For now we ignore the negligible overhead.
+ (make-smoke-classes ,package ,smoke))
hunk ./src/smoke-to-clos.lisp 175
- (make-smoke-classes ,package ,smoke)
hunk ./src/smoke.lisp 55
-(defun static-call (smoke class-name method-name &rest args)
- (s-call (make-smoke-method-from-name (make-smoke-class smoke class-name)
- method-name)
- (null-pointer) args))
-
Sun Jan 10 18:31:42 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix overload resolution when a lisp smoke module is not loaded.
hunk ./cl-smoke.smoke.asd 57
-(defmethod operation-done-p ((o test-op) (c (eql (find-system :cl-smoke.smoke))))
- nil)
-
hunk ./src/objects/class.lisp 73
+(define-condition lisp-module-not-loaded (error)
+ ((class-name :initarg :class-name))
+ (:report (lambda (condition stream)
+ (format stream "The Lisp smoke module of the class ~A is not loaded."
+ (slot-value condition 'class-name)))))
+
hunk ./src/objects/class.lisp 93
- (make-instance 'smoke-class
- :id (foreign-slot-value c 'smoke-module-index 'index)
- :smoke (gethash (pointer-address (foreign-slot-value c 'smoke-module-index 'smoke)) *smoke-modules*))))
+ (let ((class (make-instance
+ 'smoke-class
+ :id (foreign-slot-value c 'smoke-module-index 'index)
+ :smoke (gethash (pointer-address (foreign-slot-value
+ c 'smoke-module-index
+ 'smoke))
+ *smoke-modules*))))
+ (unless (smoke class)
+ (error (make-condition 'lisp-module-not-loaded :class-name name)))
+ class)))
hunk ./src/overload-resolution.lisp 466
- (let ((to-class (find-smoke-class (get-class type) nil)))
- (when (and to-class
- (call-using-types find-best-viable-function2
- (if (using-typep)
- #'standard-conversion-sequence-using-types
- #'standard-conversion-sequence)
- (constructor-name (get-class type))
- (list object) to-class))
- (make-match 'user-conversion
- 'coerce-to-class
- to-class)))))
+ (handler-case
+ (let ((to-class (find-smoke-class (get-class type) nil)))
+ (when (and to-class
+ (call-using-types find-best-viable-function2
+ (if (using-typep)
+ #'standard-conversion-sequence-using-types
+ #'standard-conversion-sequence)
+ (constructor-name (get-class type))
+ (list object) to-class))
+ (make-match 'user-conversion
+ 'coerce-to-class
+ to-class)))
+ ;; When the correspoinding Lisp module is not loaded, we ignore
+ ;; the overload.
+ (lisp-module-not-loaded ()))))
Sun Jan 10 18:30:48 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Auto-recompile when the smoke module has changed.
hunk ./src/smoke-to-clos.lisp 90
- "Raises an error when the fasl of the DEFINE-METHOS was not compiled against
-the current smoke module."
- `(eval-when (:load-toplevel :execute)
- (unless (sizes= (,smoke)
- smoke-module-methods
- smoke-module-method-names
- smoke-module-method-maps
- smoke-module-classes
- smoke-module-types)
- (error "The smoke module ~A changed, you need to recompile the lisp file."
- (smoke-get-module-name (smoke-module-pointer ,smoke))))))
+ "Raises an error or tries to recompile when the fasl of the define-classes-and-gfs
+was not compiled against the current smoke module."
+ (with-unique-names (restart)
+ `(eval-when (:load-toplevel :execute)
+ (unless (sizes= (,smoke)
+ smoke-module-methods
+ smoke-module-method-names
+ smoke-module-method-maps
+ smoke-module-classes
+ smoke-module-types)
+ (let ((,restart (find-restart 'asdf:try-recompiling)))
+ (if ,restart
+ (invoke-restart ,restart)
+ (error "The smoke module ~A changed, you need to recompile the lisp file."
+ (smoke-get-module-name (smoke-module-pointer ,smoke)))))))))
Sun Jan 10 09:49:36 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Support modular smoke & cleanup.
move ./smoke.asd ./cl-smoke.smoke.asd
move ./src/smoke-c/csmokebinding.cpp ./src/smoke-c/smokebinding.cpp
move ./src/smoke-c/csmokebinding.h ./src/smoke-c/smokebinding.h
move ./src/smoke-c/smoke-c-util.cpp ./src/smoke-c/smoke_util.cpp
move ./src/smoke-c/smoke-c.cpp ./src/smoke-c/smoke.cpp
move ./src/smoke-c/smoke-c.lisp ./src/smoke-c/smoke.lisp
move ./src/smoke-c ./src/libsmoke
hunk ./cl-smoke.smoke.asd 1
-(defpackage smoke-system
- (:use :cl :asdf))
-
-(in-package smoke-system)
-
-(asdf:defsystem :smoke
- :name :smoke
+(defsystem :cl-smoke.smoke
+ :name :cl-smoke.smoke
hunk ./cl-smoke.smoke.asd 17
- (:file "smoke" :depends-on (:smoke-c :objects "clos"))
+ (:file "smoke" :depends-on (:libsmoke :objects "clos"))
hunk ./cl-smoke.smoke.asd 20
- (:file "bindings" :depends-on ("package"))
+ (:file "bindings" :depends-on ("package" :utils))
hunk ./cl-smoke.smoke.asd 22
- (:file "clos" :depends-on
- (:smoke-c "cxx-method" :objects "object-map" "class-map" "bindings"))
+ (:file "clos" :depends-on (:libsmoke "cxx-method" :objects
+ "object-map" "class-map" "bindings"))
hunk ./cl-smoke.smoke.asd 27
- :depends-on (:smoke-c :utils "bindings")
+ :depends-on (:libsmoke :utils "bindings")
hunk ./cl-smoke.smoke.asd 35
- (:module :smoke-c
+ (:module :libsmoke
hunk ./cl-smoke.smoke.asd 38
- ((:file "smoke-c") (:file "class" :depends-on ("smoke-c"))
+ ((:file "smoke")
+ (:file "class" :depends-on ("smoke"))
hunk ./cl-smoke.smoke.asd 57
-(defmethod asdf:perform ((operation test-op) (c (eql (find-system :smoke))))
- (operate 'asdf:load-op :qt)
- (operate 'asdf:test-op :qt))
+(defmethod operation-done-p ((o test-op) (c (eql (find-system :cl-smoke.smoke))))
+ nil)
+
+(defmethod perform ((operation test-op) (c (eql (find-system :cl-smoke.smoke))))
+ (operate 'asdf:load-op :cl-smoke.qt.tests)
+ (operate 'asdf:test-op :cl-smoke.qt.tests))
hunk ./src/CMakeLists.txt 1
-add_subdirectory(smoke-c)
+add_subdirectory(libsmoke)
hunk ./src/bindings.lisp 3
-(defvar *bindings* (make-hash-table)
- "The Smoke C++ binding classes to which virtual method calls are dispatched.")
-
-;; FIXME is this lock needed? (The user may not have to
-;; load additional modules while threads are running.
-(defvar *bindings-lock* (make-lock "bindings-lock"))
-
-(defun binding (smoke)
- "Returns the Smoke binding for the Smoke module SMOKE."
- (with-lock-held (*bindings-lock*)
- (multiple-value-bind (value present-p)
- (gethash (pointer-address smoke) *bindings*)
- (assert (eql t present-p)
- ()
- "No binding for ~A." smoke)
- value)))
-
-(defun (setf binding) (binding smoke)
- (with-lock-held (*bindings-lock*)
- (setf (gethash (pointer-address smoke) *bindings*)
- binding)))
-
hunk ./src/bindings.lisp 26
+(eval-on-save ()
+ (clrhash *smoke-modules*))
+
hunk ./src/clos.lisp 205
- (let ((*package* (find-package package)))
+ (let ((impl-package *package*)
+ (*package* (find-package package)))
hunk ./src/clos.lisp 210
- (unless (or (external-p class)
- (and (eq package :cl-smoke.qt)
- (string/= (smoke-get-module-name [_$_]
- (smoke-module-pointer smoke))
- "qt")
- (string= (name class) "QGlobalSpace")))
+ (unless (external-p class)
hunk ./src/clos.lisp 212
- (add-id class
- (closer-mop:ensure-class (lispify (name class))
- :direct-superclasses
- (mapcar #'smoke-class-symbol
- (smoke-class-direct-superclasses class))
- :id (id class)
- :smoke (smoke class)
- :metaclass 'smoke-standard-class))
- (export (lispify (name class))))))
+ (let ((class-name [_$_]
+ ;; There is a QGlobalSpace class per Smoke module.
+ ;; Put it in *package* and not PACKAGE to avoid
+ ;; clashes between multiple modules.
+ (if (string= "QGlobalSpace" (name class))
+ (lispify "QGlobalSpace" impl-package)
+ (lispify (name class)))))
+ (add-id class
+ (closer-mop:ensure-class class-name
+ :direct-superclasses
+ (mapcar #'smoke-class-symbol
+ (smoke-class-direct-superclasses class))
+ :id (id class)
+ :smoke (smoke class)
+ :metaclass 'smoke-standard-class))
+ (when (eql (symbol-package class-name) *package*)
+ (export class-name))))))
hunk ./src/libsmoke/CMakeLists.txt 11
-set(SMOKE_C_SOURCES smoke-c.cpp csmokebinding.cpp)
-add_library(smoke-c MODULE ${SMOKE_C_SOURCES})
-set_target_properties(smoke-c
+set(SMOKE_C_SOURCES smoke.cpp smokebinding.cpp)
+add_library(clsmoke MODULE ${SMOKE_C_SOURCES})
+set_target_properties(clsmoke
hunk ./src/libsmoke/CMakeLists.txt 18
-add_library(smoke-c-util MODULE smoke-c-util.cpp)
-set_target_properties(smoke-c-util
+add_library(clsmokeutil MODULE smoke_util.cpp)
+set_target_properties(clsmokeutil
hunk ./src/libsmoke/CMakeLists.txt 24
-install(TARGETS smoke-c smoke-c-util
+install(TARGETS clsmoke clsmokeutil
hunk ./src/libsmoke/cl_smoke.h 16
-/** @brief Common Lisp Smoke binding namespace. */
+/** @brief cl-smoke binding namespace. */
hunk ./src/libsmoke/class.lisp 20
-(defcfun smoke-find-class :void
+(defcfun (smoke-find-class "cl_smoke_find_class") :void
hunk ./src/libsmoke/class.lisp 25
-(defcfun smoke-class-id smoke-index
+(defcfun (smoke-class-id "cl_smoke_class_id") smoke-index
hunk ./src/libsmoke/class.lisp 29
-(defcfun smoke-get-class (:pointer smoke-class)
+(defcfun (smoke-get-class "cl_smoke_get_class") (:pointer smoke-class)
hunk ./src/libsmoke/class.lisp 33
-(defcfun smoke-is-derived-from :boolean
+(defcfun (smoke-is-derived-from "cl_smoke_is_derived_from") :boolean
hunk ./src/libsmoke/class.lisp 39
-(defcfun smoke-cast :pointer
+(defcfun (smoke-cast "cl_smoke_cast") :pointer
hunk ./src/libsmoke/method.lisp 37
-(defcfun smoke-find-method :void
+(defcfun (smoke-find-method "cl_smoke_find_method") :void
hunk ./src/libsmoke/smoke.cpp 1
-#include "csmokebinding.h"
hunk ./src/libsmoke/smoke.cpp 2
+#include "smokebinding.h"
hunk ./src/libsmoke/smoke.cpp 5
-
hunk ./src/libsmoke/smoke.cpp 22
-smoke_get_smoke(smoke_binding binding)
+cl_smoke_get_smoke(smoke_binding binding)
hunk ./src/libsmoke/smoke.cpp 37
-smoke_init(void* smoke, void* destruct, void* dispatch)
+cl_smoke_init(void* smoke, void* destruct, void* dispatch)
hunk ./src/libsmoke/smoke.cpp 48
-smoke_destruct(smoke_binding binding)
+cl_smoke_destruct(smoke_binding binding)
hunk ./src/libsmoke/smoke.cpp 60
-smoke_get_module_name(void* smoke)
+cl_smoke_get_module_name(void* smoke)
hunk ./src/libsmoke/smoke.cpp 137
-smoke_find_class(Smoke::ModuleIndex* c, void* smoke, const char* name)
+cl_smoke_find_class(Smoke::ModuleIndex* c, void* smoke, const char* name)
hunk ./src/libsmoke/smoke.cpp 149
-smoke_class_id(void* smoke, const char* name)
+cl_smoke_class_id(void* smoke, const char* name)
hunk ./src/libsmoke/smoke.cpp 164
-smoke_get_class(void* smoke, Smoke::Index class_index)
+cl_smoke_get_class(void* smoke, Smoke::Index class_index)
hunk ./src/libsmoke/smoke.cpp 179
-smoke_is_derived_from(void* smoke, Smoke::Index class_index, void* smoke_base, Smoke::Index base_index)
+cl_smoke_is_derived_from(void* smoke, Smoke::Index class_index, void* smoke_base,
+ Smoke::Index base_index)
hunk ./src/libsmoke/smoke.cpp 186
- get_smoke(smoke_base), base_index);
+ get_smoke(smoke_base), base_index);
hunk ./src/libsmoke/smoke.cpp 200
-smoke_find_method(Smoke::ModuleIndex* m, void* smoke,
+cl_smoke_find_method(Smoke::ModuleIndex* m, void* smoke,
hunk ./src/libsmoke/smoke.cpp 220
-smoke_find_type(void* smoke, const char* name)
+cl_smoke_find_type(void* smoke, const char* name)
hunk ./src/libsmoke/smoke.cpp 234
-smoke_cast(void* smoke, void* object, Smoke::Index from, Smoke::Index to)
+cl_smoke_cast(void* smoke, void* object, Smoke::Index from, Smoke::Index to)
hunk ./src/libsmoke/smoke.lisp 6
- (:unix "libsmokeqt.so.3")
+ (:unix "libsmokeqtcore.so.3")
hunk ./src/libsmoke/smoke.lisp 8
- (define-foreign-library libsmoke-c
- (:unix "libsmoke-c.so")
- (t (:default "libsmoke-c")))
- (define-foreign-library libsmoke-c-util
- (:unix "libsmoke-c-util.so")
- (t (:default "libsmoke-c-util")))
+ (define-foreign-library libclsmoke
+ (:unix "libclsmoke.so")
+ (t (:default "libclsmoke")))
+ (define-foreign-library libclsmokeutil
+ (:unix "libclsmokeutil.so")
+ (t (:default "libclsmokeutil")))
hunk ./src/libsmoke/smoke.lisp 15
- (use-foreign-library libsmoke-c))
+ (use-foreign-library libclsmoke))
hunk ./src/libsmoke/smoke.lisp 19
- (use-foreign-library libsmoke-c-util)
- (defcfun smoke-sizeof-bool :int)
+ (use-foreign-library libclsmokeutil)
+ (defcfun (smoke-sizeof-bool "cl_smoke_sizeof_bool") :int)
hunk ./src/libsmoke/smoke.lisp 23
- (load-foreign-library 'libsmoke-c-util)
+ (load-foreign-library 'libclsmokeutil)
hunk ./src/libsmoke/smoke.lisp 32
-;(close-foreign-library 'libsmoke-c-util)
+;(close-foreign-library 'libclsmokeutil)
hunk ./src/libsmoke/smoke.lisp 44
-(defcfun smoke-init smoke-binding
+(defcfun (smoke-init "cl_smoke_init") smoke-binding
hunk ./src/libsmoke/smoke.lisp 49
-(defcfun smoke-destruct :void
+(defcfun (smoke-destruct "cl_smoke_destruct") :void
hunk ./src/libsmoke/smoke.lisp 59
-(defcfun smoke-get-smoke :pointer
+(defcfun (smoke-get-smoke "cl_smoke_get_smoke") :pointer
hunk ./src/libsmoke/smoke.lisp 62
-(defcfun smoke-get-module-name :string
+(defcfun (smoke-get-module-name "cl_smoke_get_module_name") :string
hunk ./src/libsmoke/smoke_util.cpp 22
-smoke_sizeof_bool()
+cl_smoke_sizeof_bool()
hunk ./src/libsmoke/smokebinding.cpp 1
-#include "csmokebinding.h"
+#include "smokebinding.h"
hunk ./src/libsmoke/smokebinding.h 1
-#ifndef CSMOKEBINDING_H
-#define CSMOKEBINDING_H
+#ifndef SMOKEBINDING_H
+#define SMOKEBINDING_H
hunk ./src/libsmoke/smokebinding.h 39
-#endif // CSMOKEBINDING_H
+#endif // SMOKEBINDING_H
hunk ./src/libsmoke/type.lisp 18
-(defcfun smoke-find-type smoke-index
+(defcfun (smoke-find-type "cl_smoke_find_type") smoke-index
hunk ./src/object-map.lisp 41
+ (tg:gc :full t) ;; Try to get all #'smoke::make-auto-pointer
hunk ./src/object-map.lisp 43
- (warn "life object ~A" object)
+ (warn "life object ~A ~A" object (pointer object))
hunk ./src/smoke-to-clos.lisp 21
- `(define-constant ,symbol ;; a long not really an enum.
+ `(define-constant ,symbol ;; a long, not really an enum.
hunk ./src/smoke-to-clos.lisp 55
- (call-using-args (find-class (quote ,(lispify (name class) package)))
- ,method-name
- ,(if (< argument-count 0)
- 'args
- `(list ,@(make-lambda argument-count)))))
+ (call-using-args
+ (find-class (quote ,(lispify (name class) [_$_]
+ (if (string= (name class)
+ "QGlobalSpace")
+ *package* ;; See #'MAKE-SMOKE-CLASSES
+ package))))
+ ,method-name
+ ,(if (< argument-count 0)
+ 'args
+ `(list ,@(make-lambda argument-count)))))
hunk ./src/smoke-to-clos.lisp 116
- (when (enum-p method)
+ (when (and (enum-p method)
+ ;; qt.network has QIODevice::NotOpen(), but the
+ ;; class is external (workaround).
+ (not (external-p (get-class method))))
hunk ./src/smoke-to-clos.lisp 142
- (setf (gethash function-symbol function-symbols)
- (if methods (- (id method)) (id method)))))))
+ (unless (fboundp function-symbol) ;; do not overwrite
+ ;; existing functions e.g. qInstallMsgHandler of
+ ;; qt.core with that of qt.gui which causes a
+ ;; segfault when loading from an saved image.
+ (setf (gethash function-symbol function-symbols)
+ (if methods (- (id method)) (id method))))))))
hunk ./src/smoke-to-clos.lisp 164
- (eval-startup (:load-toplevel :execute)
- ;; eval on startup for class map.
- (make-smoke-classes ,package ,smoke))
hunk ./src/smoke-to-clos.lisp 165
+ (make-smoke-classes ,package ,smoke)
hunk ./src/smoke.lisp 1
-;;; Copyright (C) 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
+;;; Copyright (C) 2009, 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
hunk ./src/smoke.lisp 105
- (use-foreign-library libsmoke-c)
+ (use-foreign-library libclsmoke)
hunk ./src/smoke.lisp 108
- (setf (binding smoke) binding
- (smoke-module-pointer module) smoke
+ (setf (smoke-module-pointer module) smoke
hunk ./src/smoke.lisp 115
+ ;; Used by make-load-form for enums to reference the smoke module.
hunk ./src/smoke.lisp 148
- ;;FIXME speed this up, needed by (mb:document :smoke).
hunk ./test-bundle.sh 8
-MALLOC_CHECK_=3 sbcl --eval '(require :qt.tests)' \
+MALLOC_CHECK_=3 sbcl --eval '(require :cl-smoke.qt.tests)' \
hunk ./test.lisp 11
-sh ./test-bundle.sh || exit 2
+ sh ./test-bundle.sh || exit 2
hunk ./test.lisp 21
-(asdf:operate 'asdf:load-op :smoke)
-(asdf:operate 'asdf:test-op :smoke)
+(require :asdf)
+(asdf:operate 'asdf:load-op :cl-smoke.smoke)
+(asdf:operate 'asdf:test-op :cl-smoke.smoke)
changepref test
sh test.lisp
Sun Dec 13 13:43:58 CET 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Support ASDF instead of Mudballs.
addfile ./smoke.asd
hunk ./smoke.asd 1
+(defpackage smoke-system
+ (:use :cl :asdf))
+
+(in-package smoke-system)
+
+(asdf:defsystem :smoke
+ :name :smoke
+ :version (0 0 1)
+ :author "Tobias Rautenkranz"
+ :license "GPL with linking exception"
+ :description "Smoke bindings. Provides the base functionality to
+implement bindings using the various Smoke modules."
+ :depends-on
+ (:cffi :closer-mop :alexandria :trivial-garbage :bordeaux-threads)
+
+ :components
+ ((:module :src :components
+ ((:file "package")
+ (:file "using-type" :depends-on ("package"))
+ (:file "overload-resolution" :depends-on ("package" "smoke" "using-type"))
+ #+sbcl (:file "sb-optimize" :depends-on ("overload-resolution"))
+ (:file "smoke" :depends-on (:smoke-c :objects "clos"))
+ (:file "object-map" :depends-on (:objects :utils))
+ (:file "class-map" :depends-on ("package"))
+ (:file "bindings" :depends-on ("package"))
+ (:file "cxx-method" :depends-on ("package"))
+ (:file "clos" :depends-on
+ (:smoke-c "cxx-method" :objects "object-map" "class-map" "bindings"))
+ (:file "smoke-to-clos" :depends-on ("clos" "overload-resolution"))
+ (:module :objects
+ :serial t
+ :depends-on (:smoke-c :utils "bindings")
+ :components
+ ((:file "object") (:file "enum" :depends-on ("object"))
+ (:file "type" :depends-on ("enum"))
+ (:file "method" :depends-on ("type"))
+ (:file "class" :depends-on ("method"))
+ (:file "instance" :depends-on ("class"))
+ (:file "stack" :depends-on ("instance"))))
+ (:module :smoke-c
+ :depends-on ("package")
+ :components
+ ((:file "smoke-c") (:file "class" :depends-on ("smoke-c"))
+ (:file "stack" :depends-on ("class"))
+ (:file "method" :depends-on ("stack"))
+ (:file "type" :depends-on ("method"))))
+ (:module :utils
+ :depends-on ("package")
+ :components
+ ((:file "get-value")
+ #+sbcl (:file "sbcl-bundle")
+ (:module :image :components
+ ((:file "image" :depends-on (:impl))
+ (:module :impl
+ :components
+ (#+sbcl (:file "sbcl")
+ #+openmcl (:file "ccl")
+ #+(not (or sbcl openmcl))
+ (:file "not-implemented")))))))))))
+
+(defmethod asdf:perform ((operation test-op) (c (eql (find-system :smoke))))
+ (operate 'asdf:load-op :qt)
+ (operate 'asdf:test-op :qt))
hunk ./smoke.mbd 1
-;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
-
-;;; Allow this file to compile even when sysdef.cmake is not loaded.
-;;; You can not add a (MB:LOAD :SYSDEF.CMAKE) on top since when Mudballs
-;;; loads this file it might not know yet about :SYSDEF.CMAKE.
-(defpackage :sysdef.cmake
- (:use :cl :sysdef)
- (:export :cmake-file :cmake-library))
-(in-package :sysdef.cmake)
-
-(defclass sysdef.cmake:cmake-file (source-file)
- ()
- (:default-initargs :type "txt"))
-
-(defclass sysdef.cmake:cmake-library (component)
- ((package :initarg :package)))
-;;; end SYDDEF.CMAKE
-
-(in-package :sysdef-user)
-(eval-when (:compile-toplevel :load-toplevel :execute)
- (use-package :sysdef.cmake))
-
-(define-system :smoke ()
- (:version 0 0 1)
- (:documentation "Smoke bindings. Provides the base functionality to
-implement bindings using the various Smoke modules.")
- (:author "Tobias Rautenkranz")
- (:license "GPL with linking exception")
- (:components
- ("CMakeLists" cmake-file)
- (:src module
- (:needs "CMakeLists")
- (:components
- "package"
- ("using-type" (:needs "package"))
- ("overload-resolution" (:needs "package" "smoke" "using-type"))
- ("sb-optimize" (:for :sbcl) (:needs "overload-resolution"))
- ("smoke" (:needs "smoke-c" "objects" "clos"))
- ("object-map" (:needs "objects" :utils))
- ("class-map" (:needs "package"))
- ("bindings" (:needs "package"))
- ("cxx-method" (:needs "package"))
- ("clos" (:needs "smoke-c" "cxx-method" "objects" "object-map" "class-map" "bindings"))
- ("smoke-to-clos" (:needs "clos" "overload-resolution"))
- (:objects module
- (:needs "smoke-c" "utils" "bindings")
- (:serial t)
- (:components "object" "enum" "type" "method" "class"
- "instance" "stack"))
- (:smoke-c module
- (:needs "package")
- (:components ("libsmoke-c" cmake-library)
- ("libsmoke-c-util" cmake-library)
-
- ("smoke-c" (:needs "libsmoke-c"
- "libsmoke-c-util"))
- ("class" (:needs "smoke-c"))
- ("stack" (:needs "class"))
- ("method" (:needs "stack"))
- ("type" (:needs "method"))))
-
- (:utils module
- (:needs "package")
- (:requires (:sb-posix (:for :sbcl)))
- (:components
- "get-value"
- ("sbcl-bundle" (:for :sbcl))
- (:image module
- (:components [_$_]
- ("image" (:needs "impl"))
- (:impl module
- (:components
- ("sbcl" (:for :sbcl))
- ("ccl" (:for :openmcl))
- ("not-implemented" (:for (:not
- (:or :sbcl :openmcl)))))))))))))
- (:needs :sysdef.cmake :cffi :closer-mop
- :alexandria :trivial-garbage :bordeaux-threads))
rmfile ./smoke.mbd
hunk ./src/smoke-c/smoke-c.lisp 8
- #-mudballs
hunk ./src/smoke-c/smoke-c.lisp 11
- #-mudballs
hunk ./test-bundle.sh 8
-MALLOC_CHECK_=3 sbcl --eval '(mb:load :qt.tests)' \
+MALLOC_CHECK_=3 sbcl --eval '(require :qt.tests)' \
hunk ./test.lisp 18
-# do not use --script to allow loading mudballs with ${HOME}/.sbclrc
hunk ./test.lisp 21
-
-(in-package :sysdef-user)
-
-(defun load-sysdef (pathname system)
- (load pathname)
- (setf (mb.sysdef::pathname-of (find-system system)) pathname))
-
-(defun load-sysdef-file (system-name)
- "Loads a mbd file in the current directory."
- (load-sysdef (make-pathname :defaults *default-pathname-defaults*
- :name (string-downcase system-name)
- :type "mbd")
- system-name))
-
-(load-sysdef-file :smoke)
-;(mb:load :FiveAm)
-;(setf 5am:*debug-on-failure* t)
-;(setf 5am:*debug-on-error* t)
-(mb:test :smoke)
+(asdf:operate 'asdf:load-op :smoke)
+(asdf:operate 'asdf:test-op :smoke)
changepref test
sh ./test.lisp
Sun Dec 13 11:17:08 CET 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Update to the new Smoke ABI (v.3)
hunk ./src/objects/method.lisp 184
+(defun attribute-p (method)
+ "Returns T when METHOD accesses C++ member/static variables."
+ (/= 0 (get-method-flag method :attribute)))
+
+(defun property-p (method)
+ "Returns T when METHOD accesses a Q_PROPERTY."
+ (/= 0 (get-method-flag method :property)))
+
hunk ./src/smoke-c/class.lisp 17
- (flags :unsigned-short))
+ (flags :unsigned-short)
+ (size :unsigned-int))
hunk ./src/smoke-c/method.lisp 12
- (:protected #x80))
+ (:protected #x80)
+ (:attribute #x100)
+ (:property #x200)
+ (:virtual #x400)
+ (:purevirtual #x800)
+ (:signal #x1000)
+ (:slot #x2000))
hunk ./src/smoke-c/method.lisp 26
- (flags :unsigned-char)
+ (flags :unsigned-short)
hunk ./src/smoke-c/smoke-c.lisp 6
- (:unix "libsmokeqt.so.2")
+ (:unix "libsmokeqt.so.3")
hunk ./src/smoke-c/smoke-c.lisp 54
+;; Smoke::ModuleIndex is a POD-struct.
+;; Thus we can treat it as a C struct.
hunk ./src/smoke.lisp 181
- (:unix ,(format nil "~(~A~).so.2.0" library))
+ (:unix ,(format nil "~(~A~).so.3" library))
hunk ./src/smoke.lisp 189
- (defcfun (,init-function ,(format nil "_Z~A~Av"
- (length function-name)
- function-name)
- :library ,library)
+ (defcfun (,init-function ,function-name :library ,library)
hunk ./test-bundle.sh 8
-sbcl --eval '(mb:load :qt.tests)' \
+MALLOC_CHECK_=3 sbcl --eval '(mb:load :qt.tests)' \
hunk ./test-bundle.sh 12
-echo "(progn (5am:run!) (quit))" | ./qt.test.run [_$_]
+echo "(progn (in-package :qt.tests) (5am:run!) (quit))" | MALLOC_CHECK_=3 ./qt.test.run [_$_]
Fri Nov 6 20:27:56 CET 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Explicitly use old ABI (pre r1045709)
hunk ./src/smoke.lisp 181
- (:unix ,(format nil "~(~A~).so.2" library))
+ (:unix ,(format nil "~(~A~).so.2.0" library))
Wed Sep 9 21:25:37 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Template types are no longer t_class.
hunk ./src/objects/stack.lisp 108
- ((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)))
+ (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)))
hunk ./src/overload-resolution.lisp 341
- (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)))))))
+ (13 (and (object.typep 'smoke-standard-object)
+ (smoke-type= (get-class type) (object.type-of))))))
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.
hunk ./src/objects/stack.lisp 108
- (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)))
hunk ./src/objects/type.lisp 107
- (/= -1 (type-slot-value type 'class))))
+ (not (zerop (type-slot-value type 'class)))))
hunk ./src/overload-resolution.lisp 341
- (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)))))))
hunk ./src/overload-resolution.lisp 510
- (declare (optimize (speed 3)))
+ (declare (optimize (speed 3))
+ (type (or smoke-standard-class smoke-standard-object)
+ object-or-class))
hunk ./src/smoke-to-clos.lisp 7
- (if (string= (name (get-class method))
- "Qt")
+ (if (or (string= (name (get-class method))
+ "Qt")
+ (string= (name (get-class method))
+ "QGlobalSpace"))
Wed Sep 2 13:49:34 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Various fixes:
* Allow user conversions for return values
* fix destruction of objects with multiple C++ superclasses
* Fix list to QList conversion dispatch
hunk ./src/clos.lisp 270
+ (when (typep object 'smoke-multi-superclass-mixin)
+ (dolist (extra-object (extra-objects object))
+ (unless (null-pointer-p (pointer extra-object))
+ (remove-object (pointer extra-object))
+ (delete-object extra-object))))
hunk ./src/clos.lisp 297
-(defun convert-argument (argument type &optional (user t))
- "Returns ARGUMENT converted to TYPE. If USER is true, user defined
-conversion sequences are considered."
- (let ((rank (get-conversion-sequence argument type user)))
- (if (null rank)
- (error "Can not convert the argument ~S to ~A."
- argument (name type))
- (funcall (conversion-function-name rank)
- argument))))
+(defun convert-argument (argument type &optional disown)
+ "Returns ARGUMENT converted to TYPE and removes the ownership when
+it is passed on the stack."
+ (flet ((disown (object)
+ (remove-finalizer object)
+ (when (typep object 'smoke-standard-object)
+ (remove-object (pointer object)))))
+ (let ((rank (get-conversion-sequence argument type nil)))
+ (if (null rank)
+ (let ((rank (get-conversion-sequence argument type t)))
+ (if (null rank)
+ (error "Can not convert the argument ~S to ~A."
+ argument (name type))
+ (let ((ret (funcall (conversion-function-name rank)
+ argument)))
+ (when (and disown (stack-p type))
+ (disown ret))
+ ret)))
+ (prog1 (funcall (conversion-function-name rank) argument)
+ (when (and disown (stack-p type))
+ (disown argument)))))))
hunk ./src/clos.lisp 323
- ;; FIXME support user conversions.
- ;;
- ;; We need to determine which of value and converted-value is
- ;; passed on the stack. E.g. converted-value can be something
- ;; like (cxx:operator-variant value).
- (let ((converted-value (convert-argument value type nil)))
- (push-smoke-stack stack converted-value (type-id type))
- (when (stack-p type) ;; Pass by value => smoke deletes the object.
- (remove-finalizer converted-value)
- (when (typep value 'smoke-standard-object)
- (remove-object (pointer value))))))))
- ; (transfer-ownership-to value object)))))))
+ (let ((converted-value (convert-argument value type t)))
+ (push-smoke-stack stack converted-value (type-id type))))))
hunk ./src/object-map.lisp 115
- (assert (not (has-pointer-p (pointer object))) ()
- "There exists already a object ~A for the pointer of ~A."
- (get-object (pointer object)) object)
+ (when (has-pointer-p (pointer object))
+ (cerror "Overwrite the old object."
+ "There exists already a object ~A for the pointer of ~A."
+ (get-object (pointer object)) object))
hunk ./src/overload-resolution.lisp 305
- #'(lambda (type)
- (and (subtypep type ',lisp-type)
+ #'(lambda (type type-p)
+ (and (if type-p
+ (subtypep type ',lisp-type)
+ (typep type ',lisp-type))
hunk ./src/overload-resolution.lisp 328
- (funcall test (object.type-of))))
+ (funcall test object (using-typep))))
Tue Sep 1 13:44:21 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix overload resolution using types and test caching the overload resolution.
hunk ./src/overload-resolution.lisp 143
- (function-name nil :type (or symbol function) :read-only t)
+ (function-name nil :type (or symbol list function) :read-only t)
hunk ./src/overload-resolution.lisp 211
-(defmacro make-match (type &optional (name ''identity)
- (argument nil)
+(defmacro make-match (type &optional (name ''identity) (argument nil)
hunk ./src/overload-resolution.lisp 214
- :function-name ,(conversion-function name argument)
- ,@args))
+ :function-name ,(conversion-function name argument)
+ ,@args))
hunk ./src/overload-resolution.lisp 501
- [_$_]
+
+
hunk ./src/sb-optimize.lisp 94
+
+;;; cache ==================================================================
+;;;
+;;; we could replace the call to #'find-best-viable-function in
+;;; #'call-using-args with a call to
+;;; #'find-best-viable-function-cached, but it is only doubles speed.
+
+(sb-int:defun-cached (find-best-viable-function-using-types-cached
+ :hash-function (lambda (name arguments
+ class const-p)
+ (declare (string name)
+ (list arguments)
+ (class class)
+ (boolean const-p))
+ (logand [_$_]
+ (logxor
+ (sxhash name)
+ (sxhash arguments)
+ (sxhash class)
+ (sxhash const-p))
+ #x1FF))
+ :hash-bits 9)
+ ((name equal) (arguments equal) (class eq) (const-p eq))
+ (declare (optimize (speed 3))
+ (inline find-best-viable-function-using-types))
+ (multiple-value-bind (method conversion-sequence)
+ (find-best-viable-function-using-types name arguments class const-p)
+ (list method (mapcar #'(lambda (s)
+ (if (symbolp s)
+ (fdefinition s)
+ #'(lambda (x)
+ (funcall (fdefinition (first s))
+ x
+ (second s)))))
+ conversion-sequence))))
+ [_$_]
+(declaim (inline find-best-viable-function-cached))
+(defun find-best-viable-function-cached (name arguments class const-p)
+ (declare (optimize (speed 3)))
+ (catch 'unspecific-type
+ (return-from find-best-viable-function-cached
+ (values-list
+ (find-best-viable-function-using-types-cached
+ name
+ (mapcar #'(lambda (o) (class-of o)) arguments)
+ class
+ const-p))))
+ (find-best-viable-function name arguments class const-p))
+
hunk ./src/using-type.lisp 16
- ,@body))
+ ,@body))
Sun Aug 30 16:12:44 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Allow deriving from multiple C++ classes.
hunk ./src/clos.lisp 124
+(defclass smoke-multi-superclass-mixin ()
+ ((extra-objects :reader extra-objects
+ :initarg :extra-objects)))
+
hunk ./src/clos.lisp 154
- &allow-other-keys)
+ direct-default-initargs &allow-other-keys)
hunk ./src/clos.lisp 157
- "No superclass sup-lied for class ~A" class)
- (let ((superclass (first direct-superclasses)))
- (assert (subtypep (class-of superclass) (find-class 'smoke-standard-class))
+ "No superclass supplied for class ~A" class)
+ (let ((superclass (first direct-superclasses))
+ (extra-superclasses (remove-if-not #'(lambda (class)
+ (typep class 'smoke-standard-class))
+ (rest direct-superclasses))))
+ (assert (typep superclass 'smoke-standard-class)
hunk ./src/clos.lisp 164
- "The first superclass must be an subclass of an smoke class.")
+ "The first superclass ~A must be an subclass of an Smoke class."
+ class)
hunk ./src/clos.lisp 168
- "The class ~A has a non virtual destructor." superclass)
+ "The superclass ~A of ~A has a non virtual destructor."
+ superclass class)
+ (when extra-superclasses
+ (dolist (superclass extra-superclasses)
+ (unless (virtual-destructor-p superclass)
+ (cerror "Continue anyway"
+ "The superclass ~A of ~A has a non virtual destructor."
+ superclass class)))
+ (setf direct-superclasses
+ (append direct-superclasses
+ (list (find-class 'smoke-multi-superclass-mixin))))
+ (push `(:extra-objects ,extra-superclasses ,#'(lambda ()
+ extra-superclasses))
+ direct-default-initargs))
hunk ./src/clos.lisp 187
+ :direct-default-initargs direct-default-initargs
hunk ./src/clos.lisp 202
-
hunk ./src/clos.lisp 324
-;; Receive virutal function calls.
+;; Receive virtual function calls.
hunk ./src/clos.lisp 410
-(defun cast (object class)
- "Returns a pointer of type CLASS to the C++ object of OBJECT."
+(defgeneric cast (object class)
hunk ./src/clos.lisp 412
- (assert (derived-p (class-of object) class)
- ()
- "Can not cast object ~A of class ~A to class ~A."
- object (name (class-of object)) (name class))
- (smoke-cast (smoke-module-pointer (smoke (class-of object))) (pointer object)
- (id (class-of object)) (id class)))
-
+ (:documentation "Returns a pointer of type CLASS to the C++ object of OBJECT.")
+ (:method (object class)
+ (declare (optimize (speed 3)))
+ (assert (derived-p (class-of object) class)
+ ()
+ "Can not cast object ~A of class ~A to class ~A."
+ object (name (class-of object)) (name class))
+ (smoke-cast (smoke-module-pointer (smoke (class-of object))) (pointer object)
+ (id (class-of object)) (id class)))
+ (:method ((object smoke-multi-superclass-mixin) class)
+ (if (derived-p (class-of object) class)
+ (call-next-method)
+ (let ((extra-object (find-if #'(lambda (o)
+ (derived-p (class-of o) class))
+ (extra-objects object))))
+ (assert extra-object
+ ()
+ "Can not cast object ~A to class ~A."
+ object (name class))
+ (cast extra-object class)))))
hunk ./src/clos.lisp 449
-(defun call-constructor (object arguments)
- (if (null arguments)
- (let ((method (find-smoke-method (class-of object)
- (constructor-name (class-of object)))))
- (assert (valid-p method)
- (method)
- "No constructor for ~A." object)
- (pointer-call method (null-pointer)))
- (multiple-value-bind (method sequence)
- (find-best-viable-function (constructor-name (class-of object))
- arguments
- (class-of object))
- (when (null method)
- (error "No constructor for object ~A with
-the arguments ~S." object arguments))
- (pointer-call method (null-pointer)
- (mapcar #'(lambda (conversion argument)
- (funcall conversion argument))
- sequence arguments)))))
+(defun call-constructor (class arguments)
+ (multiple-value-bind (method sequence)
+ (find-best-viable-function (constructor-name class)
+ arguments
+ class)
+ (when (null method)
+ (error "No constructor for class ~A with
+the arguments ~S." class arguments))
+ (pointer-call method (null-pointer)
+ (mapcar #'(lambda (conversion argument)
+ (funcall conversion argument))
+ sequence arguments))))
hunk ./src/clos.lisp 479
- (call-constructor object [_$_]
+ (call-constructor (class-of object)
hunk ./src/clos.lisp 484
- (setf (slot-value object 'pointer) (call-constructor object args)))
+ (setf (slot-value object 'pointer)
+ (call-constructor (class-of object) args)))
hunk ./src/clos.lisp 490
+(defun construct-extra-objects (object extra-objects)
+ (loop for class in extra-objects
+ collect (let ((extra-object (make-instance (first extra-objects)
+ :pointer (call-constructor (first extra-objects)
+ nil))))
+ (set-binding extra-object)
+ (setf (get-object (pointer extra-object)) object)
+ extra-object)))
+ [_$_]
+(defmethod initialize-instance :after ((object smoke-multi-superclass-mixin) [_$_]
+ &key args)
+ (setf (slot-value object 'extra-objects)
+ (construct-extra-objects object (extra-objects object))))
+
+(defmethod make-finalize ((object smoke-multi-superclass-mixin))
+ (let ((pointer (pointer object))
+ (extra-objects (extra-objects object))
+ (class (class-of object)))
+ #'(lambda ()
+ (declare (optimize (speed 3)))
+ (handler-case (progn
+ (delete-pointer pointer class)
+ (dolist (object extra-objects)
+ (delete-object object)))
+ (error (condition)
+ (report-finalize-error condition 't (name class) pointer))))))
hunk ./src/clos.lisp 531
- (cerror "ignore" "~A has already been added to ~A."
+ (cerror "Ignore" "~A has already been added to ~A."
hunk ./src/object-map.lisp 95
+ ;; #'remove-object is called in the destructed callback. This
+ ;; happens even for objects without an virtual destructor.
hunk ./src/overload-resolution.lisp 121
-(defun all-smoke-superclasses (class)
- "Returns a list of all super-classes of CLASS and CLASS itself."
- (declare (optimize (speed 3)))
- (let ((classes (list class)))
- (dolist (class (closer-mop:class-direct-superclasses class) classes)
- (when (typep class 'smoke-standard-class)
- (setf classes (append (all-smoke-superclasses class) classes))))))
- [_$_]
hunk ./test.lisp 2
+echo \
+"################
+## Testing sbcl
+################"
hunk ./test.lisp 7
+echo \
+"###############
+## Testing sbcl image
+################"
hunk ./test.lisp 12
+echo \
+"###############
+## Testing ccl [_$_]
+################"
Sun Aug 30 15:51:40 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Make integer constants return an integer instead of an enum (e,g.: qt:graphics-item.+user-type+).
hunk ./src/smoke-to-clos.lisp 11
- package)
+ package)
hunk ./src/smoke-to-clos.lisp 16
- package))))
+ package))))
hunk ./src/smoke-to-clos.lisp 18
- `(define-constant ,symbol
- (make-instance 'enum
- :value ,(enum-call method)
- :type (make-instance 'smoke-type
- :id ,(id (return-type method))
- :smoke ,smoke))
- :test #'enum=)
+ (if (= 8 (type-id (return-type method)))
+ `(define-constant ,symbol ;; a long not really an enum.
+ ,(enum-call method))
+ `(define-constant ,symbol
+ (make-instance 'enum
+ :value ,(enum-call method)
+ :type (make-instance 'smoke-type
+ :id ,(id (return-type method))
+ :smoke ,smoke))
+ :test #'enum=))
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.
hunk ./src/bindings.lisp 48
+(defmethod print-object ((smoke-module smoke-module) stream)
+ (if (null-pointer-p (smoke-module-pointer smoke-module))
+ (call-next-method)
+ (print-unreadable-object (smoke-module stream :type t :identity t)
+ (princ (smoke-get-module-name (smoke-module-pointer smoke-module))
+ stream))))
+
hunk ./src/class-map.lisp 29
-(defun find-smoke-class (class)
+(defun find-smoke-class (class &optional (error-p t))
hunk ./src/class-map.lisp 31
- (let* ((class (real-class class))
- (ret (gethash (id class) (id-class-map (smoke class)))))
- (assert (not (null ret))
- ()
- "The class ~A was not found." (name class))
+ (let* ((class (handler-case (real-class class)
+ (undefined-class (e) (when error-p (error e)))))
+ (ret (when class (gethash (id class) (id-class-map (smoke class))))))
+ (when error-p
+ (assert (not (null ret))
+ ()
+ "The class ~A was not found." (name class)))
hunk ./src/clos.lisp 111
+ (when (const-p object)
+ (princ "CONST " stream))
hunk ./src/clos.lisp 188
- (unless (external-p class)
- (add-id class
- (closer-mop:ensure-class (lispify (name class))
- :direct-superclasses
- (mapcar #'smoke-class-symbol
- (smoke-class-direct-superclasses class))
- :id (id class)
- :smoke (smoke class)
- :metaclass 'smoke-standard-class))
- (export (lispify (name class)))))
+ (unless (or (external-p class)
+ (and (eq package :cl-smoke.qt)
+ (string/= (smoke-get-module-name [_$_]
+ (smoke-module-pointer smoke))
+ "qt")
+ (string= (name class) "QGlobalSpace")))
+ (with-simple-restart (skip "Skip generating class ~A" (name class)) [_$_]
+ (add-id class
+ (closer-mop:ensure-class (lispify (name class))
+ :direct-superclasses
+ (mapcar #'smoke-class-symbol
+ (smoke-class-direct-superclasses class))
+ :id (id class)
+ :smoke (smoke class)
+ :metaclass 'smoke-standard-class))
+ (export (lispify (name class))))))
hunk ./src/clos.lisp 267
- (push (argument-to-lisp (mem-ref stack 'smoke-stack-item)
+ (cons (argument-to-lisp (mem-ref stack 'smoke-stack-item)
hunk ./src/clos.lisp 467
- (let ((ret (make-instance class :pointer pointer)))
+ (let ((ret (make-instance class :pointer pointer
+ :const-p (const-p type))))
hunk ./src/objects/class.lisp 94
- (make-smoke-class (smoke class) (name class))
+ (handler-case (make-smoke-class (smoke class) (name class))
+ (undefined-class () class))
hunk ./src/objects/enum.lisp 47
- (let ((type (enum-type (eval (first (first cases))))))
+ (flet ((first-key (keys)
+ (if (listp keys)
+ (first keys)
+ keys)))
+ (let ((type (enum-type (eval (first-key (first (first cases)))))))
hunk ./src/objects/enum.lisp 53
- (check-enum-type (eval (first case))
+ (check-enum-type (eval (first-key (first case)))
hunk ./src/objects/enum.lisp 56
- ; (check-enum-type (enum-type ,keyform)
- ; (enum-type ,(first (first cases))))
+ ;; (check-enum-type (enum-type ,keyform)
+ ;; (enum-type ,(first (first cases))))
hunk ./src/objects/enum.lisp 60
- collect `(,(value (eval (first case)))
- ,@(rest case))))))
+ collect `(,(if (listp (first case))
+ (mapcar #'(lambda (c)
+ (print c)
+ (value (eval c)))
+ (first case))
+ (value (eval (first case))))
+ ,@(rest case)))))))
hunk ./src/objects/stack.lisp 36
- [_$_]
hunk ./src/objects/stack.lisp 42
+ (const-p :reader const-p
+ :initarg :const-p
+ :initform nil
+ :documentation "Returns true when the object is const and nil otherwise.")
hunk ./src/objects/stack.lisp 102
+(defvar *to-lisp-translations* (make-hash-table :test 'equal))
+
hunk ./src/objects/stack.lisp 166
-(defvar *to-lisp-translations* (make-hash-table :test 'equal))
hunk ./src/objects/type.lisp 61
- (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))))
hunk ./src/objects/type.lisp 122
- (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)))
hunk ./src/overload-resolution.lisp 3
+;;;
+;;; We handle only the most common cases. Stuff like virtual inheritance
+;;; that is not needed is not implemented.
hunk ./src/overload-resolution.lisp 81
-(defmacro push-candidate-method (index name argument-count class methods)
+(defmacro push-candidate-method (index name argument-count class methods
+ const-p)
hunk ./src/overload-resolution.lisp 112
- (incf ,ambig-index)
- (push (make-smoke-method :smoke ,smoke
- :id ,i)
- ,methods)))
- (push ,method ,methods))) [_$_]
+ (incf ,ambig-index)
+ (let ((,method (make-smoke-method :smoke ,smoke
+ :id ,i)))
+ (unless (and ,const-p (not (const-p ,method)))
+ (push ,method ,methods)))))
+ (unless (and ,const-p (not (const-p ,method)))
+ (push ,method ,methods))))
hunk ./src/overload-resolution.lisp 129
-(defun viable-functions (name argument-count class)
- "Returns a list of methods named NAME that take ARGUMENT-COUNT methods."
- ;; 13.3.2
- ;;
- ;; FIXME make a lazy map-viable-functions to allow returning early,
- ;; when an exact match is found.
+(defun viable-functions (name argument-count class &optional const-p)
hunk ./src/overload-resolution.lisp 133
- (dolist (class (all-smoke-superclasses class))
- (let ((smoke (smoke class)))
- (let ((start-index (find-method-for-class name class)))
- (declare (type smoke-index start-index))
- (when (>= start-index 0)
- (loop for index from start-index downto 1
- while (push-candidate-method index name argument-count class
- methods))
- (loop for index from (1+ start-index)
- to (the smoke-index (smoke-array-length
- (smoke-module-method-maps smoke)))
- while (push-candidate-method index name argument-count class
- methods))))))
+ (let ((smoke (smoke class)))
+ (let ((start-index (find-method-for-class name class)))
+ (declare (type smoke-index start-index))
+ (when (>= start-index 0)
+ (loop for index from start-index downto 1
+ while (push-candidate-method index name argument-count class
+ methods const-p))
+ (loop for index from (1+ start-index)
+ to (the smoke-index (smoke-array-length
+ (smoke-module-method-maps smoke)))
+ while (push-candidate-method index name argument-count class
+ methods const-p)))))
hunk ./src/overload-resolution.lisp 168
-(defgeneric conversion< (conversion1 conversion2)
- (:documentation
- "Returns true when CONVERSION1 is better than CONVERSION2.")
+(defgeneric conversion<= (conversion1 conversion2)
hunk ./src/overload-resolution.lisp 173
- (or (null conversion2)
- (< (the fixnum (conversion-rank conversion1))
- (the fixnum (conversion-rank conversion2)))))
+ (and (not (null conversion1))
+ (or (null conversion2)
+ (<= (the fixnum (conversion-rank conversion1))
+ (the fixnum (conversion-rank conversion2))))))
hunk ./src/overload-resolution.lisp 192
- (:documentation
- "Returns true when the standard conversion sequence CONVERSION1
- is indistinguishable from CONVERSION2.")
hunk ./src/overload-resolution.lisp 193
- (= (conversion-rank conversion1) (conversion-rank conversion2)))
+ (and (conversion<= conversion1 conversion2)
+ (conversion<= conversion2 conversion1)))
hunk ./src/overload-resolution.lisp 202
- (if (conversion< conversion1 conversion2)
+ (if (conversion<= conversion1 conversion2)
hunk ./src/overload-resolution.lisp 241
- (let ((max-rank)
- (conversions))
- (loop for type in (arguments method)
- for class in classes do
- (let ((rank (call-using-type get-conversion-sequence class type user)))
- (when (null rank)
- (setf max-rank nil)
- (return nil))
- (setf max-rank (max-conversion rank max-rank))
- (push (conversion-function-name rank) conversions)))
- (values max-rank (reverse conversions))))
+ (if (null classes)
+ (values (make-match 'exact-match) nil)
+ (let ((max-rank)
+ (conversions))
+ (loop for type in (arguments method)
+ for class in classes do
+ (let ((rank (call-using-type get-conversion-sequence class type user)))
+ (when (null rank)
+ (setf max-rank nil)
+ (return nil))
+ (setf max-rank (max-conversion rank max-rank))
+ (push (conversion-function-name rank) conversions)))
+ (values max-rank (reverse conversions)))))
hunk ./src/overload-resolution.lisp 258
-(defun+using-types find-best-viable-function (name arguments class)
+(defun+using-types find-best-viable-function (name arguments class
+ &optional const-p)
hunk ./src/overload-resolution.lisp 264
- name arguments class))
+ name arguments class const-p))
hunk ./src/overload-resolution.lisp 266
-(defun+using-types find-best-viable-function2 (get-sequence name objects class)
- (declare (type (function (t list) (values t function)) get-sequence))
+(defun+using-types find-best-viable-function2 (get-sequence name objects class
+ &optional const-p)
hunk ./src/overload-resolution.lisp 272
- class))
+ class const-p))
hunk ./src/overload-resolution.lisp 276
- (loop for method in viable-functions do
- (multiple-value-bind (rank method-conversions)
- (funcall get-sequence method objects)
- ;; FIXME test for ambiguous overload #'conversion=
- (when (and rank (conversion< rank best-rank))
- (setf best-rank rank)
- (setf best-method method)
- (setf conversions method-conversions)
- (when (conversion= rank (make-match 'exact-match))
- (return)))))
- (values best-method conversions)))
+ (if (null viable-functions)
+ (dolist (class (closer-mop:class-direct-superclasses class)
+ (values best-method nil))
+ (when (typep class 'smoke-standard-class)
+ (multiple-value-bind (method conversions)
+ (call-using-types find-best-viable-function2 get-sequence name objects class const-p)
+ (when method
+ (return (values method conversions))))))
+ (loop for method in viable-functions
+ finally (return (values best-method conversions)) do
+ (block next
+ (multiple-value-bind (rank method-conversions)
+ (funcall get-sequence method objects)
+ (when (and rank (conversion<= rank best-rank))
+ (when (conversion= rank best-rank)
+ ;; FIXME catch all ambigious overloads
+ (if const-p
+ (error "Ambigious overload ~A." method)
+ (when (const-p method)
+ ;; assume that the previous method is a non
+ ;; const one and thus more specific.
+ (return-from next))))
+ (setf best-rank rank)
+ (setf best-method method)
+ (setf conversions method-conversions)
+ (when (and (conversion= rank (make-match 'exact-match))
+ (not (xor const-p (const-p method))))
+ (return (values method conversions))))))))))
hunk ./src/overload-resolution.lisp 397
- (derived-p (object.type-of) (get-class type)))
+ (derived-p (object.type-of) (get-class type))
+ (find-smoke-class (get-class type)))
hunk ./src/overload-resolution.lisp 449
- (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)))))
+ (name to-type))))
hunk ./src/overload-resolution.lisp 459
- (assert (not (void-p type))
- ()
- "Conversion operators not supported by Smoke.
-Update to Smoke >= r955426.")
hunk ./src/overload-resolution.lisp 473
- (let ((to-class (find-smoke-class (get-class type))))
- (when (call-using-types find-best-viable-function2
- (if (using-typep)
- #'standard-conversion-sequence-using-types
- #'standard-conversion-sequence)
- (constructor-name (get-class type))
- (list object) to-class)
+ (let ((to-class (find-smoke-class (get-class type) nil)))
+ (when (and to-class
+ (call-using-types find-best-viable-function2
+ (if (using-typep)
+ #'standard-conversion-sequence-using-types
+ #'standard-conversion-sequence)
+ (constructor-name (get-class type))
+ (list object) to-class))
hunk ./src/overload-resolution.lisp 514
- (if (null arguments)
- (let ((method (find-smoke-method (smoke-class-of object-or-class)
- name)))
- (unless (valid-p method)
- (error (make-condition 'no-applicable-cxx-method
- :method name
- :class object-or-class
- :arguments arguments)))
- (if (static-p method)
- (s-call method (null-pointer))
- (s-call method (cast object-or-class (get-class method)))))
- (multiple-value-bind (method sequence)
- (find-best-viable-function name
- arguments
- (smoke-class-of object-or-class))
- (when (null method)
- (error (make-condition 'no-applicable-cxx-method
- :method name
- :class object-or-class
- :arguments arguments)))
- (if (static-p method)
- (apply #'call-sequence method (null-pointer) sequence arguments)
- (apply #'call-sequence method (cast object-or-class (get-class method)) [_$_]
- sequence arguments)))))
+ (multiple-value-bind (method sequence)
+ (find-best-viable-function name
+ arguments
+ (smoke-class-of object-or-class)
+ (when (typep object-or-class
+ 'smoke-standard-object)
+ (const-p object-or-class)))
+ (when (null method)
+ (error (make-condition 'no-applicable-cxx-method
+ :method name
+ :class object-or-class
+ :arguments arguments)))
+ (if (static-p method)
+ (apply #'call-sequence method (null-pointer) sequence arguments)
+ (apply #'call-sequence method (cast object-or-class (get-class method)) [_$_]
+ sequence arguments))))
hunk ./src/package.lisp 38
+ #:const-p
hunk ./src/smoke-to-clos.lisp 106
- (when (and (enum-p method)
- ;; FIXME workaround for
- ;; http://lists.kde.org/?l=kde-bindings&m=123464781307375
- (not (string= (name (get-class method))
- "KGlobalSettings")))
+ (when (enum-p method)
Sun Aug 2 12:12:41 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Cleanup C++ to Lisp translation
move ./src/method.lisp ./src/smoke-to-clos.lisp
hunk ./smoke.mbd 35
- ("translate" (:needs "package"))
hunk ./smoke.mbd 44
- ("method" (:needs "clos" "overload-resolution"))
+ ("smoke-to-clos" (:needs "clos" "overload-resolution"))
hunk ./smoke.mbd 46
- (:needs "smoke-c" "utils")
+ (:needs "smoke-c" "utils" "bindings")
hunk ./smoke.mbd 51
- (:needs "package" "translate")
+ (:needs "package")
hunk ./src/bindings.lisp 3
-(defvar *bindings* (make-hash-table))
+(defvar *bindings* (make-hash-table)
+ "The Smoke C++ binding classes to which virtual method calls are dispatched.")
hunk ./src/bindings.lisp 26
+ "A C array."
hunk ./src/bindings.lisp 45
-(defvar *smoke-modules* (make-hash-table))
+(defvar *smoke-modules* (make-hash-table)
+ "All loaded Smoke modules.")
hunk ./src/class-map.lisp 8
-
hunk ./src/class-map.lisp 11
- (assert value [_$_]
- ()
+ (assert value ()
hunk ./src/class-map.lisp 17
- (setf (gethash (pointer-address (smoke-module-pointer smoke)) *smoke-id-class-map*)
+ (setf (gethash (pointer-address (smoke-module-pointer smoke))
+ *smoke-id-class-map*)
hunk ./src/class-map.lisp 22
- (setf (id-class-map smoke)
- (make-hash-table)))
+ (setf (id-class-map smoke) (make-hash-table)))
hunk ./src/class-map.lisp 26
- (setf (gethash (id smoke-class)
- (id-class-map (smoke smoke-class)))
+ (setf (gethash (id smoke-class) (id-class-map (smoke smoke-class)))
hunk ./src/class-map.lisp 32
- (ret (gethash (id class)
- (id-class-map (smoke class)))))
+ (ret (gethash (id class) (id-class-map (smoke class)))))
hunk ./src/clos.lisp 12
-
hunk ./src/clos.lisp 122
-(defmethod closer-mop:validate-superclass ((class smoke-standard-class) (superclass standard-class))
+(defmethod closer-mop:validate-superclass ((class smoke-standard-class)
+ (superclass standard-class))
hunk ./src/clos.lisp 126
-(defmethod closer-mop:validate-superclass ((class cxx:class) (superclass smoke-standard-class))
+(defmethod closer-mop:validate-superclass ((class cxx:class)
+ (superclass smoke-standard-class))
hunk ./src/clos.lisp 130
-(defmethod reinitialize-instance :around
- ((class smoke-standard-class)
- &rest args &key direct-superclasses &allow-other-keys)
- (apply
- #'call-next-method class
- :direct-superclasses (or direct-superclasses
- (list (find-class
- 'smoke-standard-object))) args))
+;; Sets NIL superclass to SMOKE-STANDARD-OBJECT instead of the default
+;; STANDARD-OBJECT.
+(defun init-smoke-standard-class (class next-method
+ &rest args &key direct-superclasses
+ &allow-other-keys)
+ (apply next-method class
+ :direct-superclasses (or direct-superclasses
+ (list (find-class 'smoke-standard-object)))
+ args))
hunk ./src/clos.lisp 140
-(defmethod initialize-instance :around
- ((class smoke-standard-class)
- &rest args &key direct-superclasses &allow-other-keys)
- "Sets NIL superclass to SMOKE-STANDARD-OBJECT instead of the default STANDARD-OBJECT."
- (apply
- #'call-next-method class
- :direct-superclasses (or direct-superclasses
- (list (find-class 'smoke-standard-object)))
- args))
+(defmethod initialize-instance :around ((class smoke-standard-class) &rest args)
+ (apply #'init-smoke-standard-class class #'call-next-method args))
+
+(defmethod reinitialize-instance :around ((class smoke-standard-class) &rest args)
+ (apply #'init-smoke-standard-class class #'call-next-method args))
hunk ./src/clos.lisp 146
-(defmethod reinitialize-instance :around
- ((class cxx:class)
- &rest args &key direct-superclasses &allow-other-keys)
- (assert (not (null direct-superclasses))
- (direct-superclasses)
- "No superclass supplied for class ~A" class)
- (let ((superclass (first direct-superclasses)))
- (assert (subtypep (class-of superclass) (find-class 'smoke-standard-class))
- ((first direct-superclasses))
- "The first superclass must be an subclass of an smoke class.")
- (apply
- #'call-next-method class
- :id (id superclass)
- :smoke (smoke superclass)
- :direct-superclasses direct-superclasses
- args)))
hunk ./src/clos.lisp 147
-(defmethod initialize-instance :around
- ((class cxx:class)
- &rest args &key direct-superclasses &allow-other-keys)
+(defun init-cxx-class (class next-method &rest args &key direct-superclasses
+ &allow-other-keys)
hunk ./src/clos.lisp 159
- [_$_]
hunk ./src/clos.lisp 160
- #'call-next-method class
+ next-method class
hunk ./src/clos.lisp 166
+(defmethod reinitialize-instance :around ((class cxx:class) &rest args)
+ (apply #'init-cxx-class class #'call-next-method args))
+ [_$_]
+(defmethod initialize-instance :around ((class cxx:class) &rest args)
+ (apply #'init-cxx-class class #'call-next-method args))
+
hunk ./src/clos.lisp 237
+ ;; The destructed callback can be the result of deleting the object
+ ;; in a finalizer. In that case the object is already removed from
+ ;; *object-map* when the callback is invoked. Thus OBJECT can be NIL.
hunk ./src/clos.lisp 248
+ ;; It looks like there is no stack allocation in Qt virtual method signatures.
hunk ./src/clos.lisp 259
- (push (argument-to-lisp (mem-ref stack
- 'smoke-stack-item)
+ (push (argument-to-lisp (mem-ref stack 'smoke-stack-item)
hunk ./src/clos.lisp 287
- (transfer-ownership-to value object)))))))
+ (remove-object (pointer value))))))))
+ ; (transfer-ownership-to value object)))))))
hunk ./src/clos.lisp 295
+;; Receive virutal function calls.
hunk ./src/clos.lisp 304
- ;; FIXME:
- ;;(assert object
- ;; (object)
- ;; "No object for ~A to call ~A." object-ptr method)
- (if (and object (typep (class-of object) 'cxx:class))
- ;; Do not allow overwriting methods of classes the users has
- ;; not derived from (like in C++), to reduce overhead.
- (let* ((method (make-smoke-method
- :smoke (gethash (pointer-address
- (smoke-get-smoke binding))
- *smoke-modules*)
- :id method)))
- (loop
- (restart-case
- (return-from dispatch-method
- (let ((gf (get-gf-for-method method)))
- (declare (function gf))
- (if (null (gf-methods gf))
- (progn
- (when abstract
- (error "Abstract method ~A called."
- (method-declaration method)))
- nil)
- (if object
- (progn
- (put-returnvalue stack
- (apply gf object
- (stack-to-args
- (inc-pointer stack [_$_]
- (foreign-type-size
- 'smoke-stack-item))
- (get-first-argument method)))
- (return-type method)
- object)
- t)
- nil))))
- ;; Restarts to prevent stack unwinding across the C++ stack.
- (call-default ()
- :report (lambda (stream)
- (declare (stream stream))
- (format stream "Call default implementation ~A instead."
- method))
- :test (lambda (condition)
- (declare (ignore condition))
- (not abstract))
- (return-from dispatch-method nil))
- (use-returnvalue (return-value)
- :report (lambda (stream)
- (declare (stream stream))
- (format stream "Supply a return value for ~A."
- (method-declaration method)))
- :test (lambda (condition)
- (declare (ignore condition))
- (not (void-p (return-type method))))
- :interactive (lambda ()
- (format *query-io* "~&Enter a new return value: ")
- (multiple-value-list (eval (read *query-io*))))
- (put-returnvalue stack return-value [_$_]
- (return-type method)
- (get-object object-ptr))
- (return-from dispatch-method t))
- (return ()
- :report (lambda (stream)
- (declare (stream stream))
- (format stream "Return void for ~A."
- (method-declaration method)))
- :test (lambda (condition)
- (declare (ignore condition))
- (void-p (return-type method)))
- (return-from dispatch-method (values)))
- (retry ()
- :report (lambda (stream)
- (declare (stream stream))
- (format stream "Try again calling ~A." [_$_]
- (method-declaration method))))))
- nil))))
+ ;; The Lisp OBJECT can be gc'ed but we might still receive a
+ ;; QObject destructed event when the C++ instance is deleted in
+ ;; the finalizer. Thus OBJECT might be NIL.
+ (when (and object (typep (class-of object) 'cxx:class))
+ ;; Do not allow overwriting methods of classes the users has
+ ;; not derived from (like in C++), to reduce overhead.
+ (let* ((method (make-smoke-method
+ :smoke (gethash (pointer-address
+ (smoke-get-smoke binding))
+ *smoke-modules*)
+ :id method)))
+ (loop
+ (restart-case
+ (return-from dispatch-method
+ (let ((gf (get-gf-for-method method)))
+ (declare (function gf))
+ (if (null (gf-methods gf))
+ (progn
+ (when abstract
+ (error "Abstract method ~A of ~A called."
+ (method-declaration method) object))
+ nil)
+ (if object
+ (progn
+ (put-returnvalue
+ stack
+ (apply gf object
+ (stack-to-args
+ (inc-pointer stack (foreign-type-size
+ 'smoke-stack-item))
+ (get-first-argument method)))
+ (return-type method) object)
+ t)
+ nil))))
+ ;; Restarts to prevent stack unwinding across the C++ stack.
+ (call-default ()
+ :report (lambda (stream)
+ (declare (stream stream))
+ (format stream
+ "Call default implementation ~A instead."
+ method))
+ :test (lambda (condition)
+ (declare (ignore condition))
+ (not abstract))
+ (return-from dispatch-method nil))
+ (use-returnvalue (return-value)
+ :report (lambda (stream)
+ (declare (stream stream))
+ (format stream "Supply a return value for ~A."
+ (method-declaration method)))
+ :test (lambda (condition)
+ (declare (ignore condition))
+ (not (void-p (return-type method))))
+ :interactive (lambda ()
+ (format *query-io* "~&Enter a new return value: ")
+ (multiple-value-list (eval (read *query-io*))))
+ (put-returnvalue stack return-value [_$_]
+ (return-type method)
+ (get-object object-ptr))
+ (return-from dispatch-method t))
+ (return ()
+ :report (lambda (stream)
+ (declare (stream stream))
+ (format stream "Return void for ~A."
+ (method-declaration method)))
+ :test (lambda (condition)
+ (declare (ignore condition))
+ (void-p (return-type method)))
+ (return-from dispatch-method (values)))
+ (retry ()
+ :report (lambda (stream)
+ (declare (stream stream))
+ (format stream "Try again calling ~A." [_$_]
+ (method-declaration method))))))
+ nil))))
hunk ./src/clos.lisp 401
-(defmethod convert-to-class (smoke-class (object smoke-standard-object))
- (cast object smoke-class))
-
+;; The constructor name is the name of the class minus any namespace parts.
hunk ./src/clos.lisp 469
- (cerror "ignore" "~A has already been called for ~A."
- #'keep-wrapper object))
+ (cerror "ignore" "~A has already been added to ~A."
+ object new-owner))
hunk ./src/cxx-method.lisp 4
- ((gf-methods :initform nil
+ ((gf-methods :initform nil :type list
hunk ./src/cxx-method.lisp 6
- :type list
- :documentation "Generic functions for different argument counts."))
+ :documentation "gf for different argument counts."))
hunk ./src/cxx-method.lisp 8
- (:documentation
- "A generic function that can be overloaded by argument count."))
+ (:documentation "gf that can be overloaded by argument count."))
hunk ./src/cxx-method.lisp 37
- (= argument-count
- (argument-count gf)))
+ (= argument-count (argument-count gf)))
hunk ./src/cxx-method.lisp 80
- (let ((generic-function (ensure-gf-by-argument-count cxx-generic-function
- (method-argument-count method))))
+ (let ((generic-function (ensure-gf-by-argument-count
+ cxx-generic-function
+ (method-argument-count method))))
hunk ./src/object-map.lisp 9
-
hunk ./src/object-map.lisp 37
-except object with a non virtual destructor which had their ownership transferred
-to C++.")
+except object with a non virtual destructor which had their ownership
+transferred to C++.")
hunk ./src/object-map.lisp 61
-(defun remove-if-exists (pointer)
- (remhash (pointer-address pointer) *object-map*))
-
hunk ./src/object-map.lisp 62
- (declare (optimize (speed 3)))
hunk ./src/object-map.lisp 109
- [_$_]
+ [_$_]
hunk ./src/object-map.lisp 113
- (assert (not (has-pointer-p (pointer object)))
- ()
+ (assert (not (has-pointer-p (pointer object))) ()
hunk ./src/objects/class.lisp 4
- ((id :initform 0 :type smoke-index :reader id :initarg :id)
- (smoke :type smoke-module :reader smoke :initarg :smoke)))
+ ((id :initform 0 :type smoke-index
+ :reader id :initarg :id)
+ (smoke :type smoke-module
+ :reader smoke :initarg :smoke)))
hunk ./src/objects/class.lisp 12
-
hunk ./src/objects/class.lisp 14
- (mem-aref (the foreign-pointer (smoke-array-pointer (smoke-module-classes
- (smoke class))))
+ (mem-aref (the foreign-pointer
+ (smoke-array-pointer (smoke-module-classes (smoke class))))
hunk ./src/objects/class.lisp 46
- (declare (optimize (speed 3)))
+ (declare (type smoke-class class)
+ (optimize (speed 3)))
hunk ./src/objects/class.lisp 73
-;smoke-find-class
hunk ./src/objects/class.lisp 111
- (smoke-is-derived-from (smoke-module-pointer (smoke class)) (id class)
- (smoke-module-pointer (smoke base-class)) (id base-class)))
+ (smoke-is-derived-from (smoke-module-pointer (smoke class)) [_$_]
+ (id class)
+ (smoke-module-pointer (smoke base-class))
+ (id base-class)))
hunk ./src/objects/class.lisp 130
- class (append classes
- (list
- (make-smoke-class-from-id (smoke class)
- class-index)))
+ class
+ (append classes
+ (list (make-smoke-class-from-id (smoke class) class-index)))
hunk ./src/objects/enum.lisp 6
-;;;
hunk ./src/objects/enum.lisp 33
- enum-type)
+ enum-type)
hunk ./src/objects/enum.lisp 41
- (enum-type enum2))
+ (enum-type enum2))
hunk ./src/objects/enum.lisp 69
- collect `(,(value (eval (first case)))
- ,@(rest case)))))
+ collect `(,(value (eval (first case)))
+ ,@(rest case)))))
hunk ./src/objects/method.lisp 17
- (if (or (null-pointer-p (smoke-module-pointer (smoke-method-smoke smoke-method)))
+ (if (or (null-pointer-p (smoke-module-pointer
+ (smoke-method-smoke smoke-method)))
hunk ./src/objects/method.lisp 56
- (the (smoke-index 0)
- (method-slot-value method 'name))))
+ (the (smoke-index 0) (method-slot-value method 'name))))
hunk ./src/objects/method.lisp 139
- (format nil "~A~:[~; static~]" (access method)
- (static-p method)))
+ (format nil "~A~:[~; static~]" (access method) (static-p method)))
hunk ./src/objects/method.lisp 255
-
hunk ./src/objects/stack.lisp 20
- :top (inc-pointer smoke-stack
- #.(foreign-type-size 'smoke-stack-item))))
+ :top (inc-pointer smoke-stack #.(foreign-type-size 'smoke-stack-item))))
hunk ./src/objects/stack.lisp 23
- (setf (foreign-slot-value (call-stack-top stack)
- 'smoke-stack-item type) value)
+ (setf (foreign-slot-value (call-stack-top stack) 'smoke-stack-item type)
+ value)
hunk ./src/objects/stack.lisp 31
- 'smoke-stack-item ,type) ,value)
+ 'smoke-stack-item ,type)
+ ,value)
hunk ./src/objects/stack.lisp 103
- (0 (let ((cffi-type (get-type (name type))))
- (if (null cffi-type)
- (progn [_$_]
- ;; FIXME warn but not on void**
- ;;(warn "Unknown translation from ~A to lisp." (name type))
- (foreign-slot-value stack-item 'smoke-stack-item 'voidp))
- (let* ((pointer (foreign-slot-value stack-item
- 'smoke-stack-item
- 'voidp))
- (value (convert-from-foreign pointer cffi-type)))
- (when (stack-p type)
- ;; FIXME free-translated-object is not intended for this;
- ;; param is NIL for now.
- (cffi:free-translated-object pointer cffi-type nil))
- value
- ))))
+ (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)))
hunk ./src/objects/stack.lisp 122
- :value (foreign-slot-value stack-item 'smoke-stack-item 'enum-value)
+ :value (foreign-slot-value stack-item 'smoke-stack-item
+ 'enum-value)
hunk ./src/objects/stack.lisp 132
- (if (class-p type)
- (let ((class (get-class type)))
- (if (has-pointer-p object)
+ (let ((class (get-class type)))
+ (if (has-pointer-p object)
+ (if (derived-p (class-of (get-object object))
+ (get-class type))
hunk ./src/objects/stack.lisp 137
- (instance-to-lisp object (find-smoke-class class) type)))
- nil))
+ (progn
+ (cerror "Remove the old object."
+ "The object at pointer ~A is ~A but should be a ~A."
+ object (get-object object) type)
+ (remove-object object)
+ (instance-to-lisp object (find-smoke-class class) type)))
+ (instance-to-lisp object (find-smoke-class class) type))))
hunk ./src/objects/stack.lisp 149
- (object-to-lisp (foreign-slot-value stack-item
- 'smoke-stack-item
+ (object-to-lisp (foreign-slot-value stack-item 'smoke-stack-item
hunk ./src/objects/stack.lisp 157
- ((void-p type)
- (values))
- ((class-p type)
- (class-to-lisp stack-item type))
- (t
- (enum-to-lisp stack-item type))))
+ ((void-p type) (values))
+ ((class-p type) (class-to-lisp stack-item type))
+ (t (enum-to-lisp stack-item type))))
+
+(defvar *to-lisp-translations* (make-hash-table :test 'equal))
+
+(defun error-no-free (object)
+ (error "Can not free object at ~A." object))
+
+(defmacro define-to-lisp-translation (type-names &optional
+ (conversion-function-name 'identity)
+ (free-function-name 'error-no-free))
+ `(progn ,@(loop for type-name in (ensure-list type-names)
+ collect `(setf (gethash ,type-name *to-lisp-translations*)
+ (cons ',conversion-function-name
+ ',free-function-name)))))
+
+(defmacro define-pointer-typedef (type-names lisp-type)
+ (declare (ignore lisp-type))
+ `(progn [_$_]
+ (define-to-lisp-translation ,type-names identity identity)))
+ ;; not needed
+ ;;(define-from-lisp-translation ,type-names ,lisp-type)))
+
+(define-to-lisp-translation ("void*" "const void*" "void**"))
+
+(define-to-lisp-translation ("char*" "const char*") foreign-string-to-lisp)
hunk ./src/objects/type.lisp 80
- ;; 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.
hunk ./src/objects/type.lisp 124
- (= 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)))
hunk ./src/objects/type.lisp 136
- (assert (/= -1 (type-slot-value type 'class))
+ (assert (class-p type)
hunk ./src/objects/type.lisp 138
- "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)))
hunk ./src/overload-resolution.lisp 407
+ ;;
+ ;; But it is needed for passing the int pointer in QApplication(int&, char**).
hunk ./src/overload-resolution.lisp 413
- :from (find-class 't)
- :to (find-class 't)))) ;; FIXME get the class when applicable
+ :from (find-class 't)
+ :to (find-class 't)))) ;; FIXME get the class when applicable
hunk ./src/package.lisp 33
+ #:define-to-lisp-translation
+ #:define-pointer-typedef
hunk ./src/smoke-c/csmokebinding.cpp 4
+#include <QDebug>
hunk ./src/smoke-c/csmokebinding.cpp 17
+ * @param class_index Index of the object's class.
hunk ./src/smoke-c/smoke-c.lisp 16
-
hunk ./src/smoke-c/smoke-c.lisp 17
-
hunk ./src/smoke.lisp 34
- 'smoke-class
- 'class-function)
+ 'smoke-class 'class-function)
hunk ./src/smoke.lisp 37
- 'smoke-method
- 'method)
+ 'smoke-method 'method)
hunk ./src/smoke.lisp 52
-
hunk ./src/smoke.lisp 53
- (s-call
- (make-smoke-method-from-name class method-name)
- pointer args))
+ (s-call (make-smoke-method-from-name class method-name) pointer args))
hunk ./src/smoke.lisp 56
- (s-call
- (make-smoke-method-from-name (make-smoke-class smoke class-name)
- method-name)
- (null-pointer) args))
+ (s-call (make-smoke-method-from-name (make-smoke-class smoke class-name)
+ method-name)
+ (null-pointer) args))
hunk ./src/smoke.lisp 63
+ ;;
hunk ./src/smoke.lisp 66
- ;; and confuses it with the member function type() ??
- ;; (27.2.09)
+ ;; and confuses it with the member function type() ?? (27.2.09)
hunk ./src/smoke.lisp 78
- (s-call
- (make-smoke-method-from-name class method-name)
- pointer)))
+ (s-call (make-smoke-method-from-name class method-name) pointer)))
hunk ./src/smoke.lisp 83
- (make-smoke-method-from-name (class-of object) method-name)
- (pointer object)))
+ (make-smoke-method-from-name (class-of object) method-name)
+ (pointer object)))
hunk ./src/smoke.lisp 91
- (setf (foreign-slot-value (mem-aref stack
- 'smoke-stack-item
- 1)
- 'smoke-stack-item
- 'voidp)
+ (setf (foreign-slot-value (mem-aref stack 'smoke-stack-item 1)
+ 'smoke-stack-item 'voidp)
hunk ./src/smoke.lisp 96
- 'smoke-class
- 'class-function)
+ 'smoke-class 'class-function)
hunk ./src/smoke.lisp 99
- :pointer (pointer object) smoke-stack stack
+ :pointer (pointer object)
+ smoke-stack stack
hunk ./src/smoke.lisp 106
- (let* ((binding (smoke-init smoke
- (callback destructed)
+ (let* ((binding (smoke-init smoke (callback destructed)
hunk ./src/smoke.lisp 118
- (setf (gethash (pointer-address (smoke-module-pointer (eval symbol))) pointer-symbol-map)
+ (setf (gethash (pointer-address (smoke-module-pointer (eval symbol)))
+ pointer-symbol-map)
hunk ./src/smoke.lisp 126
- (smoke-call (class-of object)
- (pointer object)
- method-name
- args))
+ (smoke-call (class-of object) (pointer object)
+ method-name args))
hunk ./src/smoke.lisp 140
-
hunk ./src/smoke.lisp 185
+
hunk ./src/smoke.lisp 187
- (defcvar (,variable ,variable-name
- :read-only t
- :library ,library) :pointer)
+ (defcvar (,variable ,variable-name :read-only t :library ,library)
+ :pointer)
hunk ./src/smoke.lisp 202
-
hunk ./src/translate.lisp 1
-(in-package :smoke)
-
-(defvar *type-map* (make-hash-table :test 'equal))
-
-(defun get-type (name)
- "Return the CFFI type for NAME."
- (gethash name *type-map*))
-
-(defun add-type (name type)
- "Registers the CFFI type TYPE with NAME."
- (setf (gethash name *type-map*) type))
-
-(defun setup-type-map ()
- "Setup C string <-> Lisp string translation."
- (add-type "char*" :string)
- (add-type "const char*" :string))
-
-(eval-when (:load-toplevel :execute)
- (setup-type-map))
-
-(defgeneric convert-to-class (smoke-class object))
-
-;(defmethod convert-to-class (smoke-class (pointer cffi:foreign-pointer))
-(defmethod convert-to-class (smoke-class pointer)
- (declare (ignore smoke-class))
- (assert (cffi:pointerp pointer))
- pointer)
rmfile ./src/translate.lisp
Fri Jul 24 15:32:23 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix conversion sequence from QByteArray to const char*.
hunk ./src/overload-resolution.lisp 424
+(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)))
+ [_$_]
hunk ./src/overload-resolution.lisp 443
- (format nil "operator ~A" [_$_]
- (if (class-p type)
- (name (get-class type))
- (name type))))))
+ (conversion-operator-name type))))
hunk ./src/overload-resolution.lisp 449
- (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)))))))
Thu Jul 23 00:26:05 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Use strcmp, fix constructor & destrucor calling for classes witn namespace (phonon::MediaPlayer) and add :arg0 to :arg2 initargs
hunk ./TODO 1
-Methods:
- * C++ overload resolution & argument promotion
- => no more writing (make-instance 'qt:byte-array :args ("foo"))
- * Test for null pointer in this and for references
- * default arguments
- * fetch name of arguments
-
-* const correctness
-
-* keyword arguments for make-instance
-
-* QApplication and KCmdLineArgs.init call exit() on e.g. "--help"
-
-Testsuite:
- * Fix segfaults when lots of qt:applictions are created & deleted
- * Test condition & restarts
-
-finalization:
- * get rid of owned-p
- * use QObject::deleteLater ?
-
-* Exceptions
rmfile ./TODO
hunk ./src/clos.lisp 22
- ;; At least on sbcl 1.0.25.debian CONCATENATE is faster
- ;; than VECTOR-PUSH-EXTEND
+ ;; At least on sbcl 1.0.25.debian CONCATENATE is faster than
+ ;; VECTOR-PUSH-EXTEND.
hunk ./src/clos.lisp 124
- T)
+ t)
hunk ./src/clos.lisp 127
- T)
+ t)
hunk ./src/clos.lisp 248
- ((object-pointer :pointer))
+ ((object-pointer :pointer))
hunk ./src/clos.lisp 270
- 'smoke-stack-item)
- arg)
+ 'smoke-stack-item)
+ arg)
hunk ./src/clos.lisp 289
+ ;;
hunk ./src/clos.lisp 291
- ;; passed on the stack. E.g. converted-value can be something like
- ;; (cxx:operator-variant value).
+ ;; passed on the stack. E.g. converted-value can be something
+ ;; like (cxx:operator-variant value).
hunk ./src/clos.lisp 318
- ;; Do not allow overwriting methods of classes the users has not derived from (like in C++),
- ;; to reduce overhead.
+ ;; Do not allow overwriting methods of classes the users has
+ ;; not derived from (like in C++), to reduce overhead.
hunk ./src/clos.lisp 321
- :smoke (gethash (pointer-address (smoke-get-smoke binding))
+ :smoke (gethash (pointer-address
+ (smoke-get-smoke binding))
hunk ./src/clos.lisp 414
+(defun constructor-name (class)
+ (let ((name-start (search "::" (name class) :from-end t)))
+ (if name-start
+ (subseq (name class) (+ name-start 2))
+ (name class))))
+
hunk ./src/clos.lisp 423
- (name (class-of object)))))
+ (constructor-name (class-of object)))))
+ (assert (valid-p method)
+ (method)
+ "No constructor for ~A." object)
hunk ./src/clos.lisp 429
- (find-best-viable-function (name (class-of object))
+ (find-best-viable-function (constructor-name (class-of object))
hunk ./src/clos.lisp 433
- (error "No constructor ~A for ~S"
- object arguments))
+ (error "No constructor for object ~A with
+the arguments ~S." object arguments))
hunk ./src/clos.lisp 441
- &key args &allow-other-keys)
+ &key args
+ (arg0 nil arg0p)
+ (arg1 nil arg1p)
+ (arg2 nil arg2p)
+ &allow-other-keys)
hunk ./src/clos.lisp 455
- (setf (slot-value object 'pointer) (call-constructor object args))
+ (if arg0p
+ (setf (slot-value object 'pointer) [_$_]
+ (call-constructor object [_$_]
+ (cond
+ (arg2p (list arg0 arg1 arg2))
+ (arg1p (list arg0 arg1))
+ (t (list arg0)))))
+ (setf (slot-value object 'pointer) (call-constructor object args)))
hunk ./src/object-map.lisp 67
- (assert (has-pointer-p pointer)
- (pointer)
- "No object to remove for pointer ~A." pointer)
- (remhash (pointer-address pointer) *object-map*))
+ (unless (remhash (pointer-address pointer) *object-map*)
+ (cerror "ignore" "No object to remove for pointer ~A." pointer)))
hunk ./src/object-map.lisp 103
+
+(defun debug-finalize ()
+ (eval '(defmethod make-finalize :around (object)
+ (let ((pointer (pointer object))
+ (class (class-of object))
+ (next (call-next-method)))
+ #'(lambda ()
+ (format *debug-io* "cl-smoke: finalizing: ~A..."
+ (make-instance class :pointer pointer))
+ (funcall next)
+ (format *debug-io* "done~%"))))))
hunk ./src/objects/class.lisp 122
- (assert (<= class-index
- (smoke-array-length
- (smoke-module-classes (smoke class)))))
+ (assert (<= class-index (smoke-array-length
+ (smoke-module-classes (smoke class)))))
hunk ./src/objects/class.lisp 126
- (smoke-add-superclass class (append classes
- (list
- (make-smoke-class-from-id (smoke class)
- class-index)))
- (1+ index)))))
+ (smoke-add-superclass
+ class (append classes
+ (list
+ (make-smoke-class-from-id (smoke class)
+ class-index)))
+ (1+ index)))))
hunk ./src/objects/method.lisp 50
+(declaim (inline smoke-method-name))
+(defun smoke-method-name (method)
+ (mem-aref (smoke-array-pointer (smoke-module-method-names [_$_]
+ (smoke-method-smoke method)))
+ :pointer
+ (the (smoke-index 0)
+ (method-slot-value method 'name))))
+
hunk ./src/objects/stack.lisp 11
- (/ [_$_]
- (- (pointer-address (call-stack-top stack))
- (pointer-address (call-stack-pointer stack)))
- (foreign-type-size 'smoke-stack-item)))
+ (/ (- (pointer-address (call-stack-top stack))
+ (pointer-address (call-stack-pointer stack)))
+ (foreign-type-size 'smoke-stack-item)))
hunk ./src/overload-resolution.lisp 6
-(defun cstring= (string1 string2)
- "Returns T when the C strings STRING1 and STRING2 are equal
- and NIL otherwise."
- (declare (optimize (speed 3) (safety 0)))
- (dotimes (i array-total-size-limit)
- (let ((char1 (mem-aref string1 :char i))
- (char2 (mem-aref string2 :char i)))
- (when (/= char1 char2)
- (return-from cstring= nil))
- (when (or (= 0 char1)
- (= 0 char2))
- (return-from cstring= (= char1 char2))))))
-
hunk ./src/overload-resolution.lisp 8
- "Returns -1 if a < b; 0 if a = b and 1 if a > b"
- (declare (values (integer -1 1)))
- (if (< a b)
- -1
- (if (> a b)
- 1
- 0)))
+ (- a b))
hunk ./src/overload-resolution.lisp 10
-(declaim (inline cstring-cmp))
-(defun cstring-cmp (string1 string2)
- "Compares the C strings STRING1 and STRING2."
- (declare (foreign-pointer string1 string2)
- (values (integer -1 1))
- (optimize (speed 3)))
- (dotimes (i array-total-size-limit (error "omg"))
- (let ((char1 (mem-aref string1 :char i))
- (char2 (mem-aref string2 :char i)))
- (when (/= char1 char2)
- (return-from cstring-cmp (if (< char1 char2) -1 1)))
- (when (= 0 char1) ;; <=> (= 0 char2)
- (return-from cstring-cmp 0)))))
+(declaim (inline strcmp))
+(defcfun strcmp :int (s1 :pointer) (s2 :pointer))
hunk ./src/overload-resolution.lisp 13
+(declaim (inline cstring/=))
hunk ./src/overload-resolution.lisp 17
- (declare (optimize (speed 3)))
- (dotimes (i array-total-size-limit)
- (let ((char1 (mem-aref string1 :char i))
- (char2 (mem-aref string2 :char i)))
- (when (/= char1 char2)
- (return-from cstring/= i))
- (when (= 0 char1)
- (return-from cstring/= nil)))))
-
-(declaim (inline smoke-method-name))
-(defun smoke-method-name (method)
- (mem-aref (smoke-array-pointer (smoke-module-method-names [_$_]
- (smoke-method-smoke method)))
- :pointer
- (the (smoke-index 0)
- (method-slot-value method 'name))))
+ (not (zerop (strcmp string1 string2))))
hunk ./src/overload-resolution.lisp 24
- (values (integer -1 1))
hunk ./src/overload-resolution.lisp 27
- (declare (type (integer -1 1) id-cmp)
- (dynamic-extent id-cmp))
+ (declare (type smoke-index id-cmp))
hunk ./src/overload-resolution.lisp 30
- (cstring-cmp (smoke-method-name method)
+ (strcmp (smoke-method-name method)
hunk ./src/overload-resolution.lisp 33
-;;; INLINE OPTIMIZE
hunk ./src/overload-resolution.lisp 68
- (cmp (the (integer -1 1) (method-cmp method class-id name))))
- (declare (type (integer -1 1) cmp)
+ (cmp (the smoke-index (method-cmp method class-id name))))
+ (declare (type smoke-index cmp)
hunk ./src/overload-resolution.lisp 71
- (ecase cmp
- (-1 (setf start (1+ index)))
- (0 (return-from find-method-for-class index))
- (1 (setf end (1- index)))))))
+ (if (< cmp 0)
+ (setf start (1+ index))
+ (if (> cmp 0)
+ (setf end (1- index))
+ (return-from find-method-for-class index))))))
hunk ./src/overload-resolution.lisp 85
- ,index))
+ (the smoke-index ,index)))
hunk ./src/overload-resolution.lisp 126
+ ;;
hunk ./src/overload-resolution.lisp 131
- (let ((methods)
- (smoke (smoke class)))
+ (let ((methods))
hunk ./src/overload-resolution.lisp 133
- (let ((start-index (find-method-for-class name class)))
- (declare (type smoke-index start-index))
- (loop for index from start-index downto 1
- while (push-candidate-method index name argument-count class
- methods))
- (loop for index from (1+ start-index)
- to (the smoke-index (smoke-array-length
- (smoke-module-method-maps smoke)))
- while (push-candidate-method index name argument-count class
- methods))))
+ (let ((smoke (smoke class)))
+ (let ((start-index (find-method-for-class name class)))
+ (declare (type smoke-index start-index))
+ (when (>= start-index 0)
+ (loop for index from start-index downto 1
+ while (push-candidate-method index name argument-count class
+ methods))
+ (loop for index from (1+ start-index)
+ to (the smoke-index (smoke-array-length
+ (smoke-module-method-maps smoke)))
+ while (push-candidate-method index name argument-count class
+ methods))))))
hunk ./src/overload-resolution.lisp 147
-(eval-when (:compile-toplevel :load-toplevel :execute)
-(defconstant +exact-match+ 0)
-(defconstant +promotion+ 1)
-(defconstant +conversion+ 2))
-
hunk ./src/overload-resolution.lisp 154
-(defstruct (exact-match (:include conversion (rank +exact-match+))))
+(defstruct (exact-match (:include conversion (rank 0))))
hunk ./src/overload-resolution.lisp 156
-(defstruct (promotion (:include conversion (rank +promotion+))))
+(defstruct (promotion (:include conversion (rank 1))))
hunk ./src/overload-resolution.lisp 158
-(defstruct (number-conversion (:include conversion (rank +conversion+))))
+(defstruct (number-conversion (:include conversion (rank 2))))
hunk ./src/overload-resolution.lisp 160
-(defstruct (pointer-conversion (:include conversion (rank (1+ +conversion+))))
+(defstruct (pointer-conversion (:include conversion (rank 3)))
hunk ./src/overload-resolution.lisp 164
-(defstruct (boolean-conversion (:include conversion (rank (+ 2 +conversion+)))))
+(defstruct (boolean-conversion (:include conversion (rank 4))))
hunk ./src/overload-resolution.lisp 166
-(defstruct (user-conversion (:include conversion (rank (+ 3 +conversion+)))))
+(defstruct (user-conversion (:include conversion (rank 5))))
hunk ./src/overload-resolution.lisp 199
- t)
- (:method ((conversion1 pointer-conversion) (conversion2 pointer-conversion))
- (and (not (conversion< conversion1 conversion2))
- (not (conversion< conversion2 conversion1)))))
+ t))
hunk ./src/overload-resolution.lisp 326
+ (8 (object.typep '(c-integer :long)))
+ (9 (object.typep '(c-integer :unsigned-long)))
hunk ./src/overload-resolution.lisp 397
- ;; Not using pointer-p to allow passing a raw pointer for
- ;; objects on the stack and references
+ ;; Not using pointer-p to allow passing a raw pointer for objects on
+ ;; the stack and references.
hunk ./src/overload-resolution.lisp 401
- ;; FIXME this breaks passing pointers to references
- ;; e.g.: calling the function foo(QByteArray& foo)
- ;; with (foo pointer) assumes pointer to point to a QByteArray,
- ;; but actually the conversion sequence QByteArray(pointer) should be used.
- ;; When pointer is a null pointer it fails horribly!.
+ ;; FIXME this breaks passing pointers to references.
+ ;; [_$_]
+ ;; e.g.: calling the function foo(QByteArray& foo) with
+ ;; (foo pointer) assumes pointer to point to a QByteArray, but
+ ;; actually the conversion sequence QByteArray(pointer) should be
+ ;; used. When pointer is a null pointer it fails horribly!.
hunk ./src/overload-resolution.lisp 451
- (format nil "~A" (name (get-class type)))
+ (constructor-name (get-class type))
hunk ./src/package.lisp 34
+ #:make-auto-pointer
hunk ./src/smoke.lisp 83
- (let ((method-name (concatenate 'string "~" (name class))))
+ (let ((method-name (concatenate 'string "~" (constructor-name class))))
hunk ./src/smoke.lisp 86
- pointer))
- (setf pointer (null-pointer)))
+ pointer)))
hunk ./src/smoke.lisp 146
-;; No eql T since all-methods is to slow to be used in conjunction with
-;; mb:document
-(defmethod documentation ((gf smoke-gf) (doc-type (eql 'cxx-function)))
+(defmethod documentation ((gf smoke-gf) (doc-type (eql 't)))
hunk ./src/smoke.lisp 153
+
+(declaim (inline cstring=))
+(defun cstring= (string1 string2)
+ "Returns T when the C strings STRING1 and STRING2 are equal
+ and NIL otherwise."
+ (zerop (strcmp string1 string2)))
+
hunk ./src/smoke.lisp 163
- (declare (string name)
- (optimize (speed 3)))
+ (declare (optimize (speed 3)))
+ (with-foreign-string (name name)
hunk ./src/smoke.lisp 167
- #'(lambda (address value)
- (declare (ignore value))
- (let ((smoke (make-pointer address)))
- (map-methods #'(lambda (method)
- (when (and (string= name (name method))
- (not (enum-p method)))
- (push (make-instance 'smoke-method
- :id (smoke-method-id method)
- :smoke (smoke method))
- methods)))
- smoke)))
- *smoke-id-class-map*)
- methods))
+ #'(lambda (address module)
+ (declare (ignore address))
+ (map-methods #'(lambda (method)
+ (when (and (cstring= name (smoke-method-name method))
+ (not (enum-p method)))
+ (push (make-smoke-method
+ :id (smoke-method-id method)
+ :smoke (smoke-method-smoke method))
+ methods)))
+ module))
+ *smoke-modules*)
+ methods)))
hunk ./src/smoke.lisp 193
- (eval-when (:compile-toplevel :load-toplevel :execute)
- (define-foreign-library ,library
- (:unix ,(format nil "~(~A~).so.2" library))
- (t (:default ,(format nil "~(~A~)" library)))))
+ (eval-when (:compile-toplevel :load-toplevel :execute)
+ (define-foreign-library ,library
+ (:unix ,(format nil "~(~A~).so.2" library))
+ (t (:default ,(format nil "~(~A~)" library)))))
hunk ./src/smoke.lisp 198
- (load-foreign-library ',library))
+ (load-foreign-library ',library))
hunk ./src/smoke.lisp 200
-; (eval-when (:compile-toplevel :load-toplevel :execute)
-; (define-foreign-library ,library
-; (:unix ,(format nil "~(~A~).so.2" library))
-; (t (:default ,(format nil "~(~A~)" library))))
-; (load-foreign-library ',library))
Wed Jul 8 22:41:19 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Speedup overload resolution and some other stuff for faster C++ method calling.
hunk ./src/clos.lisp 120
- ((pointer :type smoke-standard-class))
+ ()
hunk ./src/clos.lisp 123
-(defmethod pointer ((class cxx:class))
- (pointer (slot-value class 'pointer)))
-
hunk ./src/clos.lisp 160
- :pointer superclass
+ :id (id superclass)
hunk ./src/clos.lisp 181
- :pointer superclass
+ :id (id superclass)
hunk ./src/clos.lisp 206
- :pointer [_$_]
- (pointer class)
- ;(mem-aref (smoke-array-pointer [_$_]
- ; (smoke-module-classes
- ; (smoke class)))
- ; 'smoke-class
- ; (id class))
+ :id (id class)
hunk ./src/clos.lisp 287
- (setf (top stack) (pointer stack))
+ (setf (call-stack-top stack) (call-stack-pointer stack))
hunk ./src/clos.lisp 391
+ (declare (optimize (speed 3)))
hunk ./src/clos.lisp 397
- ;(id (class-of object)) (id (real-class class))))
hunk ./src/method.lisp 68
-
hunk ./src/method.lisp 151
- (eval-startup (:execute)
- (make-smoke-classes ,package ,smoke)
+ (eval-startup (:load-toplevel :execute)
+ ;; eval on startup for class map.
+ (make-smoke-classes ,package ,smoke))
+ (eval-when (:load-toplevel :execute)
hunk ./src/objects/class.lisp 4
- ;; FXIME maybe change back to id
- ((pointer ;:type foreign-pointer
- :initarg :pointer
- :reader pointer)
- (smoke :type smoke-module
- :initarg :smoke
- :reader smoke))
- (:documentation "A class"))
+ ((id :initform 0 :type smoke-index :reader id :initarg :id)
+ (smoke :type smoke-module :reader smoke :initarg :smoke)))
hunk ./src/objects/class.lisp 8
- (make-instance 'smoke-class
- :pointer (mem-aref (smoke-array-pointer (smoke-module-classes
- smoke))
- 'smoke-class
- id)
- :smoke smoke))
+ (make-instance 'smoke-class :id id :smoke smoke))
hunk ./src/objects/class.lisp 10
-(defmethod id ((class smoke-class))
- (declare (values (smoke-index 0))
- (optimize (speed 3)))
- (values
- (floor
- (the (integer 0)
- (- (pointer-address (pointer class))
- (pointer-address (smoke-array-pointer (smoke-module-classes
- (smoke class))))))
- #.(cffi:foreign-type-size 'smoke-class))))
+
+(declaim (inline smoke-class-pointer))
+(defun smoke-class-pointer (class)
+ (mem-aref (the foreign-pointer (smoke-array-pointer (smoke-module-classes
+ (smoke class))))
+ 'smoke-class
+ (the smoke-index (id class))))
hunk ./src/objects/class.lisp 20
- (foreign-slot-value (pointer class)
+ (foreign-slot-value (smoke-class-pointer class)
hunk ./src/objects/class.lisp 25
- `(foreign-slot-value (pointer ,class)
+ `(foreign-slot-value (smoke-class-pointer ,class)
hunk ./src/objects/class.lisp 39
- (setf (slot-value class 'pointer)
- (mem-aref (smoke-array-pointer (smoke-module-classes smoke))
- 'smoke-class
- id))
+ (setf (slot-value class 'id)
+ id)
hunk ./src/objects/class.lisp 87
- :pointer (smoke-get-class [_$_]
- (foreign-slot-value c 'smoke-module-index 'smoke)
- (foreign-slot-value c 'smoke-module-index 'index))
+ :id (foreign-slot-value c 'smoke-module-index 'index)
hunk ./src/objects/method.lisp 136
+ (declare (optimize (speed 3)))
hunk ./src/objects/method.lisp 210
- (call-next-method)))
+ (the smoke-index (call-next-method))))
hunk ./src/objects/stack.lisp 3
-(defclass call-stack ()
- ((pointer :reader pointer :initarg :pointer
- :initform (null-pointer)
- :type foreign-pointer
- :documentation "Pointer to the Smoke stack")
- (top :accessor top :initarg :top
- :initform (null-pointer)
- :type foreign-pointer
- :documentation "Pointer to push the next argument to."))
- (:documentation "Contains the argument passed to a Smoke method."))
+(declaim (inline %make-call-stack))
+(defstruct (call-stack (:constructor %make-call-stack))
+ (pointer (null-pointer) :type foreign-pointer)
+ (top (null-pointer) :type foreign-pointer))
hunk ./src/objects/stack.lisp 12
- (- (pointer-address (top stack))
- (pointer-address (pointer stack)))
+ (- (pointer-address (call-stack-top stack))
+ (pointer-address (call-stack-pointer stack)))
hunk ./src/objects/stack.lisp 17
- (declare (optimize (speed 3)))
- (make-instance 'call-stack
- :pointer smoke-stack
- :top (inc-pointer smoke-stack (foreign-type-size 'smoke-stack-item))))
+ (declare (type foreign-pointer smoke-stack)
+ (optimize (speed 3)))
+ (%make-call-stack
+ :pointer smoke-stack
+ :top (inc-pointer smoke-stack
+ #.(foreign-type-size 'smoke-stack-item))))
hunk ./src/objects/stack.lisp 25
- (setf (foreign-slot-value (top stack)
+ (setf (foreign-slot-value (call-stack-top stack)
hunk ./src/objects/stack.lisp 27
- (incf-pointer (top stack) #.(foreign-type-size 'smoke-stack-item)))
+ (incf-pointer (call-stack-top stack) #.(foreign-type-size 'smoke-stack-item)))
hunk ./src/objects/stack.lisp 32
- (setf (foreign-slot-value (top ,stack)
+ (setf (foreign-slot-value (call-stack-top ,stack)
hunk ./src/objects/stack.lisp 34
- (incf-pointer (top ,stack) ,(foreign-type-size 'smoke-stack-item)))
+ (incf-pointer (call-stack-top ,stack)
+ ,(foreign-type-size 'smoke-stack-item)))
hunk ./src/objects/stack.lisp 41
+ :type foreign-pointer
hunk ./src/objects/type.lisp 123
+ (declare (optimize (speed 3)))
hunk ./src/objects/type.lisp 127
- (id type))
+ (the smoke-index (id type)))
hunk ./src/overload-resolution.lisp 79
+;;; INLINE OPTIMIZE
+(declaim (inline first-unabigious-index))
hunk ./src/overload-resolution.lisp 99
- (declare (type (smoke-index 0) start end))
+ (declare (type (smoke-index 0) start end)
+ (dynamic-extent start))
hunk ./src/overload-resolution.lisp 117
- (dynamic-extent method index cmp))
+ (dynamic-extent method))
hunk ./src/overload-resolution.lisp 196
-(defclass std-conversion ()
- ((function-name :accessor conversion-function-name
- :initarg :conversion-function-name))
- (:documentation "A conversion"))
+(declaim (inline make-conversion make-exact-match make-promotion
+ make-number-conversion make-pointer-conversion
+ make-boolean-conversion make-user-conversion))
+(defstruct conversion
+ (function-name nil :type (or symbol function) :read-only t)
+ (rank -1 :type fixnum :read-only t))
hunk ./src/overload-resolution.lisp 203
-(defclass exact-match (std-conversion)
- ((rank :reader rank
- :allocation :class
- :type fixnum
- :initform +exact-match+)))
+(defstruct (exact-match (:include conversion (rank +exact-match+))))
hunk ./src/overload-resolution.lisp 205
-(defclass promotion (std-conversion)
- ((rank :reader rank
- :allocation :class
- :type fixnum
- :initform +promotion+)))
+(defstruct (promotion (:include conversion (rank +promotion+))))
hunk ./src/overload-resolution.lisp 207
-(defclass number-conversion (std-conversion)
- ((rank :reader rank
- :allocation :class
- :type fixnum
- :initform +conversion+)))
+(defstruct (number-conversion (:include conversion (rank +conversion+))))
hunk ./src/overload-resolution.lisp 209
-(defclass pointer-conversion (std-conversion)
- ((rank :reader rank
- :allocation :class
- :type fixnum
- :initform (1+ +conversion+))
- (from :reader from
- :initarg :from)
- (to :reader to
- :initarg :to)))
+(defstruct (pointer-conversion (:include conversion (rank (1+ +conversion+))))
+ (from (find-class t) :type class :read-only t)
+ (to (find-class t) :type class :read-only t))
hunk ./src/overload-resolution.lisp 213
-(defclass boolean-conversion (std-conversion)
- ((rank :reader rank
- :allocation :class
- :type fixnum
- :initform (+ 2 +conversion+))))
+(defstruct (boolean-conversion (:include conversion (rank (+ 2 +conversion+)))))
hunk ./src/overload-resolution.lisp 215
-(defclass user-conversion (std-conversion)
- ((rank :reader rank
- :allocation :class
- :type fixnum
- :initform (+ 3 +conversion+))))
+(defstruct (user-conversion (:include conversion (rank (+ 3 +conversion+)))))
hunk ./src/overload-resolution.lisp 225
- (< (the fixnum (rank conversion1))
- (the fixnum (rank conversion2)))))
+ (< (the fixnum (conversion-rank conversion1))
+ (the fixnum (conversion-rank conversion2)))))
hunk ./src/overload-resolution.lisp 229
- (if (eq (from conversion1) (from conversion2))
+ (if (eq (pointer-conversion-from conversion1)
+ (pointer-conversion-from conversion2))
hunk ./src/overload-resolution.lisp 232
- (subtypep (to conversion1) (to conversion2))
- (if (eq (to conversion1) (to conversion2))
+ (subtypep (pointer-conversion-to conversion1)
+ (pointer-conversion-to conversion2))
+ (if (eq (pointer-conversion-to conversion1)
+ (pointer-conversion-to conversion2))
hunk ./src/overload-resolution.lisp 237
- (subtypep (from conversion1) (from conversion2))
+ (subtypep (pointer-conversion-from conversion1)
+ (pointer-conversion-from conversion2))
hunk ./src/overload-resolution.lisp 246
- (= (rank conversion1) (rank conversion2)))
+ (= (conversion-rank conversion1) (conversion-rank conversion2)))
hunk ./src/overload-resolution.lisp 277
- `(make-instance ,type
- :conversion-function-name ,(conversion-function name argument)
- [_$_]
+ `(,(symbolicate 'make- (eval type))
+ :function-name ,(conversion-function name argument)
hunk ./src/sb-optimize.lisp 84
- ;; FIXME only cast when needed.
- (cast object
- (find-class (quote ,(class-name [_$_]
- (find-smoke-class
- (get-class method))))))
+ ,(if (eql (type-specifier object)
+ (find-smoke-class (get-class method)))
+ `(pointer object)
+ `(cast object
+ (find-class (quote ,(class-name [_$_]
+ (find-smoke-class
+ (get-class method)))))))
hunk ./src/smoke.lisp 33
- (foreign-slot-value (pointer (get-class method))
+ (foreign-slot-value (smoke-class-pointer (get-class method))
hunk ./src/smoke.lisp 46
- (call-s-method method object-pointer (pointer stack))
- (type-to-lisp (pointer stack) (return-type method))))
+ (call-s-method method object-pointer (call-stack-pointer stack))
+ (type-to-lisp (call-stack-pointer stack) (return-type method))))
hunk ./src/smoke.lisp 51
- (call-s-method method object-pointer (pointer stack))
- (foreign-slot-value (pointer stack) 'smoke-stack-item 'class)))
+ (call-s-method method object-pointer (call-stack-pointer stack))
+ (foreign-slot-value (call-stack-pointer stack) 'smoke-stack-item 'class)))
hunk ./src/smoke.lisp 76
- (call-s-method method (null-pointer) (pointer stack))
- (foreign-slot-value (pointer stack) 'smoke-stack-item 'long)))
+ (call-s-method method (null-pointer) (call-stack-pointer stack))
+ (foreign-slot-value (call-stack-pointer stack) 'smoke-stack-item 'long)))
hunk ./src/smoke.lisp 107
- (foreign-slot-value (pointer (class-of object))
+ (foreign-slot-value (smoke-class-pointer (class-of object))
Wed Jul 8 16:56:52 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* SBCL: compile time overload resolution
hunk ./smoke.mbd 38
+ ("sb-optimize" (:for :sbcl) (:needs "overload-resolution"))
hunk ./src/overload-resolution.lisp 302
- (if-let
- (match (call-using-type exact-match object type))
- (if (eql t match)
- (make-match 'exact-match)
- (make-match 'exact-match match))
- (or (call-using-type promotion object type)
- (call-using-type conversion object type)
- (and user
- (call-using-type user-conversion object type)))))
+ (if-let (match (call-using-type exact-match object type))
+ (if (eql t match)
+ (make-match 'exact-match)
+ (make-match 'exact-match match))
+ (or (call-using-type promotion object type)
+ (call-using-type conversion object type)
+ (and user
+ (call-using-type user-conversion object type)))))
addfile ./src/sb-optimize.lisp
hunk ./src/sb-optimize.lisp 1
+(in-package :smoke)
+
+(declaim (optimize (debug 3)))
+
+(defmacro catch-try ((tag &optional catch-result) catch-form &body body)
+ "Catch TAG in the BODY forms. When TAG is throw CATCH-RESULT is bound
+to the thrown values and result of CATCH-FORM is returned. Otherwise
+the result of BODY is returned and CATCH-FORM is not evaluated."
+ (flet ((catch-block (tag return-block body)
+ `(catch ,tag
+ (return-from ,return-block
+ ,@body))))
+ (let ((return-block (gensym)))
+ `(block ,return-block [_$_]
+ ,(if catch-result
+ `(let ((,catch-result ,(catch-block tag return-block body)))
+ ,catch-form)
+ `(progn ,(catch-block tag return-block body)
+ ,catch-form))))))
+
+(defun type-specifier (lvar)
+ (let ((type (sb-kernel:type-specifier (sb-c::lvar-type lvar))))
+ (if (subtypep type 'smoke-standard-object)
+ (find-class type)
+ type)))
+ [_$_]
+
+(defun give-up-transform (&rest args)
+ (apply #'sb-c::give-up-ir1-transform args))
+
+(defmacro define-transform (name lambda-list &body body)
+ `(sb-c:deftransform ,name (,lambda-list)
+ ,@body))
+
+(defmacro define-known (name)
+ `(sb-c:defknown ,name * *))
+
+(defun method-form (method)
+ `(make-smoke-method
+ :id ,(id method)
+ :smoke (eval ,(get-smoke-variable-for-pointer
+ (smoke method)))))
+ [_$_]
+(defun sequence-form (sequence arguments)
+ (mapcar #'(lambda (sequence argument)
+ (if (symbolp sequence)
+ `(,sequence ,argument)
+ `(,(first sequence) ,argument ,@(rest sequence))))
+ sequence arguments))
+
+
+(defmacro define-resolve-at-compile-time (gf-name)
+ `(eval-when (:compile-toplevel :load-toplevel :execute)
+ (define-known ,gf-name)
+ (sb-c:defoptimizer (,gf-name derive-type) ((object &rest args))
+ (catch-try ('unspecific-type) sb-c::*wild-type*
+ (let ((method (find-best-viable-function-using-types
+ ,(name (fdefinition gf-name))
+ (mapcar #'type-specifier args) (type-specifier object))))
+ (if (and method (class-p (return-type method)))
+ (sb-kernel:single-value-specifier-type
+ (find-smoke-class (get-class (return-type method))))
+ sb-c::*wild-type*))))
+ (define-transform ,gf-name (object &rest args)
+ (when (null args)
+ (give-up-transform "No arguments."))
+ (catch-try ('unspecific-type reason)
+ (give-up-transform "Could not resolve overload at compile time: ~A" reason)
+ (multiple-value-bind (method sequence)
+ (find-best-viable-function-using-types
+ ,(name (fdefinition gf-name))
+ (mapcar #'type-specifier args)
+ (type-specifier object))
+ (let ((argument-names (make-gensym-list (length args))))
+ (when (null method)
+ (give-up-transform "No applicable method."))
+ (if (static-p method)
+ `(s-call ,(method-form method)
+ (null-pointer)
+ (list ,@(sequence-form
+ sequence args)))
+ `(lambda (object ,@argument-names)
+ (s-call ,(method-form method)
+ ;; FIXME only cast when needed.
+ (cast object
+ (find-class (quote ,(class-name [_$_]
+ (find-smoke-class
+ (get-class method))))))
+ (list ,@(sequence-form
+ sequence argument-names)))))))))))
hunk ./src/using-type.lisp 20
-false when it is not; and :MAYBE when the relationship
-could not be determined."
+false when it is not."
hunk ./src/using-type.lisp 32
- nil
+ (if (and (subtypep type 'integer)
+ (not (integer-types-disjunct-p object-type type)))
+ (throw 'unspecific-type (values object-type type))
+ nil)
hunk ./src/using-type.lisp 62
- #+nil [_$_]
hunk ./src/using-type.lisp 76
- #+nil
hunk ./src/using-type.lisp 87
+
+(defun integer-types-disjunct-p (type1 type2)
+ ;; FIXME implement this
+ (declare (ignore type1 type2))
+ nil)
Fri Jul 3 11:50:05 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix methods and method-maps bounds.
hunk ./src/object-map.lisp 43
- (warn "life object ~A" (class-of object))
+ (warn "life object ~A" object)
hunk ./src/objects/method.lisp 88
- (loop for id from 1 to length do
+ (loop for id from 0 below length do ;; exception: methods is < lenght
hunk ./src/overload-resolution.lisp 96
- (end (smoke-array-length (smoke-module-method-maps smoke))))
+ (end (1+ (smoke-array-length (smoke-module-method-maps smoke)))))
Thu Jul 2 23:51:50 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Promption real to double-float
hunk ./src/overload-resolution.lisp 422
+(defun coerce-double-float (number)
+ (float number 0d0))
+
+;; FIXME incomplete
hunk ./src/overload-resolution.lisp 435
- (make-match 'promotion 'coerce-enum)))))
+ (make-match 'promotion 'coerce-enum)))
+ (11 (when (object.typep 'real)
+ (make-match 'promotion 'coerce-double-float)))))
Thu Jul 2 23:51:14 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix infinite loop when showing candidate functions.
hunk ./src/overload-resolution.lisp 528
-Candidates are:~{~T~%~}."
+Candidates are:~{~T~A~%~}."
Thu Jul 2 21:08:40 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Fix undefine init_smoke* C function & cleanup finalizers when a image is saved.
hunk ./smoke.mbd 39
- ("object-map" (:needs "objects"))
+ ("object-map" (:needs "objects" :utils))
hunk ./smoke.mbd 77
- (:supports (:os :linux) (:implementation :sbcl :openmcl))
hunk ./src/object-map.lisp 41
+(eval-on-save ()
+ (loop for object being the hash-value of *object-map* do
+ (warn "life object ~A" (class-of object))
+ (remove-finalizer object)
+ (setf (slot-value object 'pointer) (null-pointer)))
+ (clrhash *object-map*))
+
hunk ./src/smoke.lisp 190
- (eval-startup (:compile-toplevel :execute)
hunk ./src/smoke.lisp 193
- (t (:default ,(format nil "~(~A~)" library))))
- (use-foreign-library ,library))
- (defcvar (,variable ,variable-name :read-only t) :pointer)
+ (t (:default ,(format nil "~(~A~)" library)))))
+ (eval-startup (:compile-toplevel :execute)
+ (load-foreign-library ',library))
+ (eval-startup (:compile-toplevel :execute)
+; (eval-when (:compile-toplevel :load-toplevel :execute)
+; (define-foreign-library ,library
+; (:unix ,(format nil "~(~A~).so.2" library))
+; (t (:default ,(format nil "~(~A~)" library))))
+; (load-foreign-library ',library))
+ (defcvar (,variable ,variable-name
+ :read-only t
+ :library ,library) :pointer)
hunk ./src/smoke.lisp 207
- function-name))
+ function-name)
+ :library ,library)
hunk ./src/utils/image/impl/ccl.lisp 6
+(defmacro eval-on-save (() &body body)
+ `(eval-when (:load-toplevel)
+ (push #'(lambda ()
+ (let ((*package* ,*package*))
+ ,@body))
+ ccl:*save-exit-functions*)))
+
hunk ./src/utils/image/impl/sbcl.lisp 15
+(defmacro eval-on-save (() &body body)
+ `(eval-when (:load-toplevel)
+ (push #'(lambda ()
+ (let ((*package* ,*package*))
+ ,@body))
+ sb-ext:*save-hooks*)))
+
Wed Jul 1 12:54:01 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Spellcheck
hunk ./src/clos.lisp 55
-Note that (LISP-TO-CXX (CXX-TO-LIST SOME-STRING)) will not neccessarily return
-a string equal to SMOME-STRING."
+Note that (LISP-TO-CXX (CXX-TO-LIST SOME-STRING)) will not necessarily return
+a string equal to SOME-STRING."
hunk ./src/clos.lisp 58
- "Downcase, convert _ and dispatch."
+ "Down case, convert _ and dispatch."
hunk ./src/clos.lisp 77
- "Strip leadind Q or K."
+ "Strip leading Q or K."
hunk ./src/clos.lisp 83
- "Upcase, convert _ and dispatch."
+ "Up case, convert _ and dispatch."
hunk ./src/clos.lisp 156
- "No superclass suplied for class ~A" class)
+ "No superclass supplied for class ~A" class)
hunk ./src/clos.lisp 173
- "No superclass suplied for class ~A" class)
+ "No superclass sup-lied for class ~A" class)
hunk ./src/clos.lisp 197
- "Construts a lisp class in PACKAGE for each one in the Smoke module SMOKE."
+ "Constructs a lisp class in PACKAGE for each one in the Smoke module SMOKE."
hunk ./src/clos.lisp 230
- "Returns the class of OBJECT or OBJECT iff it alread is a class."
+ "Returns the class of OBJECT or OBJECT iff it already is a class."
hunk ./src/clos.lisp 431
- (error "No construtor ~A for ~S"
+ (error "No constructor ~A for ~S"
hunk ./src/cxx-method.lisp 78
- "The method ~A must not contatin lambda list keywords." method))
+ "The method ~A must not contain lambda list keywords." method))
hunk ./src/cxx-method.lisp 108
- ;; on startup and the eval stuff is slower.
+ ;; on start up and the eval stuff is slower.
hunk ./src/cxx-method.lisp 123
- ;; -using-classes only cares abount the number of arguments;
+ ;; -using-classes only cares about the number of arguments;
hunk ./src/cxx-method.lisp 155
- "Retruns a compiler-macro form for CXX-GENERIC-FUNCTION that
+ "Returns a compiler-macro form for CXX-GENERIC-FUNCTION that
hunk ./src/method.lisp 98
-;;; mulitiple definiton of a function with the same name.
+;;; multiple definition of a function with the same name.
hunk ./src/method.lisp 120
- (string/= (name method) "tr")) ;; we have a custom qt:tr funciton
+ (string/= (name method) "tr")) ;; we have a custom qt:tr function
hunk ./src/object-map.lisp 29
-;; CLISP has problems with weak hashtables and finalizers.
+;; CLISP has problems with weak hash tables and finalizers.
hunk ./src/object-map.lisp 38
-except object with a non virtual destuctor which had their ownership transfered
+except object with a non virtual destructor which had their ownership transferred
hunk ./src/object-map.lisp 100
- "Adds OBJECT to the pointer -> object map. It can later be retrived
+ "Adds OBJECT to the pointer -> object map. It can later be retrieved
hunk ./src/objects/class.lisp 47
- "Applys FUNCTION to the classes of SMOKE."
+ "Applies FUNCTION to the classes of SMOKE."
hunk ./src/objects/method.lisp 54
-Signals an error when the method is ambigious."
+Signals an error when the method is ambiguous."
hunk ./src/objects/method.lisp 74
- (error "The method ~S of ~S is ambigious" name (name class))) ;;TODO
+ (error "The method ~S of ~S is ambiguous" name (name class))) ;;TODO
hunk ./src/objects/method.lisp 82
- "Applys FUNCTION to the methods of SMOKE.
+ "Applies FUNCTION to the methods of SMOKE.
hunk ./src/objects/method.lisp 169
- "Retruns T when METHOD is static and NIL otherwise."
+ "Returns T when METHOD is static and NIL otherwise."
hunk ./src/objects/method.lisp 185
- "Returns T when METHOD is ambigious and NIL otherwise."
+ "Returns T when METHOD is ambiguous and NIL otherwise."
hunk ./src/objects/stack.lisp 48
- ;; since then they would be alway reacable from Lisp and thus
+ ;; since then they would be always reachable from Lisp and thus
hunk ./src/objects/stack.lisp 53
- :documentation "Objecsts owned by the C++ instance."))
+ :documentation "Objects owned by the C++ instance."))
hunk ./src/objects/stack.lisp 88
- "To many arguments suppliend (Arguments ~A)." args)
+ "To many arguments supplied (Arguments ~A)." args)
hunk ./src/objects/stack.lisp 139
- (:documentation "Returns a clos instance for POINTER."))
+ (:documentation "Returns a CLOS instance for POINTER."))
hunk ./src/objects/type.lisp 120
- ;; For efficency just check if the first byte is a null byte;
+ ;; For efficiency just check if the first byte is a null byte;
hunk ./src/overload-resolution.lisp 159
- "Returns a list of all superclasses of CLASS and CLASS itself."
+ "Returns a list of all super-classes of CLASS and CLASS itself."
hunk ./src/overload-resolution.lisp 240
- "Retruns true when CONVERSION1 is better than CONVERSION2.")
+ "Returns true when CONVERSION1 is better than CONVERSION2.")
hunk ./src/overload-resolution.lisp 300
- "Retruns a conversion sequence to convert a instance of type CLASS
+ "Retrains a conversion sequence to convert a instance of type CLASS
hunk ./src/overload-resolution.lisp 350
- ;; FIXME test for ambigious overload #'conversion=
+ ;; FIXME test for ambiguous overload #'conversion=
hunk ./src/overload-resolution.lisp 528
-Candidtes are:~{~T~%~}."
+Candidates are:~{~T~%~}."
hunk ./src/smoke.lisp 81
-Calls the destrutor and frees the memory."
+Calls the destructor and frees the memory."
hunk ./src/utils/sbcl-bundle.lisp 21
- "could not remove temponary directory ~A"
+ "could not remove temporary directory ~A"