mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Deprecate Val(Func*) ctor, replace with one using IntrusivePtr
This commit is contained in:
parent
4a2221b878
commit
a031f5b727
7 changed files with 26 additions and 22 deletions
13
src/Val.cc
13
src/Val.cc
|
@ -42,11 +42,12 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
Val::Val(Func* f)
|
||||
: val(f), type({NewRef{}, f->FType()})
|
||||
{
|
||||
::Ref(val.func_val);
|
||||
}
|
||||
Val::Val(Func* f) : Val({NewRef{}, f})
|
||||
{}
|
||||
|
||||
Val::Val(IntrusivePtr<Func> f)
|
||||
: val(f.release()), type({NewRef{}, val.func_val->FType()})
|
||||
{}
|
||||
|
||||
static const IntrusivePtr<FileType>& GetStringFileType() noexcept
|
||||
{
|
||||
|
@ -118,7 +119,7 @@ IntrusivePtr<Val> Val::DoClone(CloneState* state)
|
|||
// Derived classes are responsible for this. Exception:
|
||||
// Functions and files. There aren't any derived classes.
|
||||
if ( type->Tag() == TYPE_FUNC )
|
||||
return make_intrusive<Val>(AsFunc()->DoClone().get());
|
||||
return make_intrusive<Val>(AsFunc()->DoClone());
|
||||
|
||||
if ( type->Tag() == TYPE_FILE )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue