No need to construct a SmokeBinding per Smoke module.
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)