From e8e424ade8d5eb960515079b367229c865230794 Mon Sep 17 00:00:00 2001 From: Daylily-Zeleen Date: Fri, 17 May 2024 02:06:59 +0800 Subject: [PATCH] mark return value of `get_class_static` and `get_parent_class_static` as const (cherry picked from commit 3db8549e19641d49dfcdf3055da6917699c07d1f) --- include/godot_cpp/classes/wrapped.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/include/godot_cpp/classes/wrapped.hpp b/include/godot_cpp/classes/wrapped.hpp index 0452e42d..e4042991 100644 --- a/include/godot_cpp/classes/wrapped.hpp +++ b/include/godot_cpp/classes/wrapped.hpp @@ -94,8 +94,8 @@ protected: virtual ~Wrapped() {} public: - static StringName &get_class_static() { - static StringName string_name = StringName("Wrapped"); + static const StringName &get_class_static() { + static const StringName string_name = StringName("Wrapped"); return string_name; } @@ -208,12 +208,12 @@ public: initialized = true; \ } \ \ - static ::godot::StringName &get_class_static() { \ - static ::godot::StringName string_name = ::godot::StringName(#m_class); \ + static const ::godot::StringName &get_class_static() { \ + static const ::godot::StringName string_name = ::godot::StringName(#m_class); \ return string_name; \ } \ \ - static ::godot::StringName &get_parent_class_static() { \ + static const ::godot::StringName &get_parent_class_static() { \ return m_inherits::get_class_static(); \ } \ \ @@ -418,12 +418,12 @@ public: \ static void initialize_class() {} \ \ - static ::godot::StringName &get_class_static() { \ - static ::godot::StringName string_name = ::godot::StringName(#m_alias_for); \ + static const ::godot::StringName &get_class_static() { \ + static const ::godot::StringName string_name = ::godot::StringName(#m_alias_for); \ return string_name; \ } \ \ - static ::godot::StringName &get_parent_class_static() { \ + static const ::godot::StringName &get_parent_class_static() { \ return m_inherits::get_class_static(); \ } \ \