diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/config/project_settings.cpp | 4 | ||||
-rw-r--r-- | core/core_constants.cpp | 1 | ||||
-rw-r--r-- | core/math/bvh_tree.h | 2 | ||||
-rw-r--r-- | core/object/make_virtuals.py | 12 | ||||
-rw-r--r-- | core/string/ustring.cpp | 25 | ||||
-rw-r--r-- | core/templates/hashfuncs.h | 5 | ||||
-rw-r--r-- | core/templates/paged_array.h | 2 |
7 files changed, 31 insertions, 20 deletions
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index a1b22e7f7d..4d19a93991 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -119,6 +119,10 @@ const PackedStringArray ProjectSettings::get_unsupported_features(const PackedSt PackedStringArray supported_features = singleton->_get_supported_features(); for (int i = 0; i < p_project_features.size(); i++) { if (!supported_features.has(p_project_features[i])) { + // Temporary compatibility code to ease upgrade to 4.0 beta 2+. + if (p_project_features[i].begins_with("Vulkan")) { + continue; + } unsupported_features.append(p_project_features[i]); } } diff --git a/core/core_constants.cpp b/core/core_constants.cpp index 2f8b28363b..c784d87c87 100644 --- a/core/core_constants.cpp +++ b/core/core_constants.cpp @@ -646,6 +646,7 @@ void register_global_constants() { BIND_CORE_ENUM_CONSTANT(PROPERTY_USAGE_DEFERRED_SET_RESOURCE); BIND_CORE_ENUM_CONSTANT(PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT); BIND_CORE_ENUM_CONSTANT(PROPERTY_USAGE_EDITOR_BASIC_SETTING); + BIND_CORE_ENUM_CONSTANT(PROPERTY_USAGE_READ_ONLY); BIND_CORE_ENUM_CONSTANT(PROPERTY_USAGE_ARRAY); BIND_CORE_ENUM_CONSTANT(PROPERTY_USAGE_DEFAULT); diff --git a/core/math/bvh_tree.h b/core/math/bvh_tree.h index cdb2bb4413..8291394b31 100644 --- a/core/math/bvh_tree.h +++ b/core/math/bvh_tree.h @@ -235,7 +235,7 @@ private: // no need to keep back references for children at the moment - uint32_t sibling_id; // always a node id, as tnode is never a leaf + uint32_t sibling_id = 0; // always a node id, as tnode is never a leaf bool sibling_present = false; // if there are more children, or this is the root node, don't try and delete diff --git a/core/object/make_virtuals.py b/core/object/make_virtuals.py index c18d70d9f6..326a9277ff 100644 --- a/core/object/make_virtuals.py +++ b/core/object/make_virtuals.py @@ -5,11 +5,11 @@ mutable bool _gdvirtual_##m_name##_initialized = false;\\ mutable GDNativeExtensionClassCallVirtual _gdvirtual_##m_name = nullptr;\\ template<bool required>\\ _FORCE_INLINE_ bool _gdvirtual_##m_name##_call($CALLARGS) $CONST { \\ - ScriptInstance *script_instance = ((Object*)(this))->get_script_instance();\\ - if (script_instance) {\\ + ScriptInstance *_script_instance = ((Object*)(this))->get_script_instance();\\ + if (_script_instance) {\\ Callable::CallError ce; \\ $CALLSIARGS\\ - $CALLSIBEGINscript_instance->callp(_gdvirtual_##m_name##_sn, $CALLSIARGPASS, ce);\\ + $CALLSIBEGIN_script_instance->callp(_gdvirtual_##m_name##_sn, $CALLSIARGPASS, ce);\\ if (ce.error == Callable::CallError::CALL_OK) {\\ $CALLSIRET\\ return true;\\ @@ -35,9 +35,9 @@ _FORCE_INLINE_ bool _gdvirtual_##m_name##_call($CALLARGS) $CONST { \\ return false;\\ }\\ _FORCE_INLINE_ bool _gdvirtual_##m_name##_overridden() const { \\ - ScriptInstance *script_instance = ((Object*)(this))->get_script_instance();\\ - if (script_instance) {\\ - return script_instance->has_method(_gdvirtual_##m_name##_sn);\\ + ScriptInstance *_script_instance = ((Object*)(this))->get_script_instance();\\ + if (_script_instance) {\\ + return _script_instance->has_method(_gdvirtual_##m_name##_sn);\\ }\\ if (unlikely(_get_extension() && !_gdvirtual_##m_name##_initialized)) {\\ _gdvirtual_##m_name = (_get_extension() && _get_extension()->get_virtual) ? _get_extension()->get_virtual(_get_extension()->class_userdata, #m_name) : (GDNativeExtensionClassCallVirtual) nullptr;\\ diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index d8b93998af..75b797d397 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -2624,10 +2624,11 @@ double String::to_float() const { uint32_t String::hash(const char *p_cstr) { uint32_t hashv = 5381; - uint32_t c; + uint32_t c = *p_cstr++; - while ((c = *p_cstr++)) { + while (c) { hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */ + c = *p_cstr++; } return hashv; @@ -2653,10 +2654,11 @@ uint32_t String::hash(const wchar_t *p_cstr, int p_len) { uint32_t String::hash(const wchar_t *p_cstr) { uint32_t hashv = 5381; - uint32_t c; + uint32_t c = *p_cstr++; - while ((c = *p_cstr++)) { + while (c) { hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */ + c = *p_cstr++; } return hashv; @@ -2673,10 +2675,11 @@ uint32_t String::hash(const char32_t *p_cstr, int p_len) { uint32_t String::hash(const char32_t *p_cstr) { uint32_t hashv = 5381; - uint32_t c; + uint32_t c = *p_cstr++; - while ((c = *p_cstr++)) { + while (c) { hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */ + c = *p_cstr++; } return hashv; @@ -2687,10 +2690,11 @@ uint32_t String::hash() const { const char32_t *chr = get_data(); uint32_t hashv = 5381; - uint32_t c; + uint32_t c = *chr++; - while ((c = *chr++)) { + while (c) { hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */ + c = *chr++; } return hashv; @@ -2701,10 +2705,11 @@ uint64_t String::hash64() const { const char32_t *chr = get_data(); uint64_t hashv = 5381; - uint64_t c; + uint64_t c = *chr++; - while ((c = *chr++)) { + while (c) { hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */ + c = *chr++; } return hashv; diff --git a/core/templates/hashfuncs.h b/core/templates/hashfuncs.h index d85cdf7adc..456a7b01ed 100644 --- a/core/templates/hashfuncs.h +++ b/core/templates/hashfuncs.h @@ -61,10 +61,11 @@ static _FORCE_INLINE_ uint32_t hash_djb2(const char *p_cstr) { const unsigned char *chr = (const unsigned char *)p_cstr; uint32_t hash = 5381; - uint32_t c; + uint32_t c = *chr++; - while ((c = *chr++)) { + while (c) { hash = ((hash << 5) + hash) ^ c; /* hash * 33 ^ c */ + c = *chr++; } return hash; diff --git a/core/templates/paged_array.h b/core/templates/paged_array.h index f1ede556e6..2992dd463e 100644 --- a/core/templates/paged_array.h +++ b/core/templates/paged_array.h @@ -268,7 +268,7 @@ public: uint32_t remainder = count & page_size_mask; T *remainder_page = nullptr; - uint32_t remainder_page_id; + uint32_t remainder_page_id = 0; if (remainder > 0) { uint32_t last_page = _get_pages_in_use() - 1; |