[scummvm-devel] RFC: What should happen when adding \0 to a String?
fedor_qd at mail.ru
fedor_qd at mail.ru
Fri Jul 9 11:06:21 UTC 2021
Can you tell from which commit srtring class got these changes?
--
Отправлено из myMail для Android среда, 07 июля 2021г., 16:24 +03:00 от Thierry Crozat via scummvm-devel scummvm-devel at lists.scummvm.org :
>Modelling Common::String on std::string for this behaviour seems OK to me. This may not however magically fix engines that were broken with previous changes to the String class. The old behaviour indeed did not match the std::string behaviour (for example it considered that "hello" and "hello\0world" were equal), and thus we may still need to fix some engines.
>
>But considering how confusing the old behaviour of String was (allowing adding null characters as part of the string, but having some of the String operators and functions assuming null-terminated strings) I thing it best to aim for std::string behaviour and continue to fix engines that broke because of the change.
>
>Note that another engine that broke with the String change is supernova. However since I have now changed the code to no longer add null characters to strings, it will not be impacted by further changes.
>
>Thierry
>
> On 7 Jul 2021, at 11:42, Torbjörn Andersson via scummvm-devel < scummvm-devel at lists.scummvm.org> wrote:
>
>> On 30/06/2021 10.10, Walter van Niftrik wrote:
>> I agree with Filippos and think we should model this after std::string.
>> Walter
>
> So are there any objections to making that change now, so that we can deal with whatever the fallout now rather than just before the next release (whenever that is)? The warning would be kept for now, but probably reworded.
>
> As I recall it, we've already fixed regressions this behavior would cause in Mohawk and Myst3, as well as a few probably harmless cases elsewhere. And making the change should fix the ADL engine, which is currently completely broken for at least Time Zone and The Dark Crystal.
>
> Torbjörn Andersson
> _______________________________________________
> scummvm-devel mailing list
> scummvm-devel at lists.scummvm.org
> https://lists.scummvm.org/listinfo/scummvm-devel
>_______________________________________________
>scummvm-devel mailing list
>scummvm-devel at lists.scummvm.org
>https://lists.scummvm.org/listinfo/scummvm-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scummvm.org/pipermail/scummvm-devel/attachments/20210709/e8487f21/attachment.htm>
More information about the scummvm-devel
mailing list