More MSVC warnings

This commit is contained in:
Pengfei Zhu
2022-07-01 23:52:14 +08:00
parent 981100611a
commit 826ac205d8
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -117,7 +117,7 @@ bool CIABuilder::Init(CIABuildType type_, const std::string& destination, TitleM
// TMD will be written in Finalize (we need to set content hash, etc)
tmd_offset = Common::AlignUp(ticket_offset + header.tik_size, CIA_ALIGNMENT);
header.tmd_size = tmd.GetSize();
header.tmd_size = static_cast<u32_le>(tmd.GetSize());
content_offset = Common::AlignUp(tmd_offset + header.tmd_size, CIA_ALIGNMENT);
header.content_size = 0;
@@ -221,7 +221,7 @@ bool CIABuilder::WriteTicket() {
}
title_key = GetTitleKey(ticket);
header.tik_size = ticket.GetSize();
header.tik_size = static_cast<u32_le>(ticket.GetSize());
file->Seek(ticket_offset, SEEK_SET);
if (!ticket.Save(*file)) {
+3 -2
View File
@@ -607,8 +607,9 @@ std::vector<u8> LoadSharedRomFS(const std::vector<u8>& data) {
std::vector<u8> result(ivfc.levels[2].size);
// Calculation from ctrtool
const std::size_t data_offset = offset + Common::AlignUp(sizeof(ivfc) + ivfc.master_hash_size,
(1 << ivfc.levels[2].block_size));
const std::size_t data_offset =
offset + Common::AlignUp(sizeof(ivfc) + ivfc.master_hash_size,
(1 << static_cast<std::size_t>(ivfc.levels[2].block_size)));
if (!CheckedMemcpy(result.data(), data, data_offset, ivfc.levels[2].size)) {
return {};
}