Remove using util.h in various headers in favor of util-types.h

This commit is contained in:
Tim Wojtulewicz 2025-06-06 15:33:47 -07:00
parent 9928403b0b
commit f8c04998af
14 changed files with 22 additions and 16 deletions

View file

@ -9,7 +9,7 @@
#include "zeek/IntrusivePtr.h" #include "zeek/IntrusivePtr.h"
#include "zeek/ZeekString.h" // for byte_vec #include "zeek/ZeekString.h" // for byte_vec
#include "zeek/util.h" // for zeek_int_t #include "zeek/util-types.h"
namespace zeek { namespace zeek {

View file

@ -9,7 +9,7 @@
#include "zeek/ZeekArgs.h" #include "zeek/ZeekArgs.h"
#include "zeek/analyzer/Analyzer.h" #include "zeek/analyzer/Analyzer.h"
#include "zeek/iosource/IOSource.h" #include "zeek/iosource/IOSource.h"
#include "zeek/util.h" #include "zeek/util-types.h"
namespace zeek { namespace zeek {

View file

@ -8,7 +8,7 @@
#include "zeek/IPAddr.h" #include "zeek/IPAddr.h"
#include "zeek/Reassem.h" #include "zeek/Reassem.h"
#include "zeek/Timer.h" #include "zeek/Timer.h"
#include "zeek/util.h" // for zeek_uint_t #include "zeek/util-types.h"
namespace zeek { namespace zeek {

View file

@ -22,7 +22,7 @@
#include <unistd.h> #include <unistd.h>
#include <cstdlib> #include <cstdlib>
#include "zeek/util.h" // for zeek_int_t #include "zeek/util-types.h" // for zeek_int_t
// to allow md5_hmac_bif access to the hmac seed // to allow md5_hmac_bif access to the hmac seed
#include "zeek/ZeekArgs.h" #include "zeek/ZeekArgs.h"

View file

@ -2,9 +2,14 @@
#pragma once #pragma once
#include "zeek/Type.h" #include "zeek/util-types.h"
namespace zeek::detail { namespace zeek {
class Type;
class Val;
namespace detail {
inline bool double_to_count_would_overflow(double v) { return v < 0.0 || v > static_cast<double>(UINT64_MAX); } inline bool double_to_count_would_overflow(double v) { return v < 0.0 || v > static_cast<double>(UINT64_MAX); }
@ -18,4 +23,5 @@ inline bool count_to_int_would_overflow(zeek_uint_t v) { return v > INT64_MAX; }
extern bool would_overflow(const zeek::Type* from_type, const zeek::Type* to_type, const Val* val); extern bool would_overflow(const zeek::Type* from_type, const zeek::Type* to_type, const Val* val);
} // namespace zeek::detail } // namespace detail
} // namespace zeek

View file

@ -5,7 +5,7 @@
#include <cstring> #include <cstring>
#include <string> #include <string>
#include "zeek/util.h" // for zeek_int_t #include "zeek/util-types.h"
namespace zeek { namespace zeek {

View file

@ -4,7 +4,6 @@
#include "zeek/Tag.h" #include "zeek/Tag.h"
#include "zeek/plugin/Component.h" #include "zeek/plugin/Component.h"
#include "zeek/util.h"
namespace zeek { namespace zeek {

View file

@ -1,7 +1,7 @@
%extern{ %extern{
#include "zeek/3rdparty/ConvertUTF.h" #include "zeek/3rdparty/ConvertUTF.h"
#include "zeek/binpac_zeek.h" #include "zeek/binpac_zeek.h"
#include "zeek/util.h" #include "zeek/util-types.h"
#include "zeek/Reporter.h" #include "zeek/Reporter.h"
#include "zeek/Val.h" #include "zeek/Val.h"
#include "zeek/RunState.h" #include "zeek/RunState.h"

View file

@ -10,7 +10,7 @@
#include <cstdint> #include <cstdint>
#include <cstdio> #include <cstdio>
#include "zeek/util.h" #include "zeek/util.h" // for util::bytetohex
// Required buffer size for an MD5 digest. // Required buffer size for an MD5 digest.
#define ZEEK_MD5_DIGEST_LENGTH 16 #define ZEEK_MD5_DIGEST_LENGTH 16

View file

@ -5,7 +5,7 @@
#include <cstdint> #include <cstdint>
#include <string> #include <string>
#include "zeek/util.h" #include "zeek/util-types.h"
extern "C" { extern "C" {
#include <pcap.h> #include <pcap.h>

View file

@ -6,7 +6,6 @@
#include "zeek/Tag.h" #include "zeek/Tag.h"
#include "zeek/plugin/Component.h" #include "zeek/plugin/Component.h"
#include "zeek/util.h"
namespace zeek::packet_analysis { namespace zeek::packet_analysis {

View file

@ -8,7 +8,7 @@
#include "zeek/Attr.h" #include "zeek/Attr.h"
#include "zeek/ID.h" #include "zeek/ID.h"
#include "zeek/util.h" #include "zeek/util-types.h"
namespace zeek::detail { namespace zeek::detail {

View file

@ -9,11 +9,13 @@
#pragma once #pragma once
#include <memory>
#include <string>
#include <vector> #include <vector>
#include "zeek/IntrusivePtr.h" #include "zeek/IntrusivePtr.h"
#include "zeek/script_opt/ZAM/Profile.h" #include "zeek/script_opt/ZAM/Profile.h"
#include "zeek/util.h" #include "zeek/util-types.h"
namespace zeek { namespace zeek {

View file

@ -6,7 +6,7 @@
#include <vector> #include <vector>
#include "zeek/Span.h" #include "zeek/Span.h"
#include "zeek/util.h" #include "zeek/util-types.h"
namespace zeek::telemetry { namespace zeek::telemetry {