}
if(arrayType && arrayType.type == structClass)
- value.p = new byte[arrayType.structSize];
+ value.p = new0 byte[arrayType.structSize];
itemResult = GetValue(arrayType, value);
if(itemResult == success)
{
if(type && type.type == structClass)
{
- value.p = (byte *)*object + offset;
+ if(member)
+ {
+ value.p = (byte *)*object + offset;
+ memset(value.p, 0, type.structSize);
+ }
+ else if(prop)
+ {
+ value.p = new0 byte[type.structSize];
+ }
}
ch = 0;
SkipEmpty();
}
else
result = syntaxError;
+
+ if(prop && type.type == structClass)
+ {
+ delete value.p;
+ }
}
}
else if(ch && ch != '}' && ch != ',')
if(result == success && type.type == unitClass)
{
// Convert to reference unit
- Class dataType;
Property prop;
for(prop = type.conversions.first; prop; prop = prop.next)
{
value.i = ((int(*)(int))(void *)prop.Get)(value.i);
else if(!strcmp(dts, "int64"))
value.i64 = ((int64(*)(int64))(void *)prop.Get)(value.i64);
+ else if(!strcmp(dts, "unsigned int"))
+ value.ui = ((uint(*)(uint))(void *)prop.Get)(value.ui);
+ else if(!strcmp(dts, "uint64"))
+ value.ui64 = ((uint64(*)(uint64))(void *)prop.Get)(value.ui64);
}
else
break;
}
else if(type.type == structClass)
{
- value.p = new byte[type.structSize];
+ value.p = new0 byte[type.structSize];
((void (*)(void *, void *))(void *)prop.Get)(object, value.p);
}
else