diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index a0412e91ff4..a116c9c2705 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -291,7 +291,7 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) { } } } else { - if (p_name == CoreStringNames::get_singleton()->_custom_features) { + if (p_name == CoreStringName(_custom_features)) { Vector custom_feature_array = String(p_value).split(","); for (int i = 0; i < custom_feature_array.size(); i++) { custom_features.insert(custom_feature_array[i]); @@ -875,7 +875,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const RBMapstore_32(count + 1); - String key = CoreStringNames::get_singleton()->_custom_features; + String key = CoreStringName(_custom_features); file->store_pascal_string(key); int len; diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp index 21645e5efc0..1ffe76495d8 100644 --- a/core/core_string_names.cpp +++ b/core/core_string_names.cpp @@ -33,12 +33,10 @@ CoreStringNames *CoreStringNames::singleton = nullptr; CoreStringNames::CoreStringNames() : - _free(StaticCString::create("free")), + free_(StaticCString::create("free")), changed(StaticCString::create("changed")), - _script(StaticCString::create("script")), + script(StaticCString::create("script")), script_changed(StaticCString::create("script_changed")), - ___pdcdata(StaticCString::create("___pdcdata")), - __getvar(StaticCString::create("__getvar")), _iter_init(StaticCString::create("_iter_init")), _iter_next(StaticCString::create("_iter_next")), _iter_get(StaticCString::create("_iter_get")), diff --git a/core/core_string_names.h b/core/core_string_names.h index 1c77cef567e..d7ddc39f5e1 100644 --- a/core/core_string_names.h +++ b/core/core_string_names.h @@ -50,12 +50,10 @@ public: static CoreStringNames *singleton; - StringName _free; + StringName free_; // "free", conflict with C++ keyword. StringName changed; - StringName _script; + StringName script; StringName script_changed; - StringName ___pdcdata; - StringName __getvar; StringName _iter_init; StringName _iter_next; StringName _iter_get; @@ -98,4 +96,6 @@ public: StringName property_list_changed; }; +#define CoreStringName(m_name) CoreStringNames::get_singleton()->m_name + #endif // CORE_STRING_NAMES_H diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 2cdfacae175..1928f86d6a8 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -1696,7 +1696,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo Variant value; - if (E.name == CoreStringNames::get_singleton()->_script) { + if (E.name == CoreStringName(script)) { Ref