diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-10-03 08:43:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-03 08:43:43 +0200 |
commit | 64962fe605b48ecec3a5cde53c73c220031ececc (patch) | |
tree | 974d7870e5f7fea6384b1eba55d1ca207e9463e4 | |
parent | 9941c5a13260a3abe7a131d3f1f6c5fa1ef8e6b6 (diff) | |
parent | 2c8980f44cda8ac75890c54305c87dd85a83361a (diff) |
Merge pull request #22653 from neikeq/mono-mod-fix-gcc-warnings
Fix GCC compiler warning in mono module
-rw-r--r-- | modules/mono/editor/bindings_generator.cpp | 4 | ||||
-rw-r--r-- | modules/mono/editor/mono_bottom_panel.cpp | 6 | ||||
-rw-r--r-- | modules/mono/utils/mono_reg_utils.cpp | 2 | ||||
-rw-r--r-- | modules/mono/utils/thread_local.h | 20 |
4 files changed, 19 insertions, 13 deletions
diff --git a/modules/mono/editor/bindings_generator.cpp b/modules/mono/editor/bindings_generator.cpp index 308c54ecb3..2c3435fc1c 100644 --- a/modules/mono/editor/bindings_generator.cpp +++ b/modules/mono/editor/bindings_generator.cpp @@ -2244,8 +2244,8 @@ void BindingsGenerator::_populate_global_constants() { String constant_name = GlobalConstants::get_global_constant_name(i); const DocData::ConstantDoc *const_doc = NULL; - for (int i = 0; i < global_scope_doc.constants.size(); i++) { - const DocData::ConstantDoc &curr_const_doc = global_scope_doc.constants[i]; + for (int j = 0; j < global_scope_doc.constants.size(); j++) { + const DocData::ConstantDoc &curr_const_doc = global_scope_doc.constants[j]; if (curr_const_doc.name == constant_name) { const_doc = &curr_const_doc; diff --git a/modules/mono/editor/mono_bottom_panel.cpp b/modules/mono/editor/mono_bottom_panel.cpp index ecc3e4c59e..8d9b345a92 100644 --- a/modules/mono/editor/mono_bottom_panel.cpp +++ b/modules/mono/editor/mono_bottom_panel.cpp @@ -475,14 +475,14 @@ void MonoBuildTab::_bind_methods() { } MonoBuildTab::MonoBuildTab(const MonoBuildInfo &p_build_info, const String &p_logs_dir) : - build_info(p_build_info), - logs_dir(p_logs_dir), build_exited(false), issues_list(memnew(ItemList)), error_count(0), warning_count(0), errors_visible(true), - warnings_visible(true) { + warnings_visible(true), + logs_dir(p_logs_dir), + build_info(p_build_info) { issues_list->set_v_size_flags(SIZE_EXPAND_FILL); issues_list->connect("item_activated", this, "_issue_activated"); add_child(issues_list); diff --git a/modules/mono/utils/mono_reg_utils.cpp b/modules/mono/utils/mono_reg_utils.cpp index 8116df5f51..6bb6efa92a 100644 --- a/modules/mono/utils/mono_reg_utils.cpp +++ b/modules/mono/utils/mono_reg_utils.cpp @@ -228,4 +228,4 @@ cleanup: } } // namespace MonoRegUtils -#endif WINDOWS_ENABLED +#endif // WINDOWS_ENABLED diff --git a/modules/mono/utils/thread_local.h b/modules/mono/utils/thread_local.h index 84dae1d86b..d7d98c47e2 100644 --- a/modules/mono/utils/thread_local.h +++ b/modules/mono/utils/thread_local.h @@ -108,17 +108,23 @@ class ThreadLocal { return data; } + void _initialize(const T &p_init_val) { + init_val = p_init_val; + storage.alloc(&destr_callback); + } + public: - ThreadLocal() : - ThreadLocal(T()) {} + ThreadLocal() { + _initialize(T()); + } - ThreadLocal(const T &p_init_val) : - init_val(p_init_val) { - storage.alloc(&destr_callback); + ThreadLocal(const T &p_init_val) { + _initialize(p_init_val); } - ThreadLocal(const ThreadLocal &other) : - ThreadLocal(*other._tls_get_value()) {} + ThreadLocal(const ThreadLocal &other) { + _initialize(*other._tls_get_value()); + } ~ThreadLocal() { storage.free(); |