mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48: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 )
|
for ( size_t i = 0; i < attrs.size(); ++i )
|
||||||
{
|
{
|
||||||
if ( (d->IsReadable() || d->IsPortable()) && i > 0 )
|
if ( d->IsReadable() && i > 0 )
|
||||||
d->Add(", ");
|
d->Add(", ");
|
||||||
|
|
||||||
attrs[i]->Describe(d);
|
attrs[i]->Describe(d);
|
||||||
|
|
|
@ -22,10 +22,6 @@ namespace zeek
|
||||||
|
|
||||||
ODesc::ODesc(DescType t, File* arg_f)
|
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;
|
type = t;
|
||||||
style = STANDARD_STYLE;
|
style = STANDARD_STYLE;
|
||||||
f = arg_f;
|
f = arg_f;
|
||||||
|
|
|
@ -21,7 +21,6 @@ class Type;
|
||||||
enum DescType
|
enum DescType
|
||||||
{
|
{
|
||||||
DESC_READABLE,
|
DESC_READABLE,
|
||||||
DESC_PORTABLE,
|
|
||||||
DESC_BINARY,
|
DESC_BINARY,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,7 +38,6 @@ public:
|
||||||
~ODesc();
|
~ODesc();
|
||||||
|
|
||||||
bool IsReadable() const { return type == DESC_READABLE; }
|
bool IsReadable() const { return type == DESC_READABLE; }
|
||||||
bool IsPortable() const { return type == DESC_PORTABLE; }
|
|
||||||
bool IsBinary() const { return type == DESC_BINARY; }
|
bool IsBinary() const { return type == DESC_BINARY; }
|
||||||
|
|
||||||
bool IsShort() const { return is_short; }
|
bool IsShort() const { return is_short; }
|
||||||
|
|
15
src/Expr.cc
15
src/Expr.cc
|
@ -433,7 +433,7 @@ void Expr::Describe(ODesc* d) const
|
||||||
if ( IsParen() && ! d->IsBinary() )
|
if ( IsParen() && ! d->IsBinary() )
|
||||||
d->Add("(");
|
d->Add("(");
|
||||||
|
|
||||||
if ( d->IsPortable() || d->IsBinary() )
|
if ( d->IsBinary() )
|
||||||
AddTag(d);
|
AddTag(d);
|
||||||
|
|
||||||
ExprDescribe(d);
|
ExprDescribe(d);
|
||||||
|
@ -571,12 +571,7 @@ void NameExpr::ExprDescribe(ODesc* d) const
|
||||||
if ( d->IsReadable() )
|
if ( d->IsReadable() )
|
||||||
d->Add(id->Name());
|
d->Add(id->Name());
|
||||||
else
|
else
|
||||||
{
|
d->AddCS(id->Name());
|
||||||
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))
|
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
|
void CallExpr::ExprDescribe(ODesc* d) const
|
||||||
{
|
{
|
||||||
func->Describe(d);
|
func->Describe(d);
|
||||||
if ( d->IsReadable() || d->IsPortable() )
|
if ( d->IsReadable() )
|
||||||
{
|
{
|
||||||
d->Add("(");
|
d->Add("(");
|
||||||
args->Describe(d);
|
args->Describe(d);
|
||||||
|
@ -4968,7 +4963,7 @@ TraversalCode EventExpr::Traverse(TraversalCallback* cb) const
|
||||||
void EventExpr::ExprDescribe(ODesc* d) const
|
void EventExpr::ExprDescribe(ODesc* d) const
|
||||||
{
|
{
|
||||||
d->Add(name.c_str());
|
d->Add(name.c_str());
|
||||||
if ( d->IsReadable() || d->IsPortable() )
|
if ( d->IsReadable() )
|
||||||
{
|
{
|
||||||
d->Add("(");
|
d->Add("(");
|
||||||
args->Describe(d);
|
args->Describe(d);
|
||||||
|
@ -5091,7 +5086,7 @@ void ListExpr::ExprDescribe(ODesc* d) const
|
||||||
|
|
||||||
loop_over_list(exprs, i)
|
loop_over_list(exprs, i)
|
||||||
{
|
{
|
||||||
if ( (d->IsReadable() || d->IsPortable()) && i > 0 )
|
if ( d->IsReadable() && i > 0 )
|
||||||
d->Add(", ");
|
d->Add(", ");
|
||||||
|
|
||||||
exprs[i]->Describe(d);
|
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
|
void Val::Describe(ODesc* d) const
|
||||||
{
|
{
|
||||||
if ( d->IsBinary() || d->IsPortable() )
|
if ( d->IsBinary() )
|
||||||
{
|
{
|
||||||
type->Describe(d);
|
type->Describe(d);
|
||||||
d->SP();
|
d->SP();
|
||||||
|
@ -1250,7 +1250,7 @@ TableValPtr ListVal::ToSetVal() const
|
||||||
|
|
||||||
void ListVal::Describe(ODesc* d) const
|
void ListVal::Describe(ODesc* d) const
|
||||||
{
|
{
|
||||||
if ( d->IsBinary() || d->IsPortable() )
|
if ( d->IsBinary() )
|
||||||
{
|
{
|
||||||
type->Describe(d);
|
type->Describe(d);
|
||||||
d->SP();
|
d->SP();
|
||||||
|
@ -1262,7 +1262,7 @@ void ListVal::Describe(ODesc* d) const
|
||||||
{
|
{
|
||||||
if ( i > 0u )
|
if ( i > 0u )
|
||||||
{
|
{
|
||||||
if ( d->IsReadable() || d->IsPortable() )
|
if ( d->IsReadable() )
|
||||||
{
|
{
|
||||||
d->Add(",");
|
d->Add(",");
|
||||||
d->SP();
|
d->SP();
|
||||||
|
@ -2273,7 +2273,7 @@ void TableVal::Describe(ODesc* d) const
|
||||||
{
|
{
|
||||||
int n = table_val->Length();
|
int n = table_val->Length();
|
||||||
|
|
||||||
if ( d->IsBinary() || d->IsPortable() )
|
if ( d->IsBinary() )
|
||||||
{
|
{
|
||||||
table_type->Describe(d);
|
table_type->Describe(d);
|
||||||
d->SP();
|
d->SP();
|
||||||
|
@ -2281,7 +2281,7 @@ void TableVal::Describe(ODesc* d) const
|
||||||
d->SP();
|
d->SP();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( d->IsPortable() || d->IsReadable() )
|
if ( d->IsReadable() )
|
||||||
{
|
{
|
||||||
d->Add("{");
|
d->Add("{");
|
||||||
d->PushIndent();
|
d->PushIndent();
|
||||||
|
@ -2379,7 +2379,7 @@ void TableVal::Describe(ODesc* d) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( d->IsPortable() || d->IsReadable() )
|
if ( d->IsReadable() )
|
||||||
{
|
{
|
||||||
d->PopIndent();
|
d->PopIndent();
|
||||||
d->Add("}");
|
d->Add("}");
|
||||||
|
@ -2938,7 +2938,7 @@ void RecordVal::Describe(ODesc* d) const
|
||||||
{
|
{
|
||||||
auto n = record_val->size();
|
auto n = record_val->size();
|
||||||
|
|
||||||
if ( d->IsBinary() || d->IsPortable() )
|
if ( d->IsBinary() )
|
||||||
{
|
{
|
||||||
rt->Describe(d);
|
rt->Describe(d);
|
||||||
d->SP();
|
d->SP();
|
||||||
|
|
|
@ -2677,7 +2677,7 @@ TraversalCode InlineExpr::Traverse(TraversalCallback* cb) const
|
||||||
|
|
||||||
void InlineExpr::ExprDescribe(ODesc* d) const
|
void InlineExpr::ExprDescribe(ODesc* d) const
|
||||||
{
|
{
|
||||||
if ( d->IsReadable() || d->IsPortable() )
|
if ( d->IsReadable() )
|
||||||
{
|
{
|
||||||
d->Add("inline(");
|
d->Add("inline(");
|
||||||
args->Describe(d);
|
args->Describe(d);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue