mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Type: return IntrusivePtr
This commit is contained in:
parent
0a6ddfb6b5
commit
ba35ebec4c
38 changed files with 319 additions and 334 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "Tag.h"
|
||||
#include "Val.h"
|
||||
#include "IntrusivePtr.h"
|
||||
|
||||
Tag::Tag(EnumType* etype, type_t arg_type, subtype_t arg_subtype)
|
||||
{
|
||||
|
@ -11,7 +12,7 @@ Tag::Tag(EnumType* etype, type_t arg_type, subtype_t arg_subtype)
|
|||
subtype = arg_subtype;
|
||||
int64_t i = (int64_t)(type) | ((int64_t)subtype << 31);
|
||||
Ref(etype);
|
||||
val = etype->GetVal(i);
|
||||
val = etype->GetVal(i).release();
|
||||
}
|
||||
|
||||
Tag::Tag(EnumVal* arg_val)
|
||||
|
@ -85,7 +86,7 @@ EnumVal* Tag::AsEnumVal(EnumType* etype) const
|
|||
{
|
||||
assert(type == 0 && subtype == 0);
|
||||
Ref(etype);
|
||||
val = etype->GetVal(0);
|
||||
val = etype->GetVal(0).release();
|
||||
}
|
||||
|
||||
return val;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue