Minor whitespace fixes during merge.

* 'smart_ptr' of https://github.com/MaxKellermann/zeek:
  OpaqueVal: remove misplaced `virtual` keywords
  CompHash: use class IntrusivePtr for the `type` field
  IntrusivePtr: replace the "add_ref" parameter with tag structs
  IntrusivePtr: remove reset(), nobody uses it
  IntrusivePtr: remove ordering operators
  IntrusivePtr: rename detach() to release()
  IntrusivePtr: move nullptr initializer to field declaration
This commit is contained in:
Jon Siwek 2020-02-21 10:14:05 -08:00
commit 38b25cf38d
18 changed files with 129 additions and 119 deletions

View file

@ -1352,7 +1352,8 @@ void TableVal::Init(TableType* t)
else
subnets = 0;
table_hash = new CompositeHash(table_type->Indices());
table_hash = new CompositeHash(IntrusivePtr<TypeList>(NewRef{},
table_type->Indices()));
val.table_val = new PDict<TableEntryVal>;
val.table_val->SetDeleteFunc(table_entry_val_delete_func);
}
@ -1984,7 +1985,7 @@ void TableVal::CallChangeFunc(const Val* index, Val* old_value, OnChangeType tpe
try
{
IntrusivePtr<Val> thefunc{change_func->Eval(nullptr), false};
IntrusivePtr<Val> thefunc{AdoptRef{}, change_func->Eval(nullptr)};
if ( ! thefunc )
{
@ -3273,7 +3274,7 @@ Val* cast_value_to_type(Val* v, BroType* t)
if ( ! dv )
return 0;
return static_cast<bro_broker::DataVal *>(dv)->castTo(t).detach();
return static_cast<bro_broker::DataVal *>(dv)->castTo(t).release();
}
return 0;