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
IOS/Network/KD: Minor tidy-up changes #10053
Conversation
- Make use of std::array - Move helper functions inside it as lambdas - Eliminate sign-conversions that were occurring (promotion of u8 to int)
These functions don't touch any class state, so they can be turned into internal helper functions. While we're at it, we can move the enumerations as well.
Makes it a distinct type instead of decaying to an ambiguous u8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM (aside from that one remark, which seems like IWYU), untested.
…f maps Currently we were using heap allocating maps that last for the entire duration of the emulator running. Given the size N of both of these maps are very small (< 20 elements), we can just make use of an array of pairs and perform linear scans. This is also fine, given this code isn't particularly "hot" either, so this won't be run often.
Makes the enum strongly typed instead of interacting with a raw u32 value. While we're at it, we can add helpers to the NWC24Config to make using code poke at the internals of the class a little bit less and also make the querying a little nicer to read.
… class These are only used internally and not intended to be used outside of the class itself.
According to WiiBrew this is a version number (thanks to Awesomebing1 for documenting this!)
These are only ever used here, so they can be turned into an internal implementation detail.
Silences compiler warnings and also makes the conversions here explicit to the reader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r1, 2 of 2 files at r2, 1 of 1 files at r3, 1 of 1 files at r4, 1 of 1 files at r5, 1 of 1 files at r6, 3 of 3 files at r7, 1 of 1 files at r8, 2 of 2 files at r9, 2 of 2 files at r10, 1 of 1 files at r11, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @lioncash)
Initially this was only intended to change the maps in NetKDRequest's getter functions, but snowballed into this overall set of changes as possible improvements were noticed.
Each commit is relatively self-isolated from the surrounding changes to make for ease of piece-by-piece review.