From: Jerome St-Louis Date: Sat, 13 Jun 2015 05:51:34 +0000 (-0400) Subject: ecere/sys/JSON: Fixed issues on 32 bit ARM platform X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=commitdiff_plain;h=8e8e339c5434e4123a34e8845675c1624f7308b9 ecere/sys/JSON: Fixed issues on 32 bit ARM platform - GuiConfigWindow template argument properties were not being invoked properly --- diff --git a/ecere/src/sys/JSON.ec b/ecere/src/sys/JSON.ec index fbdef26..c11c706 100644 --- a/ecere/src/sys/JSON.ec +++ b/ecere/src/sys/JSON.ec @@ -439,6 +439,7 @@ public: Property prop = null; Class type = null; bool isKey = false; + bool isTemplateArg = false; uint offset = 0; if(objectType) @@ -448,12 +449,14 @@ public: { prop = eClass_FindProperty(objectType, "key", objectType.module); type = mapKeyClass; + isTemplateArg = true; isKey = true; } else if(mapDataClass && !strcmp(string, "value")) { prop = eClass_FindProperty(objectType, "value", objectType.module); type = mapDataClass; + isTemplateArg = true; } else { @@ -609,7 +612,10 @@ public: } else { - ((void (*)(void *, void *))(void *)prop.Set)(*object, value.p); + if(isTemplateArg) + ((void (*)(void *, uint64))(void *)prop.Set)(*object, (uint64)(uintptr)value.p); + else + ((void (*)(void *, void *))(void *)prop.Set)(*object, value.p); } } } @@ -1115,14 +1121,22 @@ static bool _WriteJSONObject(File f, Class objectType, void * object, int indent if(!prop.conversion && (!prop.IsSet || prop.IsSet(object))) { DataValue value { }; + bool isTemplateArg = false; Class type; if(mapKeyClass && !strcmp(prop.name, "key")) + { + isTemplateArg = true; type = mapKeyClass; + } else if(mapDataClass && !strcmp(prop.name, "value")) + { + isTemplateArg = true; type = mapDataClass; + } else type = eSystem_FindClass(__thisModule, prop.dataTypeString); + if(!type) type = eSystem_FindClass(__thisModule.application, prop.dataTypeString); if(!type) @@ -1169,7 +1183,10 @@ static bool _WriteJSONObject(File f, Class objectType, void * object, int indent } else { - value.p = ((void *(*)(void *))(void *)prop.Get)(object); + if(isTemplateArg) + value.p = (void *)(uintptr)((uint64 (*)(void *))(void *)prop.Get)(object); + else + value.p = ((void *(*)(void *))(void *)prop.Get)(object); } if(!isFirst) f.Puts(",\n");