From aadf5d3b155bc093127122b693f3b22f128c39dc Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Mon, 10 Mar 2025 06:11:40 -0700 Subject: [PATCH] Merge remote-tracking branch 'origin/topic/timw/fix-double-to-docs' * origin/topic/timw/fix-double-to-docs: Fix return types in docs for double_to_count and double_to_int (cherry picked from commit 8ed503314d6b61fa2945b9e39a234184ef94f95a) --- CHANGES | 6 ++++++ VERSION | 2 +- src/zeek.bif | 24 ++++++++++++------------ 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index 55449fa53e..5306f82415 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +7.1.0-10 | 2025-03-18 13:59:06 -0700 + + * Fix return types in docs for double_to_count and double_to_int (Tim Wojtulewicz, Corelight) + + (cherry picked from commit 8ed503314d6b61fa2945b9e39a234184ef94f95a) + 7.1.0-9 | 2025-03-18 13:57:55 -0700 * CI: Unconditionally upgrade pip on macOS (Tim Wojtulewicz, Corelight) diff --git a/VERSION b/VERSION index 62af2457d6..767018f093 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.1.0-9 +7.1.0-10 diff --git a/src/zeek.bif b/src/zeek.bif index 1a42f00344..05953b5ddb 100644 --- a/src/zeek.bif +++ b/src/zeek.bif @@ -2639,18 +2639,6 @@ function int_to_count%(n: int%): count return zeek::val_mgr->Count(n); %} -## Converts a :zeek:type:`double` to a :zeek:type:`count`. -## -## d: The :zeek:type:`double` to convert. -## -## Returns: The :zeek:type:`double` *d* as unsigned integer, or 0 if *d* < 0.0. -## The value returned follows typical rounding rules, as implemented -## by rint(). -function double_to_int%(d: double%): int - %{ - return zeek::val_mgr->Int(zeek_int_t(rint(d))); - %} - ## Converts a :zeek:type:`double` to a :zeek:type:`int`. ## ## d: The :zeek:type:`double` to convert. @@ -2659,6 +2647,18 @@ function double_to_int%(d: double%): int ## follows typical rounding rules, as implemented by rint(). ## ## .. zeek:see:: double_to_time +function double_to_int%(d: double%): int + %{ + return zeek::val_mgr->Int(zeek_int_t(rint(d))); + %} + +## Converts a :zeek:type:`double` to a :zeek:type:`count`. +## +## d: The :zeek:type:`double` to convert. +## +## Returns: The :zeek:type:`double` *d* as unsigned integer, or 0 if *d* < 0.0. +## The value returned follows typical rounding rules, as implemented +## by rint(). function double_to_count%(d: double%): count %{ if ( d < 0.0 )