Skip to content
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

ChunkFile: Handle bool in a stable way across platforms #3782

Merged
merged 1 commit into from
Apr 15, 2016

Conversation

lioncash
Copy link
Member

@lioncash lioncash commented Apr 15, 2016

bool is not always guaranteed to be the same size on every platform. On some platforms it may be one byte, on others it can be 8 bytes if the platform dictates it; it's implementation-defined.

This can be problematic when it comes to storing this data to disk (it can also be space-inefficient, but that's not really an issue in 2016). Also say for some reason you moved your savestates to another platform, it's possible they won't load correctly due to differences in size.

This change stores all bools to savestates as if they were a byte in size and handles the loading of them accordingly.

This was brought up by myself in #3759, and @delroth recommended that this be included within 5.0, so here it is.


This change is Reviewable

@lioncash lioncash added this to the Dolphin Release 5.0 milestone Apr 15, 2016
bool is not always guaranteed to be the same size on every platform.
On some platforms it may be one byte, on others it can be 8 bytes if the
platform dictates it. It's implementation-defined.

This can be problematic when it comes to storing this
data to disk (it can also be space-inefficient, but that's not really an
issue). Also say for some reason you moved your savestates to another
platform, it's possible they won't load correctly due to differences in size.

This change stores all bools to savestates as if they were a byte in size
and handles the loading of them accordingly.
@delroth delroth merged commit f980e20 into dolphin-emu:master Apr 15, 2016
@lioncash lioncash deleted the stable-bool branch April 15, 2016 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants