mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 00:28:21 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/32bit-compat'
* origin/topic/jsiwek/32bit-compat: Improve formatting of doubles that are close to integers Improve HTTP version number comparisons Add a 32-bit task to Cirrus CI config Replace va_list fmt() overload with vfmt() Format tables indexed by patterns consistently across 32-bit/64-bit Format interval values consistently across 32-bit/64-bit platforms
This commit is contained in:
commit
822567b3f9
17 changed files with 164 additions and 42 deletions
|
@ -13,6 +13,8 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "Attr.h"
|
||||
#include "BroString.h"
|
||||
#include "CompHash.h"
|
||||
|
@ -715,7 +717,8 @@ void IntervalVal::ValDescribe(ODesc* d) const
|
|||
if ( ! (v >= unit || v <= -unit) )
|
||||
continue;
|
||||
|
||||
double num = static_cast<double>(static_cast<int64_t>(v / unit));
|
||||
double num = v / unit;
|
||||
num = num < 0 ? std::ceil(num) : std::floor(num);
|
||||
v -= num * unit;
|
||||
to_print = num;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue