mirror of
https://github.com/jakcron/nstool
synced 2024-11-22 21:49:30 +00:00
Merge pull request #33 from jakcron/npdm-development
[nx] Silence warnings.
This commit is contained in:
commit
ca13bbd24b
4 changed files with 12 additions and 12 deletions
|
@ -48,11 +48,11 @@ void nx::AccessControlInfoBinary::toBytes()
|
|||
uint32_t offset, size;
|
||||
} fac, sac, kc;
|
||||
|
||||
fac.offset = align(sizeof(sAciHeader), aci::kSectionAlignSize);
|
||||
fac.offset = (uint32_t)align(sizeof(sAciHeader), aci::kSectionAlignSize);
|
||||
fac.size = (uint32_t)mFileSystemAccessControl.getBytes().size();
|
||||
sac.offset = align(fac.offset + fac.size, aci::kSectionAlignSize);
|
||||
sac.offset = (uint32_t)align(fac.offset + fac.size, aci::kSectionAlignSize);
|
||||
sac.size = (uint32_t)mServiceAccessControl.getBytes().size();
|
||||
kc.offset = align(sac.offset + sac.size, aci::kSectionAlignSize);
|
||||
kc.offset = (uint32_t)align(sac.offset + sac.size, aci::kSectionAlignSize);
|
||||
kc.size = (uint32_t)mKernelCapabilities.getBytes().size();
|
||||
|
||||
// get total size
|
||||
|
|
|
@ -52,11 +52,11 @@ void nx::AccessControlInfoDescBinary::toBytes()
|
|||
uint32_t offset, size;
|
||||
} fac, sac, kc;
|
||||
|
||||
fac.offset = align(sizeof(sAciDescHeader), aci::kSectionAlignSize);
|
||||
fac.offset = (uint32_t)align(sizeof(sAciDescHeader), aci::kSectionAlignSize);
|
||||
fac.size = (uint32_t)mFileSystemAccessControl.getBytes().size();
|
||||
sac.offset = align(fac.offset + fac.size, aci::kSectionAlignSize);
|
||||
sac.offset = (uint32_t)align(fac.offset + fac.size, aci::kSectionAlignSize);
|
||||
sac.size = (uint32_t)mServiceAccessControl.getBytes().size();
|
||||
kc.offset = align(sac.offset + sac.size, aci::kSectionAlignSize);
|
||||
kc.offset = (uint32_t)align(sac.offset + sac.size, aci::kSectionAlignSize);
|
||||
kc.size = (uint32_t)mKernelCapabilities.getBytes().size();
|
||||
|
||||
// get total size
|
||||
|
@ -72,7 +72,7 @@ void nx::AccessControlInfoDescBinary::toBytes()
|
|||
hdr->st_magic = aci::kAciDescStructMagic;
|
||||
|
||||
// set "acid size"
|
||||
hdr->signed_size = total_size - crypto::rsa::kRsa2048Size;
|
||||
hdr->signed_size = (uint32_t)(total_size - crypto::rsa::kRsa2048Size);
|
||||
|
||||
// set flags
|
||||
uint32_t flags = 0;
|
||||
|
|
|
@ -41,9 +41,9 @@ void nx::FileSystemAccessControlBinary::toBytes()
|
|||
uint32_t offset, size;
|
||||
} content, savedata;
|
||||
|
||||
content.offset = align(sizeof(sFacHeader), fac::kSectionAlignSize);
|
||||
content.offset = (uint32_t)align(sizeof(sFacHeader), fac::kSectionAlignSize);
|
||||
content.size = (uint32_t)(sizeof(uint32_t) + mContentOwnerIdList.size() * sizeof(uint64_t));
|
||||
savedata.offset = content.offset + (content.size > 0 ? align(content.size, fac::kSectionAlignSize) : 0);
|
||||
savedata.offset = (uint32_t)(content.offset + (content.size > 0 ? align(content.size, fac::kSectionAlignSize) : 0));
|
||||
savedata.size = (uint32_t)(sizeof(uint32_t) + align(mSaveDataOwnerIdList.size(), fac::kSectionAlignSize) + mSaveDataOwnerIdList.size() * sizeof(uint64_t));
|
||||
|
||||
// get total size
|
||||
|
@ -74,7 +74,7 @@ void nx::FileSystemAccessControlBinary::toBytes()
|
|||
// set ids
|
||||
le_uint32_t* content_owner_id_num = (le_uint32_t*)(mRawBinary.data() + content.offset);
|
||||
le_uint64_t* content_owner_ids = (le_uint64_t*)(mRawBinary.data() + content.offset + sizeof(uint32_t));
|
||||
content_owner_id_num->set(mContentOwnerIdList.size());
|
||||
content_owner_id_num->set((uint32_t)mContentOwnerIdList.size());
|
||||
for (size_t i = 0; i < mContentOwnerIdList.size(); i++)
|
||||
{
|
||||
content_owner_ids[i] = mContentOwnerIdList[i];
|
||||
|
@ -83,7 +83,7 @@ void nx::FileSystemAccessControlBinary::toBytes()
|
|||
le_uint32_t* save_data_owner_id_num = (le_uint32_t*)(mRawBinary.data() + savedata.offset);
|
||||
byte_t* save_data_owner_id_accessibility_array = (mRawBinary.data() + savedata.offset + sizeof(uint32_t));
|
||||
le_uint64_t* save_data_owner_ids = (le_uint64_t*)(mRawBinary.data() + savedata.offset + sizeof(uint32_t) + align(mSaveDataOwnerIdList.size(), sizeof(uint32_t)));
|
||||
save_data_owner_id_num->set(mSaveDataOwnerIdList.size());
|
||||
save_data_owner_id_num->set((uint32_t)mSaveDataOwnerIdList.size());
|
||||
for (size_t i = 0; i < mSaveDataOwnerIdList.size(); i++)
|
||||
{
|
||||
save_data_owner_id_accessibility_array[i] = mSaveDataOwnerIdList[i].access_type;
|
||||
|
|
|
@ -63,7 +63,7 @@ void nx::NpdmBinary::toBytes()
|
|||
|
||||
acid.offset = (uint32_t)align(sizeof(sNpdmHeader), npdm::kSectionAlignSize);
|
||||
acid.size = (uint32_t)mAcid.getBytes().size();
|
||||
aci.offset = (uint32_t)acid.offset + align(acid.size, npdm::kSectionAlignSize);
|
||||
aci.offset = (uint32_t)(acid.offset + align(acid.size, npdm::kSectionAlignSize));
|
||||
aci.size = (uint32_t)mAci.getBytes().size();
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue