mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 00:28:21 +00:00
Val: use C++ initializers
This commit is contained in:
parent
4a5473c572
commit
59b5e6b7dc
2 changed files with 14 additions and 41 deletions
19
src/Val.cc
19
src/Val.cc
|
@ -38,28 +38,23 @@
|
|||
#include "threading/formatters/JSON.h"
|
||||
|
||||
Val::Val(Func* f)
|
||||
:val(f)
|
||||
:val(f), type(f->FType()->Ref())
|
||||
{
|
||||
::Ref(val.func_val);
|
||||
type = f->FType()->Ref();
|
||||
#ifdef DEBUG
|
||||
bound_id = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
Val::Val(BroFile* f)
|
||||
:val(f)
|
||||
static FileType *GetStringFileType() noexcept
|
||||
{
|
||||
static FileType* string_file_type = 0;
|
||||
if ( ! string_file_type )
|
||||
string_file_type = new FileType(base_type(TYPE_STRING));
|
||||
return string_file_type;
|
||||
}
|
||||
|
||||
Val::Val(BroFile* f)
|
||||
:val(f), type(GetStringFileType()->Ref())
|
||||
{
|
||||
assert(f->FType()->Tag() == TYPE_STRING);
|
||||
type = string_file_type->Ref();
|
||||
|
||||
#ifdef DEBUG
|
||||
bound_id = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
Val::~Val()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue