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"))