-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GDNative: fix StringName equal and less operators #63104
Conversation
I haven't had the chance to test this change in godot-rust yet, hopefully will get around to it later today. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me. I'll wait for feedback on how it fares in godot-rust to merge.
Added tests in godot-rust/gdnative#912, they are currently failing as expected. When I compile Godot locally with the change in this PR, they pass. I couldn't use this exact revision since godot-rust is still based on Godot 3.4, so I cherry-picked my commit from here onto an older Godot revision (for my local tests). TLDR: ready from my side. |
Thanks! |
912: Test + workaround: `Eq/Ord` for `StringName` r=Bromeon a=Bromeon Upstream bug, see godotengine/godot#63104 This adds tests for `StringName`'s equality and ordering relation. Co-authored-by: Jan Haller <[email protected]>
912: Test + workaround: `Eq/Ord` for `StringName` r=Bromeon a=Bromeon Upstream bug, see godotengine/godot#63104 This adds tests for `StringName`'s equality and ordering relation. Co-authored-by: Jan Haller <[email protected]>
912: Test + workaround: `Eq/Ord` for `StringName` r=Bromeon a=Bromeon Upstream bug, see godotengine/godot#63104 This adds tests for `StringName`'s equality and ordering relation. Co-authored-by: Jan Haller <[email protected]>
912: Test + workaround: `Eq/Ord` for `StringName` r=Bromeon a=Bromeon Upstream bug, see godotengine/godot#63104 This adds tests for `StringName`'s equality and ordering relation. Co-authored-by: Jan Haller <[email protected]>
912: Test + workaround: `Eq/Ord` for `StringName` r=Bromeon a=Bromeon Upstream bug, see godotengine/godot#63104 This adds tests for `StringName`'s equality and ordering relation. Co-authored-by: Jan Haller <[email protected]>
The
new
function accepts a pointer, where it constructs aStringName
in-place:This means that it's possible to have different pointers to the same
StringName
.However, the
equal
andless
methods only compare that pointer:And to do that, they wouldn't need to first cast to
StringName*
. It looks like forgotten dereferencing.