mark return value of `get_class_static` and `get_parent_class_static` as const

pull/1463/head
Daylily-Zeleen 2024-05-17 02:06:59 +08:00
parent ad307e4b9c
commit 3db8549e19
1 changed files with 8 additions and 8 deletions

View File

@ -95,8 +95,8 @@ protected:
virtual ~Wrapped() {} virtual ~Wrapped() {}
public: public:
static StringName &get_class_static() { static const StringName &get_class_static() {
static StringName string_name = StringName("Wrapped"); static const StringName string_name = StringName("Wrapped");
return string_name; return string_name;
} }
@ -228,12 +228,12 @@ public:
initialized = true; \ initialized = true; \
} \ } \
\ \
static ::godot::StringName &get_class_static() { \ static const ::godot::StringName &get_class_static() { \
static ::godot::StringName string_name = ::godot::StringName(#m_class); \ static const ::godot::StringName string_name = ::godot::StringName(#m_class); \
return string_name; \ return string_name; \
} \ } \
\ \
static ::godot::StringName &get_parent_class_static() { \ static const ::godot::StringName &get_parent_class_static() { \
return m_inherits::get_class_static(); \ return m_inherits::get_class_static(); \
} \ } \
\ \
@ -435,12 +435,12 @@ public:
\ \
static void initialize_class() {} \ static void initialize_class() {} \
\ \
static ::godot::StringName &get_class_static() { \ static const ::godot::StringName &get_class_static() { \
static ::godot::StringName string_name = ::godot::StringName(#m_alias_for); \ static const ::godot::StringName string_name = ::godot::StringName(#m_alias_for); \
return string_name; \ return string_name; \
} \ } \
\ \
static ::godot::StringName &get_parent_class_static() { \ static const ::godot::StringName &get_parent_class_static() { \
return m_inherits::get_class_static(); \ return m_inherits::get_class_static(); \
} \ } \
\ \