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
Change a bunch of stuff to use std::string #8164
Conversation
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.
https://github.com/OpenTTD/OpenTTD/blob/master/README.md#30-licensing explicitly calls out a few exceptions to the default licensing. I think you should add a bit there about this new code.
Edit: the above was meant to be about fc190ac.
Hmm crash during regression check, and macos doesn't build. |
MacOS is easy and just a failure to compile. The regression seems to crash somewhere, have to investigate that. @Yexo I never checked that part of the readme actually, will add something. |
@@ -28,78 +28,81 @@ | |||
<Filter Include="MD5"> | |||
<UniqueIdentifier>{c76ff9f1-1e62-46d8-8d55-000000000008}</UniqueIdentifier> | |||
</Filter> | |||
<Filter Include="Script"> | |||
<Filter Include="Compat"> |
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.
Why have all of these filter/group names switched around... weird.
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.
Generate script uses alphabetical order. But it's weird MD5 is above.
Ah no, it just use the first seen order.
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.
It is also a diff algorithm artifact. A better diff would simply show Compat
being inserted after MD5 instead of all this single line shifting.
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.
I guess it's caused by all the UniqueIdentifier values getting renumbered.
std::pair is already the smallest possible pair, and it already handles non-POD types correctly.
…d also define it as char32_t.
Sourced from https://github.com/akrzemi1/Optional, Boost Software License, Version 1.0.
… with automatic destruction to simplify control flow in openttd_main.
This PR converts a more or less random selection of stuff to use std::string instead of manually managed strings. It is absolutely not complete in any sense, but then I don't think there's any point in trying to convert the whole source code in a massive effort at once.
Selection which parts to convert were basically made by randomly picking a starting point and then following the tendrils that go from there.
I've already continued with some other source code parts, so expect some more PRs.