diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2020-06-16 17:11:00 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2020-06-16 17:11:00 -0400 |
commit | 6580c05decb34d3c3faaa266fd411d0a1a7e8e0b (patch) | |
tree | 156d507097ab02858f78200e37d21da9794b7d00 | |
parent | 51434cf8bbf32f977946b91d29591691b18f73d0 (diff) |
KNARC: Fix typo in help string; suppress narrowing warnings
-rw-r--r-- | tools/knarc/Narc.cpp | 12 | ||||
-rw-r--r-- | tools/knarc/Source.cpp | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tools/knarc/Narc.cpp b/tools/knarc/Narc.cpp index 00a9d0ed..7ccdcf0e 100644 --- a/tools/knarc/Narc.cpp +++ b/tools/knarc/Narc.cpp @@ -177,7 +177,7 @@ bool Narc::Pack(const fs::path& fileName, const fs::path& directory) FileAllocationTable fat { .Id = 0x46415442, // BTAF - .ChunkSize = sizeof(FileAllocationTable) + ((uint32_t)fatEntries.size() * sizeof(FileAllocationTableEntry)), + .ChunkSize = static_cast<uint32_t>(sizeof(FileAllocationTable) + ((uint32_t)fatEntries.size() * sizeof(FileAllocationTableEntry))), .FileCount = static_cast<uint16_t>(fatEntries.size()), .Reserved = 0x0 }; @@ -222,7 +222,7 @@ bool Narc::Pack(const fs::path& fileName, const fs::path& directory) { fntEntries.push_back( { - .Offset = (directoryCounter + 1) * sizeof(FileNameTableEntry), + .Offset = static_cast<uint32_t>((directoryCounter + 1) * sizeof(FileNameTableEntry)), .FirstFileId = 0x0, .Utility = static_cast<uint16_t>(directoryCounter + 1) }); @@ -231,7 +231,7 @@ bool Narc::Pack(const fs::path& fileName, const fs::path& directory) { fntEntries.push_back( { - .Offset = fntEntries.back().Offset + subTables[paths[i]].size(), + .Offset = static_cast<uint32_t>(fntEntries.back().Offset + subTables[paths[i]].size()), .FirstFileId = fntEntries.back().FirstFileId, .Utility = 0x0 }); @@ -265,7 +265,7 @@ bool Narc::Pack(const fs::path& fileName, const fs::path& directory) FileNameTable fnt { .Id = 0x464E5442, // BTNF - .ChunkSize = sizeof(FileNameTable) + (fntEntries.size() * sizeof(FileNameTableEntry)) + .ChunkSize = static_cast<uint32_t>(sizeof(FileNameTable) + (fntEntries.size() * sizeof(FileNameTableEntry))) }; if (!pack_no_fnt) @@ -284,7 +284,7 @@ bool Narc::Pack(const fs::path& fileName, const fs::path& directory) FileImages fi { .Id = 0x46494D47, // GMIF - .ChunkSize = sizeof(FileImages) + fatEntries.back().End + .ChunkSize = static_cast<uint32_t>(sizeof(FileImages) + fatEntries.back().End) }; if ((fi.ChunkSize % 4) != 0) @@ -297,7 +297,7 @@ bool Narc::Pack(const fs::path& fileName, const fs::path& directory) .Id = 0x4352414E, // NARC .ByteOrderMark = 0xFFFE, .Version = 0x100, - .FileSize = sizeof(Header) + fat.ChunkSize + fnt.ChunkSize + fi.ChunkSize, + .FileSize = static_cast<uint32_t>(sizeof(Header) + fat.ChunkSize + fnt.ChunkSize + fi.ChunkSize), .ChunkSize = sizeof(Header), .ChunkCount = 0x3 }; diff --git a/tools/knarc/Source.cpp b/tools/knarc/Source.cpp index 32756c69..21020891 100644 --- a/tools/knarc/Source.cpp +++ b/tools/knarc/Source.cpp @@ -37,7 +37,7 @@ static inline void usage() { cout << "\t-d DIRECTORY\tDirectory to pack from/unpack to" << endl; cout << "\t-p TARGET\tPack to the target NARC" << endl; cout << "\t-u SOURCE\tUnpack from the source NARC" << endl; - cout << "\t-n\tSuppress building the filename table" << endl; + cout << "\t-n\tBuild the filename table (default: discards filenames)" << endl; cout << "\t-D/--debug\tPrint additional debug messages" << endl; cout << "\t-h/--help\tPrint this message and exit" << endl; } |