Fix code bugs caught by PVS-Studio#56
Merged
Gumball2415 merged 4 commits intoDn-Programming-Core-Management:devfrom Sep 11, 2021
Merged
Fix code bugs caught by PVS-Studio#56Gumball2415 merged 4 commits intoDn-Programming-Core-Management:devfrom
Gumball2415 merged 4 commits intoDn-Programming-Core-Management:devfrom
Conversation
stChannelState::Echo[3] was uninitialized prior to this fix. stChannelState::Echo is read by CFamiTrackerDoc::RetrieveSoundState(), a strange non-const function called upon recalling or retrieving channel state (eg. beginning playback). The algorithm is complex and I don't understand it. I'm just "fixing" it. The algorithm is strange and complex
m_iFrame - other.m_iFrame is intended to produce a negative result. In the old code, it produced a very large unsigned integer (bad), but it got casted to a negative signed integer upon * or %, so the code was merely unclear but not wrong. Anyway I've cleaned it up (at the cost of verbosity).
Collaborator
Author
|
not sure what bugs i failed to patch, but might as well push what's fixed so far |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It compiles, but I haven't fully tested that all the fixes are correct.
Outdated/incomplete explanations are at https://docs.google.com/document/d/1XZvoRhS5ucHrwnDav2-tlTOL9g02x0QRRBRIH9J3gpo/edit?usp=sharing.