diff --git a/src/Stats.cc b/src/Stats.cc index 50f24dae5a..759f95972b 100644 --- a/src/Stats.cc +++ b/src/Stats.cc @@ -252,7 +252,7 @@ void ProfileLogger::Log() for ( const auto& global : globals ) { - auto id = global.second; + auto& id = global.second; // We don't show/count internal globals as they are always // contained in some other global user-visible container. diff --git a/src/Type.h b/src/Type.h index bc35e752b6..c29f6fb32b 100644 --- a/src/Type.h +++ b/src/Type.h @@ -21,7 +21,6 @@ FORWARD_DECLARE_NAMESPACED(Expr, zeek::detail); FORWARD_DECLARE_NAMESPACED(ListExpr, zeek::detail); FORWARD_DECLARE_NAMESPACED(Attributes, zeek::detail); -// BRO types. enum [[deprecated("Remove in v4.1. Use zeek::TypeTag instead.")]] TypeTag { TYPE_VOID, // 0 TYPE_BOOL, // 1 @@ -977,17 +976,17 @@ inline bool EitherError(TypeTag t1, TypeTag t2) { return (IsErrorType(t1) || IsE // Returns the basic (non-parameterized) type with the given type. const IntrusivePtr& base_type(zeek::TypeTag tag); -// Returns the basic (non-parameterized) type with the given type. -// The reference count of the type is not increased. -[[deprecated("Remove in v4.1. Use ::base_type() instead")]] -inline zeek::BroType* base_type_no_ref(TypeTag tag) - { return base_type(tag).get(); } - // Returns the basic error type. inline const IntrusivePtr& error_type() { return base_type(TYPE_ERROR); } } // namespace zeek +// Returns the basic (non-parameterized) type with the given type. +// The reference count of the type is not increased. +[[deprecated("Remove in v4.1. Use zeek::base_type() instead")]] +inline zeek::BroType* base_type_no_ref(TypeTag tag) + { return zeek::base_type(static_cast(tag)).get(); } + extern IntrusivePtr md5_type; extern IntrusivePtr sha1_type; extern IntrusivePtr sha256_type; diff --git a/src/Val.h b/src/Val.h index f7ea2e0cbb..1aebc0f887 100644 --- a/src/Val.h +++ b/src/Val.h @@ -125,7 +125,7 @@ public: : val(d), type(zeek::base_type(t)) {} - [[deprecated("Remove in v4.1. Use version that takes zeek::TypeTag instead.")]] + [[deprecated("Remove in v4.1. Use IntervalVal(), TimeVal(), or DoubleVal() constructors.")]] Val(double d, ::TypeTag t) : Val(d, static_cast(t)) {} @@ -1004,7 +1004,7 @@ public: notifier::Modifiable* Modifiable() override { return this; } // Retrieves and saves all table state (key-value pairs) for - // tables whose index type depends on the given zeek::detail::RecordType. + // tables whose index type depends on the given zeek::RecordType. static void SaveParseTimeTableState(zeek::RecordType* rt); // Rebuilds all TableVals whose state was previously saved by @@ -1013,7 +1013,7 @@ public: static void RebuildParseTimeTables(); // Clears all state that was used to track TableVals that depending - // on zeek::detail::RecordTypes. + // on zeek::RecordTypes. static void DoneParsing(); protected: diff --git a/src/input/readers/config/Config.cc b/src/input/readers/config/Config.cc index e3199c78ba..56d93fcfb0 100644 --- a/src/input/readers/config/Config.cc +++ b/src/input/readers/config/Config.cc @@ -31,7 +31,7 @@ Config::Config(ReaderFrontend *frontend) : ReaderBackend(frontend) for ( const auto& entry : globals ) { - auto id = entry.second; + auto& id = entry.second; if ( ! id->IsOption() ) continue; diff --git a/src/plugin/Plugin.cc b/src/plugin/Plugin.cc index 941ee0038c..77b98c9760 100644 --- a/src/plugin/Plugin.cc +++ b/src/plugin/Plugin.cc @@ -471,10 +471,18 @@ void Plugin::MetaHookPost(::plugin::HookType hook, const HookArgumentList& args, void Plugin::MetaHookPre(::zeek::plugin::HookType hook, const HookArgumentList& args) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + MetaHookPre(static_cast<::plugin::HookType>(hook), args); +#pragma GCC diagnostic pop } void Plugin::MetaHookPost(::zeek::plugin::HookType hook, const HookArgumentList& args, HookArgument result) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + MetaHookPost(static_cast<::plugin::HookType>(hook), args, result); +#pragma GCC diagnostic pop } void Plugin::InitializeComponents() diff --git a/src/zeek.bif b/src/zeek.bif index 006df997e2..d63bf1453f 100644 --- a/src/zeek.bif +++ b/src/zeek.bif @@ -1918,7 +1918,7 @@ function global_sizes%(%): var_sizes for ( const auto& global : globals ) { - auto id = global.second; + auto& id = global.second; if ( id->HasVal() ) { auto id_name = make_intrusive(id->Name()); @@ -1946,7 +1946,7 @@ function global_ids%(%): id_table for ( const auto& global : globals ) { - zeek::detail::ID* id = global.second.get(); + const auto& id = global.second; static auto script_id = zeek::id::find_type("script_id"); auto rec = make_intrusive(script_id); rec->Assign(0, make_intrusive(type_name(id->GetType()->Tag())));