mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
Deprecate TypeDecl::FindAttr(), replace with GetAttr()
This commit is contained in:
parent
5fc78a548c
commit
e365105872
6 changed files with 26 additions and 23 deletions
|
@ -816,7 +816,7 @@ IntrusivePtr<TableVal> RecordType::GetRecordFieldsVal(const RecordVal* rv) const
|
|||
if ( rv )
|
||||
fv = rv->GetField(i);
|
||||
|
||||
bool logged = (fd->attrs && fd->FindAttr(ATTR_LOG) != nullptr);
|
||||
bool logged = (fd->attrs && fd->GetAttr(ATTR_LOG) != nullptr);
|
||||
|
||||
auto nr = make_intrusive<RecordVal>(record_field);
|
||||
|
||||
|
@ -849,8 +849,7 @@ const char* RecordType::AddFields(type_decl_list* others, attr_list* attr)
|
|||
|
||||
for ( const auto& td : *others )
|
||||
{
|
||||
if ( ! td->FindAttr(ATTR_DEFAULT) &&
|
||||
! td->FindAttr(ATTR_OPTIONAL) )
|
||||
if ( ! td->GetAttr(ATTR_DEFAULT) && ! td->GetAttr(ATTR_OPTIONAL) )
|
||||
{
|
||||
delete others;
|
||||
return "extension field must be &optional or have &default";
|
||||
|
@ -1016,7 +1015,7 @@ string RecordType::GetFieldDeprecationWarning(int field, bool has_check) const
|
|||
if ( decl)
|
||||
{
|
||||
string result;
|
||||
if ( const Attr* deprecation = decl->FindAttr(ATTR_DEPRECATED) )
|
||||
if ( const auto& deprecation = decl->GetAttr(ATTR_DEPRECATED) )
|
||||
{
|
||||
auto expr = static_cast<ConstExpr*>(deprecation->GetExpr().get());
|
||||
if ( expr )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue