mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 19:36:11 +00:00
Fixed loading of types
This commit is contained in:
parent
f59797fb3d
commit
a2465ee0bb
@ -3529,8 +3529,7 @@ QList<TypeDescription> CutterCore::getAllPrimitiveTypes()
|
||||
TypeDescription exp;
|
||||
|
||||
exp.type = typeObject[RJsonKey::type].toString();
|
||||
exp.size = typeObject[RJsonKey::size].toVariant().toULongLong();
|
||||
exp.format = typeObject[RJsonKey::format].toString();
|
||||
exp.size = (int)typeObject[RJsonKey::size].toVariant().toULongLong();
|
||||
exp.category = tr("Primitive");
|
||||
primitiveTypes << exp;
|
||||
}
|
||||
@ -3549,8 +3548,7 @@ QList<TypeDescription> CutterCore::getAllUnions()
|
||||
|
||||
TypeDescription exp;
|
||||
|
||||
exp.type = typeObject[RJsonKey::type].toString();
|
||||
exp.size = typeObject[RJsonKey::size].toVariant().toULongLong();
|
||||
exp.type = typeObject[RJsonKey::name].toString();
|
||||
exp.category = "Union";
|
||||
unions << exp;
|
||||
}
|
||||
@ -3569,8 +3567,8 @@ QList<TypeDescription> CutterCore::getAllStructs()
|
||||
|
||||
TypeDescription exp;
|
||||
|
||||
exp.type = typeObject[RJsonKey::type].toString();
|
||||
exp.size = typeObject[RJsonKey::size].toVariant().toULongLong();
|
||||
exp.type = typeObject[RJsonKey::name].toString();
|
||||
exp.size = 0;
|
||||
exp.category = "Struct";
|
||||
structs << exp;
|
||||
}
|
||||
@ -3584,9 +3582,12 @@ QList<TypeDescription> CutterCore::getAllEnums()
|
||||
QList<TypeDescription> enums;
|
||||
|
||||
QJsonObject typesObject = cmdj("tej").object();
|
||||
for (QString key : typesObject.keys()) {
|
||||
for (const QJsonValue value : typesObject.keys()) {
|
||||
QJsonObject typeObject = value.toObject();
|
||||
|
||||
TypeDescription exp;
|
||||
exp.type = key;
|
||||
|
||||
exp.type = typeObject[RJsonKey::name].toString();
|
||||
exp.size = 0;
|
||||
exp.category = "Enum";
|
||||
enums << exp;
|
||||
@ -3601,9 +3602,12 @@ QList<TypeDescription> CutterCore::getAllTypedefs()
|
||||
QList<TypeDescription> typeDefs;
|
||||
|
||||
QJsonObject typesObject = cmdj("ttj").object();
|
||||
for (QString key : typesObject.keys()) {
|
||||
for (const QJsonValue value : typesObject.keys()) {
|
||||
QJsonObject typeObject = value.toObject();
|
||||
|
||||
TypeDescription exp;
|
||||
exp.type = key;
|
||||
|
||||
exp.type = typeObject[RJsonKey::name].toString();
|
||||
exp.size = 0;
|
||||
exp.category = "Typedef";
|
||||
typeDefs << exp;
|
||||
|
Loading…
Reference in New Issue
Block a user