[Kde-bindings] KDE/kdebindings/csharp/qyoto
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Tue Jun 12 11:27:46 UTC 2007
SVN commit 674410 by rdale:
* When the stack was allocated for a virtual method callback, an entry
wasn't being included for the reply value
* When the arguments for a virtual method callback were copied to the
C# arg stack, they were off by one
* The colliding mice example currently crashes with memory corruption
problems
CCMAIL: kde-bindings at kde.org
M +9 -0 ChangeLog
M +21 -21 src/SmokeInvocation.cs
M +14 -16 src/handlers.cpp
M +1 -1 src/qyoto.cpp
--- trunk/KDE/kdebindings/csharp/qyoto/ChangeLog #674409:674410
@@ -1,3 +1,12 @@
+2007-06-12 Richard Dale <rdale at foton.es>
+
+ * When the stack was allocated for a virtual method callback, an entry
+ wasn't being included for the reply value
+ * When the arguments for a virtual method callback were copied to the
+ C# arg stack, they were off by one
+ * The colliding mice example currently crashes with memory corruption
+ problems
+
2007-06-10 Richard Dale <rdale at foton.es>
* Added an event callback handler to look for ChildAdded and ChildRemoved
--- trunk/KDE/kdebindings/csharp/qyoto/src/SmokeInvocation.cs #674409:674410
@@ -167,45 +167,45 @@
for (int i = 0; i < args.Length; i++) {
if (parameters[i].ParameterType == typeof(bool)) {
- args[i] = stackPtr[i].s_bool;
+ args[i] = stackPtr[i+1].s_bool;
} else if (parameters[i].ParameterType == typeof(sbyte)) {
- args[i] = stackPtr[i].s_char;
+ args[i] = stackPtr[i+1].s_char;
} else if (parameters[i].ParameterType == typeof(byte)) {
- args[i] = stackPtr[i].s_uchar;
+ args[i] = stackPtr[i+1].s_uchar;
} else if (parameters[i].ParameterType == typeof(short)) {
- args[i] = stackPtr[i].s_short;
+ args[i] = stackPtr[i+1].s_short;
} else if (parameters[i].ParameterType == typeof(ushort)) {
- args[i] = stackPtr[i].s_ushort;
+ args[i] = stackPtr[i+1].s_ushort;
} else if (parameters[i].ParameterType == typeof(int)) {
- args[i] = stackPtr[i].s_int;
+ args[i] = stackPtr[i+1].s_int;
} else if (parameters[i].ParameterType.IsEnum) {
- args[i] = Enum.ToObject(parameters[i].ParameterType, stackPtr[i].s_int);
+ args[i] = Enum.ToObject(parameters[i].ParameterType, stackPtr[i+1].s_int);
} else if (parameters[i].ParameterType == typeof(uint)) {
- args[i] = stackPtr[i].s_uint;
+ args[i] = stackPtr[i+1].s_uint;
} else if (parameters[i].ParameterType == typeof(long)) {
- args[i] = stackPtr[i].s_long;
+ args[i] = stackPtr[i+1].s_long;
} else if (parameters[i].ParameterType == typeof(ulong)) {
- args[i] = stackPtr[i].s_ulong;
+ args[i] = stackPtr[i+1].s_ulong;
} else if (parameters[i].ParameterType == typeof(float)) {
- args[i] = stackPtr[i].s_float;
+ args[i] = stackPtr[i+1].s_float;
} else if (parameters[i].ParameterType == typeof(double)) {
- args[i] = stackPtr[i].s_double;
+ args[i] = stackPtr[i+1].s_double;
} else if (parameters[i].ParameterType == typeof(string)) {
- if (stackPtr[i].s_class != IntPtr.Zero) {
- args[i] = (string) ((GCHandle) stackPtr[i].s_class).Target;
+ if (stackPtr[i+1].s_class != IntPtr.Zero) {
+ args[i] = (string) ((GCHandle) stackPtr[i+1].s_class).Target;
#if DEBUG
- DebugGCHandle.Free((GCHandle) stackPtr[i].s_class);
+ DebugGCHandle.Free((GCHandle) stackPtr[i+1].s_class);
#else
- ((GCHandle) stackPtr[i].s_class).Free();
+ ((GCHandle) stackPtr[i+1].s_class).Free();
#endif
}
} else {
- if (stackPtr[i].s_class != IntPtr.Zero) {
- args[i] = ((GCHandle) stackPtr[i].s_class).Target;
+ if (stackPtr[i+1].s_class != IntPtr.Zero) {
+ args[i] = ((GCHandle) stackPtr[i+1].s_class).Target;
#if DEBUG
- DebugGCHandle.Free((GCHandle) stackPtr[i].s_class);
+ DebugGCHandle.Free((GCHandle) stackPtr[i+1].s_class);
#else
- ((GCHandle) stackPtr[i].s_class).Free();
+ ((GCHandle) stackPtr[i+1].s_class).Free();
#endif
}
}
@@ -447,7 +447,7 @@
className,
signature,
returnType,
- args.Length );
+ args.Length / 2 );
}
#endif
--- trunk/KDE/kdebindings/csharp/qyoto/src/handlers.cpp #674409:674410
@@ -1746,8 +1746,6 @@
{ "QList<QPolygonF>", marshall_QPolygonFList },
{ "QList<QRectF>", marshall_QRectFList },
{ "QList<QRectF>&", marshall_QRectFList },
- { "QList<QTableWidgetItem*>", marshall_QTableWidgetItemList },
- { "QList<QTableWidgetItem*>&", marshall_QTableWidgetItemList },
{ "QList<QStandardItem*>", marshall_QStandardItemList },
{ "QList<QStandardItem*>&", marshall_QStandardItemList },
{ "QList<QTableWidgetItem*>", marshall_QTableWidgetItemList },
@@ -1838,25 +1836,25 @@
QHash<QString,TypeHandler *> type_handlers;
void install_handlers(TypeHandler *h) {
- while(h->name) {
- type_handlers.insert(h->name, h);
- h++;
- }
+ while(h->name) {
+ type_handlers.insert(h->name, h);
+ h++;
+ }
}
Marshall::HandlerFn getMarshallFn(const SmokeType &type) {
- if(type.elem())
- return marshall_basetype;
- if(!type.name())
- return marshall_void;
+ if (type.elem())
+ return marshall_basetype;
+ if (!type.name())
+ return marshall_void;
TypeHandler *h = type_handlers[type.name()];
- if(h == 0 && type.isConst() && strlen(type.name()) > strlen("const ")) {
+ if (h == 0 && type.isConst() && strlen(type.name()) > strlen("const ")) {
h = type_handlers[type.name() + strlen("const ")];
- }
+ }
- if(h != 0) {
- return h->fn;
- }
+ if(h != 0) {
+ return h->fn;
+ }
- return marshall_unknown;
+ return marshall_unknown;
}
--- trunk/KDE/kdebindings/csharp/qyoto/src/qyoto.cpp #674409:674410
@@ -452,7 +452,7 @@
VirtualMethodCall(Smoke *smoke, Smoke::Index meth, Smoke::Stack stack, void * obj, void * overridenMethod) :
_smoke(smoke), _method(meth), _stack(stack), _obj(obj), _overridenMethod(overridenMethod), _cur(-1), _sp(0), _called(false) {
- _sp = new Smoke::StackItem[method().numArgs];
+ _sp = new Smoke::StackItem[method().numArgs + 1];
_args = _smoke->argumentList + method().args;
}
More information about the Kde-bindings
mailing list