From ca1e5fe4be9aaea453273e484530e12f40d75d6c Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Thu, 14 May 2020 14:21:30 -0700 Subject: [PATCH] Replace deprecated usage of BifFunc:: with zeek::BifFunc:: Names of functions also changed slightly, like bro_fmt -> fmt_bif. Should generally be unusual/unexpected to see somone calling these directly from C++ in their plugin, but since technically possible in previous versions, I also removed the "private" restriction on accessing the BifReturnVal member. --- aux/bifcl | 2 +- src/Func.cc | 2 +- src/Func.h | 4 ---- src/Hash.h | 8 ++++---- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/aux/bifcl b/aux/bifcl index 7fdbbfdf5e..2d56fd7e6d 160000 --- a/aux/bifcl +++ b/aux/bifcl @@ -1 +1 @@ -Subproject commit 7fdbbfdf5ee3669a77f73360b86326344e15ea99 +Subproject commit 2d56fd7e6d59aab754176b3ec90e71600d22d713 diff --git a/src/Func.cc b/src/Func.cc index 12a2d4eef8..1ae7e0b8a7 100644 --- a/src/Func.cc +++ b/src/Func.cc @@ -781,7 +781,7 @@ void init_builtin_funcs_subdirs() bool check_built_in_call(BuiltinFunc* f, CallExpr* call) { - if ( f->TheFunc() != BifFunc::bro_fmt ) + if ( f->TheFunc() != zeek::BifFunc::fmt_bif) return true; const expr_list& args = call->Args()->Exprs(); diff --git a/src/Func.h b/src/Func.h index dff2c9a36b..cc18471b1a 100644 --- a/src/Func.h +++ b/src/Func.h @@ -206,10 +206,6 @@ public: [[deprecated("Remove in v4.1. Return an IntrusivePtr instead.")]] BifReturnVal(Val* v) noexcept; -private: - - friend class BuiltinFunc; - IntrusivePtr rval; }; diff --git a/src/Hash.h b/src/Hash.h index 8e143e98f2..bff33c2b9f 100644 --- a/src/Hash.h +++ b/src/Hash.h @@ -30,9 +30,9 @@ class BroString; class Val; class Frame; class BifReturnVal; -namespace BifFunc { - extern BifReturnVal bro_md5_hmac(Frame* frame, const zeek::Args*); -} +namespace zeek { namespace BifFunc { + extern BifReturnVal md5_hmac_bif(Frame* frame, const zeek::Args*); +}} typedef uint64_t hash_t; typedef uint64_t hash64_t; @@ -196,7 +196,7 @@ private: inline static bool seeds_initialized = false; friend void hmac_md5(size_t size, const unsigned char* bytes, unsigned char digest[16]); - friend BifReturnVal BifFunc::bro_md5_hmac(Frame* frame, const zeek::Args*); + friend BifReturnVal zeek::BifFunc::md5_hmac_bif(Frame* frame, const zeek::Args*); }; typedef enum {