- Updated initial new_string copy to use copy constructor/increase ref count instead of copying to new allocated memory
- Removed Variant copies from Array before assigning to String
- Only convert i to String when needed
- refactored and renamed String::_camelcase_to_underscore to String:_separate_compound_words
- refactored String::to_snake_case to work with the refactored String::_separate_compound_words
- created char_utils::is_hyphen to catch all hyphen variants in kebab-case conversion
- created String::to_kebab_case using the new String::_separate_compound_words
- created corresponding Documentation in String and StringName
- simplified both switch statements in EditorNode and ProjectDialog
- added new kebab-casing Option for Node Names in ProjectSettings
- added missing camelCase Options to Scene- and Node-Names in ProjectSettings
- simplified Mono RuntimeInterop Functions
- hooked up the ConnectionsDialog
- created additional Unit Tests
Use `Span::find` for `LocalVector::find`, accepting negative `p_from`.
Return `-1` for invalid `p_from` values in `rfind`.
Accept negative values for `p_from` in `find`, starting from the back.
This fixes UBSAN errors reported by running our testsuite, importing the
TPS demo, and running the TPS demo. I have tried, wherever possible, to
fix issues related to reported issues but not directly reported by UBSAN
because thse code paths just happened to not have been exercised in
these cases.
These fixes apply only to errors reported, and caused by, core/
The following things have been changed:
* Make sure there are no implicit sign changing casts in core.
* Explicitly type enums that are part of a public API such that users of
the API cannot pass in wrongly-sized values leading to potential stack
corruption.
* Ensure that memcpy is never called with invalid or null pointers as
this is undefined behavior, and when the engine is built with
optimizations turned on leads to memory corruption and hard to debug
crashes.
* Replace enum values only used as static values with constexpr static
const values instead. This has no runtime overhead. This makes it so
that the size of the enums is explicit.
* Make sure that nan and inf is handled consistently in String.
* Implement a _to_int template to ensure that all of the paths use the
same algorhithm, and correct the negative integer case.
* Changed the way the json serializer precision work, and added tests to
verify the new behavior. The behavior doesn't quite match master in
particulary for negative doubles as the original code tried to cast -inf
to an int. This then led to negative doubles losing all but one of
their decimal points when serializing. Behavior in GDScript remains
unchanged.