1
0
Fork 0
forked from suyu/suyu

Merge pull request #4366 from lioncash/mii-sign

mii/manager: Resolve sign mismatch warnings
This commit is contained in:
bunnei 2020-07-17 20:13:06 -04:00 committed by GitHub
commit 47b305387a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,9 +104,9 @@ MiiInfo ConvertStoreDataToInfo(const MiiStoreData& data) {
u16 GenerateCrc16(const void* data, std::size_t size) { u16 GenerateCrc16(const void* data, std::size_t size) {
s32 crc{}; s32 crc{};
for (int i = 0; i < size; i++) { for (std::size_t i = 0; i < size; i++) {
crc ^= reinterpret_cast<const u8*>(data)[i] << 8; crc ^= static_cast<const u8*>(data)[i] << 8;
for (int j = 0; j < 8; j++) { for (std::size_t j = 0; j < 8; j++) {
crc <<= 1; crc <<= 1;
if ((crc & 0x10000) != 0) { if ((crc & 0x10000) != 0) {
crc = (crc ^ 0x1021) & 0xFFFF; crc = (crc ^ 0x1021) & 0xFFFF;