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

Movie: Replace some C style arrays with std::array #6612

Merged
merged 1 commit into from May 6, 2018

Conversation

leoetlino
Copy link
Member

This replaces some C style arrays with std::array to make copying
and comparing arrays slightly nicer.

@@ -73,8 +72,7 @@ void SaveToDTM(Movie::DTMHeader* dtm)
dtm->bEFBCopyEnable = true;
dtm->bEFBCopyCacheEnable = false;

strncpy(reinterpret_cast<char*>(dtm->videoBackend), video_backend.c_str(),
ArraySize(dtm->videoBackend));
strncpy(dtm->videoBackend.data(), video_backend.c_str(), sizeof(dtm->videoBackend));

This comment was marked as off-topic.

strncpy((char*)header.author, s_author.c_str(), ArraySize(header.author));
memcpy(header.md5, s_MD5, 16);
strncpy(header.discChange.data(), s_discChange.c_str(), sizeof(header.discChange));
strncpy(header.author.data(), s_author.c_str(), sizeof(header.author));

This comment was marked as off-topic.

This replaces some C style arrays with std::array to make copying
and comparing arrays slightly nicer.
@leoetlino
Copy link
Member Author

@BhaaLseN sure, changed to make it look more consistent.

Copy link
Member

@BhaaLseN BhaaLseN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested it, but the changes look sane to me.

@leoetlino leoetlino merged commit 32235f9 into dolphin-emu:master May 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants