From 19fa73a2593d730b47e6b54f76762fcac109e25d Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Tue, 24 Aug 2021 15:12:18 -0400 Subject: Remove CreateEnumerationBuilderOfWidth instead just use the normal API and pass nullptr as arch --- binaryninjacore.h | 1 - type.cpp | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/binaryninjacore.h b/binaryninjacore.h index ae2b73e4..59a7141e 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -4687,7 +4687,6 @@ __attribute__ ((format (printf, 1, 2))) BINARYNINJACOREAPI BNTypeBuilder* BNCreateStructureTypeBuilderWithBuilder(BNStructureBuilder* s); BINARYNINJACOREAPI BNTypeBuilder* BNCreateEnumerationTypeBuilder(BNArchitecture* arch, BNEnumeration* e, size_t width, bool isSigned); BINARYNINJACOREAPI BNTypeBuilder* BNCreateEnumerationTypeBuilderWithBuilder(BNArchitecture* arch, BNEnumerationBuilder* e, size_t width, bool isSigned); - BINARYNINJACOREAPI BNTypeBuilder* BNCreateEnumerationTypeBuilderOfWidth(BNEnumeration* e, size_t width, bool isSigned); BINARYNINJACOREAPI BNTypeBuilder* BNCreatePointerTypeBuilder(BNArchitecture* arch, const BNTypeWithConfidence* const type, BNBoolWithConfidence* cnst, BNBoolWithConfidence* vltl, BNReferenceType refType); BINARYNINJACOREAPI BNTypeBuilder* BNCreatePointerTypeBuilderOfWidth(size_t width, const BNTypeWithConfidence* const type, diff --git a/type.cpp b/type.cpp index 4429bb60..f74782b5 100644 --- a/type.cpp +++ b/type.cpp @@ -906,6 +906,10 @@ Confidence> Type::WithConfidence(uint8_t conf) return Confidence>(this, conf); } +bool Type::IsReferenceOfType(BNNamedTypeReferenceClass refType) +{ + return (GetClass() == NamedTypeReferenceClass) && (GetNamedTypeReference()->GetTypeClass() == refType); +} QualifiedName Type::GetStructureName() const { @@ -1406,7 +1410,7 @@ TypeBuilder TypeBuilder::EnumerationType(Architecture* arch, EnumerationBuilder* TypeBuilder TypeBuilder::EnumerationType(Enumeration* enm, size_t width, bool isSigned) { - return TypeBuilder(BNCreateEnumerationTypeBuilderOfWidth(enm->GetObject(), width, isSigned)); + return TypeBuilder::EnumerationType(enm, width, isSigned); } TypeBuilder TypeBuilder::PointerType(Architecture* arch, const Confidence>& type, -- cgit v1.3.1