forked from Mudlet/Mudlet
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: make Mudlet binary map saves with Qt6 compatible with Qt5 builds (…
…Mudlet#7007) #### Brief overview of PR changes/additions `static_cast<qint32>(...)` all Qt container `size()`/`count()`s when writing them to a binary map file. #### Motivation for adding to Mudlet The return type from a Qt "container" type (well in fact ALL classes) `size()`/`count()` operation is now defined as `qsizetype` which just happens to effectively be a `int64_t` (`qint64`, 8 bytes) unfortunately in the past - for Qt5 it was an `int`, which for all the platforms we compile Mudlet on corresponds to an `int32_t` (`qint32`, 4 bytes). The differences in size means that writing them to a `QDataStream` produces incompatible files. The simplest fix, given that we are not expecting *any* value so produced to overflow the prior `int32_t` type is to explicitly `static_cast` the values in all cases. #### Other info (issues closed, discussion etc) This will close Mudlet#7003 Signed-off-by: Stephen Lyons <[email protected]>
- Loading branch information
Showing
4 changed files
with
27 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters