Fix warnings in emucore

This commit is contained in:
Nekotekina Aux1 2020-03-04 17:08:40 +03:00 committed by Nekotekina
parent f2f3321952
commit 250736ece5
48 changed files with 189 additions and 193 deletions

View file

@ -744,7 +744,7 @@ bool SCEDecrypter::DecryptData()
// Calculate the total data size.
for (unsigned int i = 0; i < meta_hdr.section_count; i++)
{
data_buf_length += meta_shdr[i].data_size;
data_buf_length += ::narrow<u32>(meta_shdr[i].data_size, HERE);
}
// Allocate a buffer to store decrypted data.
@ -798,7 +798,7 @@ bool SCEDecrypter::DecryptData()
}
// Advance the buffer's offset.
data_buf_offset += meta_shdr[i].data_size;
data_buf_offset += ::narrow<u32>(meta_shdr[i].data_size, HERE);
}
return true;
@ -828,7 +828,7 @@ std::vector<fs::file> SCEDecrypter::MakeFile()
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;
strm.opaque = Z_NULL;
strm.avail_in = meta_shdr[i].data_size;
strm.avail_in = ::narrow<uInt>(meta_shdr[i].data_size, HERE);
strm.avail_out = BUFSIZE;
strm.next_in = data_buf.get()+data_buf_offset;
strm.next_out = tempbuf;
@ -873,7 +873,7 @@ std::vector<fs::file> SCEDecrypter::MakeFile()
}
// Advance the data buffer offset by data size.
data_buf_offset += meta_shdr[i].data_size;
data_buf_offset += ::narrow<u32>(meta_shdr[i].data_size, HERE);
if (out_f.pos() != out_f.size())
fmt::throw_exception("MakeELF written bytes (%llu) does not equal buffer size (%llu).", out_f.pos(), out_f.size());
@ -1238,7 +1238,7 @@ bool SELFDecrypter::DecryptData()
if (meta_shdr[i].encrypted == 3)
{
if ((meta_shdr[i].key_idx <= meta_hdr.key_count - 1) && (meta_shdr[i].iv_idx <= meta_hdr.key_count))
data_buf_length += meta_shdr[i].data_size;
data_buf_length += ::narrow<u32>(meta_shdr[i].data_size, HERE);
}
}
@ -1284,7 +1284,7 @@ bool SELFDecrypter::DecryptData()
memcpy(data_buf.get() + data_buf_offset, buf.get(), meta_shdr[i].data_size);
// Advance the buffer's offset.
data_buf_offset += meta_shdr[i].data_size;
data_buf_offset += ::narrow<u32>(meta_shdr[i].data_size, HERE);
}
}
}