mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/gh-985-double-to-interval-descs'
* origin/topic/jsiwek/gh-985-double-to-interval-descs: GH-985: Fix descriptions of double_to_interval() return values
This commit is contained in:
commit
a431f6b45d
5 changed files with 19 additions and 8 deletions
8
CHANGES
8
CHANGES
|
@ -1,4 +1,12 @@
|
||||||
|
|
||||||
|
3.2.0-dev.738 | 2020-06-02 18:13:50 -0700
|
||||||
|
|
||||||
|
* GH-985: Fix descriptions of double_to_interval() return values (Jon Siwek, Corelight)
|
||||||
|
|
||||||
|
The BIF was not returning an IntervalVal which has an overriden
|
||||||
|
ValDescribe() method that allows for prettier printing like "6.0 secs"
|
||||||
|
instead of just "6.0".
|
||||||
|
|
||||||
3.2.0-dev.736 | 2020-06-02 12:37:56 -0700
|
3.2.0-dev.736 | 2020-06-02 12:37:56 -0700
|
||||||
|
|
||||||
* Decrease number of CPUs/memory for Cirrus CI tasks (Jon Siwek, Corelight)
|
* Decrease number of CPUs/memory for Cirrus CI tasks (Jon Siwek, Corelight)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
3.2.0-dev.736
|
3.2.0-dev.738
|
||||||
|
|
|
@ -2399,7 +2399,7 @@ function double_to_time%(d: double%): time
|
||||||
## .. zeek:see:: interval_to_double
|
## .. zeek:see:: interval_to_double
|
||||||
function double_to_interval%(d: double%): interval
|
function double_to_interval%(d: double%): interval
|
||||||
%{
|
%{
|
||||||
return make_intrusive<Val>(d, TYPE_INTERVAL);
|
return make_intrusive<IntervalVal>(d, Seconds);
|
||||||
%}
|
%}
|
||||||
|
|
||||||
## Converts a :zeek:type:`port` to a :zeek:type:`count`.
|
## Converts a :zeek:type:`port` to a :zeek:type:`count`.
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
1234563.14
|
interval, 14.0 days 6.0 hrs 56.0 mins 3.0 secs 139.0 msecs 999.999898 usecs
|
||||||
-1234563.14
|
interval, -14.0 days -6.0 hrs -56.0 mins -3.0 secs -139.0 msecs -999.999898 usecs
|
||||||
|
interval, 6.0 secs
|
||||||
|
|
|
@ -4,8 +4,10 @@
|
||||||
|
|
||||||
event zeek_init()
|
event zeek_init()
|
||||||
{
|
{
|
||||||
local a = 1234563.14;
|
local a = double_to_interval(1234563.140);
|
||||||
print double_to_interval(a);
|
print type_name(a), a;
|
||||||
local b = -1234563.14;
|
local b = double_to_interval(-1234563.14);
|
||||||
print double_to_interval(b);
|
print type_name(b), b;
|
||||||
|
local c = double_to_interval(6.0);
|
||||||
|
print type_name(c), c;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue