diff options
| author | Rusty Wagner <rusty@vector35.com> | 2017-01-11 22:58:19 -0500 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2017-01-11 22:58:19 -0500 |
| commit | 7e154a952fe5856b7cf650e2646ebc410b1fb506 (patch) | |
| tree | 4eb500f5cb7875946339e069b6a57d839b69ae0e /architecture.cpp | |
| parent | 844e1aa5b4f89de2ffc1990824b094c553068642 (diff) | |
Add a qualified name object in the C API
Diffstat (limited to 'architecture.cpp')
| -rw-r--r-- | architecture.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/architecture.cpp b/architecture.cpp index 657d7bf0..0e25fa85 100644 --- a/architecture.cpp +++ b/architecture.cpp @@ -769,23 +769,17 @@ bool Architecture::ParseTypesFromSource(const string& source, const string& file for (size_t i = 0; i < result.typeCount; i++) { - QualifiedName name; - for (size_t j = 0; j < result.types[i].nameCount; j++) - name.push_back(result.types[i].name[j]); + QualifiedName name = QualifiedName::FromAPIObject(&result.types[i].name); types[name] = new Type(BNNewTypeReference(result.types[i].type)); } for (size_t i = 0; i < result.variableCount; i++) { - QualifiedName name; - for (size_t j = 0; j < result.variables[i].nameCount; j++) - name.push_back(result.variables[i].name[j]); + QualifiedName name = QualifiedName::FromAPIObject(&result.variables[i].name); types[name] = new Type(BNNewTypeReference(result.variables[i].type)); } for (size_t i = 0; i < result.functionCount; i++) { - QualifiedName name; - for (size_t j = 0; j < result.functions[i].nameCount; j++) - name.push_back(result.functions[i].name[j]); + QualifiedName name = QualifiedName::FromAPIObject(&result.functions[i].name); types[name] = new Type(BNNewTypeReference(result.functions[i].type)); } BNFreeTypeParserResult(&result); @@ -817,23 +811,17 @@ bool Architecture::ParseTypesFromSourceFile(const string& fileName, map<Qualifie for (size_t i = 0; i < result.typeCount; i++) { - QualifiedName name; - for (size_t j = 0; j < result.types[i].nameCount; j++) - name.push_back(result.types[i].name[j]); + QualifiedName name = QualifiedName::FromAPIObject(&result.types[i].name); types[name] = new Type(BNNewTypeReference(result.types[i].type)); } for (size_t i = 0; i < result.variableCount; i++) { - QualifiedName name; - for (size_t j = 0; j < result.variables[i].nameCount; j++) - name.push_back(result.variables[i].name[j]); + QualifiedName name = QualifiedName::FromAPIObject(&result.variables[i].name); variables[name] = new Type(BNNewTypeReference(result.variables[i].type)); } for (size_t i = 0; i < result.functionCount; i++) { - QualifiedName name; - for (size_t j = 0; j < result.functions[i].nameCount; j++) - name.push_back(result.functions[i].name[j]); + QualifiedName name = QualifiedName::FromAPIObject(&result.functions[i].name); functions[name] = new Type(BNNewTypeReference(result.functions[i].type)); } BNFreeTypeParserResult(&result); |
