Replace all the Warning() calls after IsFieldDeprecated() over to Warn()

This commit is contained in:
AmazingPP 2022-09-03 19:15:47 +08:00
parent 997d3ed126
commit 970f45d686
3 changed files with 11 additions and 11 deletions

View file

@ -3228,7 +3228,7 @@ FieldExpr::FieldExpr(ExprPtr arg_op, const char* arg_field_name)
td = rt->FieldDecl(field);
if ( rt->IsFieldDeprecated(field) )
reporter->Warning("%s", rt->GetFieldDeprecationWarning(field, false).c_str());
Warn(rt->GetFieldDeprecationWarning(field, false).c_str());
}
}
}
@ -3313,7 +3313,7 @@ HasFieldExpr::HasFieldExpr(ExprPtr arg_op, const char* arg_field_name)
if ( field < 0 )
ExprError("no such field in record");
else if ( rt->IsFieldDeprecated(field) )
reporter->Warning("%s", rt->GetFieldDeprecationWarning(field, true).c_str());
Warn(rt->GetFieldDeprecationWarning(field, true).c_str());
SetType(base_type(TYPE_BOOL));
}
@ -3444,7 +3444,7 @@ RecordConstructorExpr::RecordConstructorExpr(RecordTypePtr known_rt, ListExprPtr
}
}
else if ( known_rt->IsFieldDeprecated(i) )
reporter->Warning("%s", known_rt->GetFieldDeprecationWarning(i, false).c_str());
Warn(known_rt->GetFieldDeprecationWarning(i, false).c_str());
}
ValPtr RecordConstructorExpr::Eval(Frame* f) const

View file

@ -7,12 +7,12 @@ warning in ./no-warnings.zeek, line 33: deprecated (blah)
warning in ./no-warnings.zeek, line 37: deprecated (my_event)
warning in ./no-warnings.zeek, line 38: deprecated (my_event)
warning in ./no-warnings.zeek, line 39: deprecated (my_hook)
warning in ./no-warnings.zeek, line 41: deprecated (my_record$b)
warning in ./no-warnings.zeek, line 41: deprecated (my_record$b) (my_record($a=3, $b=yeah))
warning in ./no-warnings.zeek, line 42: deprecated (my_record$b) ((coerce [$a=4, $b=ye] to my_record))
warning in ./no-warnings.zeek, line 43: deprecated (my_record$b) ((coerce [$a=5, $b=y] to my_record))
warning in ./no-warnings.zeek, line 45: deprecated (my_record?$b)
warning in ./no-warnings.zeek, line 46: deprecated (my_record$b)
warning in ./no-warnings.zeek, line 49: deprecated (my_record$b)
warning in ./no-warnings.zeek, line 45: deprecated (my_record?$b) (mr?$b)
warning in ./no-warnings.zeek, line 46: deprecated (my_record$b) (mr$b)
warning in ./no-warnings.zeek, line 49: deprecated (my_record$b) (mr$b)
warning in ./no-warnings.zeek, line 52: deprecated (my_event)
warning in ./no-warnings.zeek, line 57: deprecated (my_hook)
warning in ./no-warnings.zeek, line 62: deprecated (blah)

View file

@ -7,12 +7,12 @@ warning in ./warnings.zeek, line 33: deprecated (blah): type warning
warning in ./warnings.zeek, line 37: deprecated (my_event): event warning
warning in ./warnings.zeek, line 38: deprecated (my_event): event warning
warning in ./warnings.zeek, line 39: deprecated (my_hook): hook warning
warning in ./warnings.zeek, line 41: deprecated (my_record$b): record warning
warning in ./warnings.zeek, line 41: deprecated (my_record$b): record warning (my_record($a=3, $b=yeah))
warning in ./warnings.zeek, line 42: deprecated (my_record$b): record warning ((coerce [$a=4, $b=ye] to my_record))
warning in ./warnings.zeek, line 43: deprecated (my_record$b): record warning ((coerce [$a=5, $b=y] to my_record))
warning in ./warnings.zeek, line 45: deprecated (my_record?$b): record warning
warning in ./warnings.zeek, line 46: deprecated (my_record$b): record warning
warning in ./warnings.zeek, line 49: deprecated (my_record$b): record warning
warning in ./warnings.zeek, line 45: deprecated (my_record?$b): record warning (mr?$b)
warning in ./warnings.zeek, line 46: deprecated (my_record$b): record warning (mr$b)
warning in ./warnings.zeek, line 49: deprecated (my_record$b): record warning (mr$b)
warning in ./warnings.zeek, line 52: deprecated (my_event): event warning
warning in ./warnings.zeek, line 57: deprecated (my_hook): hook warning
warning in ./warnings.zeek, line 62: deprecated (blah): type warning