From 1f6f364a56319eabd02c050746fe7df3f55ffee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 12 May 2020 17:01:17 +0200 Subject: Port member initialization from constructor to declaration (C++11) Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists. --- core/method_bind.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'core/method_bind.h') diff --git a/core/method_bind.h b/core/method_bind.h index b3d4f1bf9b..0092527a25 100644 --- a/core/method_bind.h +++ b/core/method_bind.h @@ -208,18 +208,18 @@ struct PtrToArg { class MethodBind { int method_id; - uint32_t hint_flags; + uint32_t hint_flags = METHOD_FLAGS_DEFAULT; StringName name; Vector default_arguments; - int default_argument_count; - int argument_count; + int default_argument_count = 0; + int argument_count = 0; - bool _const; - bool _returns; + bool _const = false; + bool _returns = false; protected: #ifdef DEBUG_METHODS_ENABLED - Variant::Type *argument_types; + Variant::Type *argument_types = nullptr; Vector arg_names; #endif void _set_const(bool p_const); @@ -304,12 +304,11 @@ public: typedef Variant (T::*NativeCall)(const Variant **, int, Callable::CallError &); protected: - NativeCall call_method; + NativeCall call_method = nullptr; #ifdef DEBUG_METHODS_ENABLED - MethodInfo arguments; - #endif + public: #ifdef DEBUG_METHODS_ENABLED @@ -384,7 +383,6 @@ public: virtual bool is_vararg() const { return true; } MethodBindVarArg() { - call_method = nullptr; _set_returns(true); } }; -- cgit v1.2.3