[Kde-bindings] KDE/kdebindings
Arno Rehn
kde at arnorehn.de
Sun Apr 18 15:59:18 UTC 2010
SVN commit 1116092 by arnorehn:
The Qt stack only contains simple pointers to primitive types,
not pointers to pointers. Fixes crashes when connecting to
signals with QFlags arguments.
Eliminate the redundant *p pointer.
CCMAIL: kde-bindings at kde.org
M +15 -16 csharp/qyoto/src/qyotoshared.cpp
M +15 -16 ruby/qtruby/src/marshall_types.cpp
--- trunk/KDE/kdebindings/csharp/qyoto/src/qyotoshared.cpp #1116091:1116092
@@ -182,59 +182,58 @@
default: // case xmoc_ptr:
{
const SmokeType &t = args[i]->st;
- void *p = o;
switch(t.elem()) {
case Smoke::t_bool:
- stack[j].s_bool = **(bool**)o;
+ stack[j].s_bool = *(bool*)o;
break;
case Smoke::t_char:
- stack[j].s_char = **(char**)o;
+ stack[j].s_char = *(char*)o;
break;
case Smoke::t_uchar:
- stack[j].s_uchar = **(unsigned char**)o;
+ stack[j].s_uchar = *(unsigned char*)o;
break;
case Smoke::t_short:
- stack[j].s_short = **(short**)p;
+ stack[j].s_short = *(short*)o;
break;
case Smoke::t_ushort:
- stack[j].s_ushort = **(unsigned short**)p;
+ stack[j].s_ushort = *(unsigned short*)o;
break;
case Smoke::t_int:
- stack[j].s_int = **(int**)p;
+ stack[j].s_int = *(int*)o;
break;
case Smoke::t_uint:
- stack[j].s_uint = **(unsigned int**)p;
+ stack[j].s_uint = *(unsigned int*)o;
break;
case Smoke::t_long:
- stack[j].s_long = **(long**)p;
+ stack[j].s_long = *(long*)o;
break;
case Smoke::t_ulong:
- stack[j].s_ulong = **(unsigned long**)p;
+ stack[j].s_ulong = *(unsigned long*)o;
break;
case Smoke::t_float:
- stack[j].s_float = **(float**)p;
+ stack[j].s_float = *(float*)o;
break;
case Smoke::t_double:
- stack[j].s_double = **(double**)p;
+ stack[j].s_double = *(double*)o;
break;
case Smoke::t_enum:
{
Smoke::EnumFn fn = SmokeClass(t).enumFn();
if (!fn) {
qWarning("Unknown enumeration %s\n", t.name());
- stack[j].s_enum = **(int**)p;
+ stack[j].s_enum = *(int*)o;
break;
}
Smoke::Index id = t.typeId();
- (*fn)(Smoke::EnumToLong, id, p, stack[j].s_enum);
+ (*fn)(Smoke::EnumToLong, id, o, stack[j].s_enum);
}
break;
case Smoke::t_class:
case Smoke::t_voidp:
if (strchr(t.name(), '*') != 0) {
- stack[j].s_voidp = *(void **)p;
+ stack[j].s_voidp = *(void **)o;
} else {
- stack[j].s_voidp = p;
+ stack[j].s_voidp = o;
}
break;
}
--- trunk/KDE/kdebindings/ruby/qtruby/src/marshall_types.cpp #1116091:1116092
@@ -260,59 +260,58 @@
default: // case xmoc_ptr:
{
const SmokeType &t = args[i]->st;
- void *p = o;
switch(t.elem()) {
case Smoke::t_bool:
- stack[j].s_bool = **(bool**)o;
+ stack[j].s_bool = *(bool*)o;
break;
case Smoke::t_char:
- stack[j].s_char = **(char**)o;
+ stack[j].s_char = *(char*)o;
break;
case Smoke::t_uchar:
- stack[j].s_uchar = **(unsigned char**)o;
+ stack[j].s_uchar = *(unsigned char*)o;
break;
case Smoke::t_short:
- stack[j].s_short = **(short**)p;
+ stack[j].s_short = *(short*)o;
break;
case Smoke::t_ushort:
- stack[j].s_ushort = **(unsigned short**)p;
+ stack[j].s_ushort = *(unsigned short*)o;
break;
case Smoke::t_int:
- stack[j].s_int = **(int**)p;
+ stack[j].s_int = *(int*)o;
break;
case Smoke::t_uint:
- stack[j].s_uint = **(unsigned int**)p;
+ stack[j].s_uint = *(unsigned int*)o;
break;
case Smoke::t_long:
- stack[j].s_long = **(long**)p;
+ stack[j].s_long = *(long*)o;
break;
case Smoke::t_ulong:
- stack[j].s_ulong = **(unsigned long**)p;
+ stack[j].s_ulong = *(unsigned long*)o;
break;
case Smoke::t_float:
- stack[j].s_float = **(float**)p;
+ stack[j].s_float = *(float*)o;
break;
case Smoke::t_double:
- stack[j].s_double = **(double**)p;
+ stack[j].s_double = *(double*)o;
break;
case Smoke::t_enum:
{
Smoke::EnumFn fn = SmokeClass(t).enumFn();
if (!fn) {
rb_warning("Unknown enumeration %s\n", t.name());
- stack[j].s_enum = **(int**)p;
+ stack[j].s_enum = *(int*)o;
break;
}
Smoke::Index id = t.typeId();
- (*fn)(Smoke::EnumToLong, id, p, stack[j].s_enum);
+ (*fn)(Smoke::EnumToLong, id, o, stack[j].s_enum);
}
break;
case Smoke::t_class:
case Smoke::t_voidp:
if (strchr(t.name(), '*') != 0) {
- stack[j].s_voidp = *(void **)p;
+ stack[j].s_voidp = *(void **)o;
} else {
- stack[j].s_voidp = p;
+ stack[j].s_voidp = o;
}
break;
}
More information about the Kde-bindings
mailing list