mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 00:58:19 +00:00
Remove deprecated DESC_PORTABLE ODesc mode and ODesc::IsPortable()
This commit is contained in:
parent
77aa80033b
commit
765a8535e0
6 changed files with 14 additions and 25 deletions
|
@ -300,7 +300,7 @@ void Attributes::Describe(ODesc* d) const
|
|||
|
||||
for ( size_t i = 0; i < attrs.size(); ++i )
|
||||
{
|
||||
if ( (d->IsReadable() || d->IsPortable()) && i > 0 )
|
||||
if ( d->IsReadable() && i > 0 )
|
||||
d->Add(", ");
|
||||
|
||||
attrs[i]->Describe(d);
|
||||
|
|
|
@ -22,10 +22,6 @@ namespace zeek
|
|||
|
||||
ODesc::ODesc(DescType t, File* arg_f)
|
||||
{
|
||||
if ( t == DESC_PORTABLE )
|
||||
zeek::reporter->Warning("Remove in v5.1. Use of DESC_PORTABLE \"Describe\" format is "
|
||||
"deprecated and will be removed");
|
||||
|
||||
type = t;
|
||||
style = STANDARD_STYLE;
|
||||
f = arg_f;
|
||||
|
|
|
@ -21,7 +21,6 @@ class Type;
|
|||
enum DescType
|
||||
{
|
||||
DESC_READABLE,
|
||||
DESC_PORTABLE,
|
||||
DESC_BINARY,
|
||||
};
|
||||
|
||||
|
@ -39,7 +38,6 @@ public:
|
|||
~ODesc();
|
||||
|
||||
bool IsReadable() const { return type == DESC_READABLE; }
|
||||
bool IsPortable() const { return type == DESC_PORTABLE; }
|
||||
bool IsBinary() const { return type == DESC_BINARY; }
|
||||
|
||||
bool IsShort() const { return is_short; }
|
||||
|
|
13
src/Expr.cc
13
src/Expr.cc
|
@ -433,7 +433,7 @@ void Expr::Describe(ODesc* d) const
|
|||
if ( IsParen() && ! d->IsBinary() )
|
||||
d->Add("(");
|
||||
|
||||
if ( d->IsPortable() || d->IsBinary() )
|
||||
if ( d->IsBinary() )
|
||||
AddTag(d);
|
||||
|
||||
ExprDescribe(d);
|
||||
|
@ -570,14 +570,9 @@ void NameExpr::ExprDescribe(ODesc* d) const
|
|||
{
|
||||
if ( d->IsReadable() )
|
||||
d->Add(id->Name());
|
||||
else
|
||||
{
|
||||
if ( d->IsPortable() )
|
||||
d->Add(id->Name());
|
||||
else
|
||||
d->AddCS(id->Name());
|
||||
}
|
||||
}
|
||||
|
||||
ConstExpr::ConstExpr(ValPtr arg_val) : Expr(EXPR_CONST), val(std::move(arg_val))
|
||||
{
|
||||
|
@ -4683,7 +4678,7 @@ TraversalCode CallExpr::Traverse(TraversalCallback* cb) const
|
|||
void CallExpr::ExprDescribe(ODesc* d) const
|
||||
{
|
||||
func->Describe(d);
|
||||
if ( d->IsReadable() || d->IsPortable() )
|
||||
if ( d->IsReadable() )
|
||||
{
|
||||
d->Add("(");
|
||||
args->Describe(d);
|
||||
|
@ -4968,7 +4963,7 @@ TraversalCode EventExpr::Traverse(TraversalCallback* cb) const
|
|||
void EventExpr::ExprDescribe(ODesc* d) const
|
||||
{
|
||||
d->Add(name.c_str());
|
||||
if ( d->IsReadable() || d->IsPortable() )
|
||||
if ( d->IsReadable() )
|
||||
{
|
||||
d->Add("(");
|
||||
args->Describe(d);
|
||||
|
@ -5091,7 +5086,7 @@ void ListExpr::ExprDescribe(ODesc* d) const
|
|||
|
||||
loop_over_list(exprs, i)
|
||||
{
|
||||
if ( (d->IsReadable() || d->IsPortable()) && i > 0 )
|
||||
if ( d->IsReadable() && i > 0 )
|
||||
d->Add(", ");
|
||||
|
||||
exprs[i]->Describe(d);
|
||||
|
|
14
src/Val.cc
14
src/Val.cc
|
@ -272,7 +272,7 @@ bool Val::RemoveFrom(Val* v) const
|
|||
|
||||
void Val::Describe(ODesc* d) const
|
||||
{
|
||||
if ( d->IsBinary() || d->IsPortable() )
|
||||
if ( d->IsBinary() )
|
||||
{
|
||||
type->Describe(d);
|
||||
d->SP();
|
||||
|
@ -1250,7 +1250,7 @@ TableValPtr ListVal::ToSetVal() const
|
|||
|
||||
void ListVal::Describe(ODesc* d) const
|
||||
{
|
||||
if ( d->IsBinary() || d->IsPortable() )
|
||||
if ( d->IsBinary() )
|
||||
{
|
||||
type->Describe(d);
|
||||
d->SP();
|
||||
|
@ -1262,7 +1262,7 @@ void ListVal::Describe(ODesc* d) const
|
|||
{
|
||||
if ( i > 0u )
|
||||
{
|
||||
if ( d->IsReadable() || d->IsPortable() )
|
||||
if ( d->IsReadable() )
|
||||
{
|
||||
d->Add(",");
|
||||
d->SP();
|
||||
|
@ -2273,7 +2273,7 @@ void TableVal::Describe(ODesc* d) const
|
|||
{
|
||||
int n = table_val->Length();
|
||||
|
||||
if ( d->IsBinary() || d->IsPortable() )
|
||||
if ( d->IsBinary() )
|
||||
{
|
||||
table_type->Describe(d);
|
||||
d->SP();
|
||||
|
@ -2281,7 +2281,7 @@ void TableVal::Describe(ODesc* d) const
|
|||
d->SP();
|
||||
}
|
||||
|
||||
if ( d->IsPortable() || d->IsReadable() )
|
||||
if ( d->IsReadable() )
|
||||
{
|
||||
d->Add("{");
|
||||
d->PushIndent();
|
||||
|
@ -2379,7 +2379,7 @@ void TableVal::Describe(ODesc* d) const
|
|||
}
|
||||
}
|
||||
|
||||
if ( d->IsPortable() || d->IsReadable() )
|
||||
if ( d->IsReadable() )
|
||||
{
|
||||
d->PopIndent();
|
||||
d->Add("}");
|
||||
|
@ -2938,7 +2938,7 @@ void RecordVal::Describe(ODesc* d) const
|
|||
{
|
||||
auto n = record_val->size();
|
||||
|
||||
if ( d->IsBinary() || d->IsPortable() )
|
||||
if ( d->IsBinary() )
|
||||
{
|
||||
rt->Describe(d);
|
||||
d->SP();
|
||||
|
|
|
@ -2677,7 +2677,7 @@ TraversalCode InlineExpr::Traverse(TraversalCallback* cb) const
|
|||
|
||||
void InlineExpr::ExprDescribe(ODesc* d) const
|
||||
{
|
||||
if ( d->IsReadable() || d->IsPortable() )
|
||||
if ( d->IsReadable() )
|
||||
{
|
||||
d->Add("inline(");
|
||||
args->Describe(d);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue