@@ -38,22 +38,22 @@ bool DataRenderer::IsStructOfTypeName(Type* type, const string& name, vector<pai
38
38
39
39
40
40
bool DataRenderer::IsValidForDataCallback (void * ctxt, BNBinaryView* view, uint64_t addr, BNType* type,
41
- BNTypeContext** typeCtx, size_t ctxCount)
41
+ BNTypeContext* typeCtx, size_t ctxCount)
42
42
{
43
43
DataRenderer* renderer = (DataRenderer*)ctxt;
44
44
Ref<BinaryView> viewObj = new BinaryView (BNNewViewReference (view));
45
45
Ref<Type> typeObj = new Type (BNNewTypeReference (type));
46
46
vector<pair<Type*, size_t >> context;
47
47
context.reserve (ctxCount);
48
48
for (size_t i = 0 ; i < ctxCount; i++)
49
- context.push_back ({new Type (BNNewTypeReference (typeCtx[i]-> type )), typeCtx[i]-> offset });
49
+ context.push_back ({new Type (BNNewTypeReference (typeCtx[i]. type )), typeCtx[i]. offset });
50
50
51
51
return renderer->IsValidForData (viewObj, addr, typeObj, context);
52
52
}
53
53
54
54
55
55
BNDisassemblyTextLine* DataRenderer::GetLinesForDataCallback (void * ctxt, BNBinaryView* view, uint64_t addr, BNType* type,
56
- const BNInstructionTextToken* prefix, size_t prefixCount, size_t width, size_t * count, BNTypeContext** typeCtx,
56
+ const BNInstructionTextToken* prefix, size_t prefixCount, size_t width, size_t * count, BNTypeContext* typeCtx,
57
57
size_t ctxCount)
58
58
{
59
59
DataRenderer* renderer = (DataRenderer*)ctxt;
@@ -64,7 +64,7 @@ BNDisassemblyTextLine* DataRenderer::GetLinesForDataCallback(void* ctxt, BNBinar
64
64
vector<pair<Type*, size_t >> context;
65
65
context.reserve (ctxCount);
66
66
for (size_t i = 0 ; i < ctxCount; i++)
67
- context.push_back ({new Type (BNNewTypeReference (typeCtx[i]-> type )), typeCtx[i]-> offset });
67
+ context.push_back ({new Type (BNNewTypeReference (typeCtx[i]. type )), typeCtx[i]. offset });
68
68
auto lines = renderer->GetLinesForData (viewObj, addr, typeObj, prefixes, width, context);
69
69
*count = lines.size ();
70
70
BNDisassemblyTextLine* buf = new BNDisassemblyTextLine[lines.size ()];
@@ -91,11 +91,11 @@ void DataRenderer::FreeCallback(void* ctxt)
91
91
92
92
bool DataRenderer::IsValidForData (BinaryView* data, uint64_t addr, Type* type, vector<pair<Type*, size_t >>& context)
93
93
{
94
- BNTypeContext** typeCtx = new BNTypeContext* [context.size ()];
94
+ BNTypeContext* typeCtx = new BNTypeContext[context.size ()];
95
95
for (size_t i = 0 ; i < context.size (); i++)
96
96
{
97
- typeCtx[i]-> type = context[i].first ->GetObject ();
98
- typeCtx[i]-> offset = context[i].second ;
97
+ typeCtx[i]. type = context[i].first ->GetObject ();
98
+ typeCtx[i]. offset = context[i].second ;
99
99
}
100
100
bool result = BNIsValidForData (m_object, data->GetObject (), addr, type->GetObject (), typeCtx, context.size ());
101
101
delete[] typeCtx;
@@ -107,11 +107,11 @@ vector<DisassemblyTextLine> DataRenderer::GetLinesForData(BinaryView* data, uint
107
107
const std::vector<InstructionTextToken>& prefix, size_t width, vector<pair<Type*, size_t >>& context)
108
108
{
109
109
BNInstructionTextToken* prefixes = InstructionTextToken::CreateInstructionTextTokenList (prefix);
110
- BNTypeContext** typeCtx = new BNTypeContext* [context.size ()];
110
+ BNTypeContext* typeCtx = new BNTypeContext[context.size ()];
111
111
for (size_t i = 0 ; i < context.size (); i++)
112
112
{
113
- typeCtx[i]-> type = context[i].first ->GetObject ();
114
- typeCtx[i]-> offset = context[i].second ;
113
+ typeCtx[i]. type = context[i].first ->GetObject ();
114
+ typeCtx[i]. offset = context[i].second ;
115
115
}
116
116
size_t count = 0 ;
117
117
BNDisassemblyTextLine* lines = BNGetLinesForData (m_object, data->GetObject (), addr, type->GetObject (), prefixes,
0 commit comments