mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Deprecant ListVal::Append(Val*) and add IntrusivePtr version
This commit is contained in:
parent
df65d1e829
commit
b422f68b88
9 changed files with 43 additions and 31 deletions
|
@ -285,7 +285,7 @@ IntrusivePtr<ListVal> DNS_Mapping::Addrs()
|
|||
auto addrs_val = make_intrusive<ListVal>(TYPE_ADDR);
|
||||
|
||||
for ( int i = 0; i < num_addrs; ++i )
|
||||
addrs_val->Append(new AddrVal(addrs[i]));
|
||||
addrs_val->Append(make_intrusive<AddrVal>(addrs[i]));
|
||||
}
|
||||
|
||||
return addrs_val;
|
||||
|
@ -478,7 +478,7 @@ static IntrusivePtr<TableVal> fake_name_lookup_result(const char* name)
|
|||
hash128_t hash;
|
||||
KeyedHash::StaticHash128(name, strlen(name), &hash);
|
||||
auto hv = make_intrusive<ListVal>(TYPE_ADDR);
|
||||
hv->Append(new AddrVal(reinterpret_cast<const uint32_t*>(&hash)));
|
||||
hv->Append(make_intrusive<AddrVal>(reinterpret_cast<const uint32_t*>(&hash)));
|
||||
return hv->ToSetVal();
|
||||
}
|
||||
|
||||
|
@ -900,7 +900,7 @@ IntrusivePtr<ListVal> DNS_Mgr::AddrListDelta(ListVal* al1, ListVal* al2)
|
|||
|
||||
if ( j >= al2->Length() )
|
||||
// Didn't find it.
|
||||
delta->Append(al1->Index(i)->Ref());
|
||||
delta->Append({NewRef{}, al1->Index(i)});
|
||||
}
|
||||
|
||||
return delta;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue