* 'intrusive_ptr' of https://github.com/MaxKellermann/zeek: (32 commits)
  Scope: store IntrusivePtr in `local`
  Scope: pass IntrusivePtr to AddInit()
  DNS_Mgr: use class IntrusivePtr
  Scope: use class IntrusivePtr
  Attr: use class IntrusivePtr
  Expr: check_and_promote_expr() returns IntrusivePtr
  Frame: use class IntrusivePtr
  Val: RecordVal::LookupWithDefault() returns IntrusivePtr
  Type: RecordType::FieldDefault() returns IntrusivePtr
  Val: TableVal::Delete() returns IntrusivePtr
  Type: base_type() returns IntrusivePtr
  Type: init_type() returns IntrusivePtr
  Type: merge_types() returns IntrusivePtr
  Type: use class IntrusivePtr in VectorType
  Type: use class IntrusivePtr in EnumType
  Type: use class IntrusivePtr in FileType
  Type: use class IntrusivePtr in TypeDecl
  Type: make TypeDecl `final` and the dtor non-`virtual`
  Type: use class IntrusivePtr in TypeType
  Type: use class IntrusivePtr in FuncType
  ...
This commit is contained in:
Jon Siwek 2020-03-17 22:51:46 -07:00
commit b62727a7fa
108 changed files with 1737 additions and 2067 deletions

View file

@ -71,13 +71,13 @@ BroFile::BroFile(FILE* arg_f, const char* arg_name, const char* arg_access)
is_open = (f != 0);
}
BroFile::BroFile(const char* arg_name, const char* arg_access, BroType* arg_t)
BroFile::BroFile(const char* arg_name, const char* arg_access)
{
Init();
f = 0;
name = copy_string(arg_name);
access = copy_string(arg_access);
t = arg_t ? arg_t : base_type(TYPE_STRING);
t = base_type(TYPE_STRING);
if ( streq(name, "/dev/stdin") )
f = stdin;
@ -154,7 +154,6 @@ bool BroFile::Open(FILE* file, const char* mode)
BroFile::~BroFile()
{
Close();
Unref(t);
Unref(attrs);
delete [] name;
@ -171,7 +170,6 @@ void BroFile::Init()
attrs = 0;
buffered = true;
raw_output = false;
t = 0;
#ifdef USE_PERFTOOLS_DEBUG
heap_checker->IgnoreObject(this);
@ -286,7 +284,7 @@ RecordVal* BroFile::Rotate()
return 0;
}
info->Assign(2, new Val(open_time, TYPE_TIME));
info->Assign(2, make_intrusive<Val>(open_time, TYPE_TIME));
Unlink();
@ -355,6 +353,6 @@ BroFile* BroFile::GetFile(const char* name)
}
}
return new BroFile(name, "w", 0);
return new BroFile(name, "w");
}