mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Deprecate Val(double, TypeTag) ctor, add TimeVal/DoubleVal subclasses
This also updates all usages of the deprecated Val ctor to use either IntervalVal, TimeVal, or DoubleVal ctors. The reason for doing away with the old constructor is that using it with TYPE_INTERVAL isn't strictly correct since there exists a more specific subclass, IntervalVal, with overriden ValDescribe() method that ought to be used to print such values in a more descriptive way.
This commit is contained in:
parent
a431f6b45d
commit
5b4313b593
76 changed files with 847 additions and 782 deletions
|
@ -456,9 +456,13 @@ Val* Value::ValueToVal(const std::string& source, const Value* val, bool& have_e
|
|||
return val_mgr->Count(val->val.int_val).release();
|
||||
|
||||
case TYPE_DOUBLE:
|
||||
return new DoubleVal(val->val.double_val);
|
||||
|
||||
case TYPE_TIME:
|
||||
return new TimeVal(val->val.double_val);
|
||||
|
||||
case TYPE_INTERVAL:
|
||||
return new Val(val->val.double_val, val->type);
|
||||
return new IntervalVal(val->val.double_val);
|
||||
|
||||
case TYPE_STRING:
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue