diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2016-11-27 11:56:22 +0100 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2016-12-06 20:33:53 +0100 |
| commit | 31ccfffd386cdf7bfafdccda240a179431ecc98c (patch) | |
| tree | 820bdb640091e5726e4c52d42f819956f82bfd28 /Source/Core/DiscIO/WbfsBlob.cpp | |
| parent | 7192789c1162e2deb5923151d05158f459448ab9 (diff) | |
Common: Add alignment header
Gets rid of duplicated alignment code.
Diffstat (limited to 'Source/Core/DiscIO/WbfsBlob.cpp')
| -rw-r--r-- | Source/Core/DiscIO/WbfsBlob.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Source/Core/DiscIO/WbfsBlob.cpp b/Source/Core/DiscIO/WbfsBlob.cpp index af244d9e68..6acbe5d0b3 100644 --- a/Source/Core/DiscIO/WbfsBlob.cpp +++ b/Source/Core/DiscIO/WbfsBlob.cpp @@ -9,6 +9,7 @@ #include <string> #include <vector> +#include "Common/Align.h" #include "Common/CommonFuncs.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" @@ -22,11 +23,6 @@ static const u64 WII_SECTOR_SIZE = 0x8000; static const u64 WII_SECTOR_COUNT = 143432 * 2; static const u64 WII_DISC_HEADER_SIZE = 256; -static inline u64 align(u64 value, u64 bounds) -{ - return (value + (bounds - 1)) & (~(bounds - 1)); -} - WbfsFileReader::WbfsFileReader(const std::string& filename) : m_total_files(0), m_size(0), m_good(true) { @@ -104,7 +100,7 @@ bool WbfsFileReader::ReadHeader() m_blocks_per_disc = (WII_SECTOR_COUNT * WII_SECTOR_SIZE + m_wbfs_sector_size - 1) / m_wbfs_sector_size; m_disc_info_size = - align(WII_DISC_HEADER_SIZE + m_blocks_per_disc * sizeof(u16), m_hd_sector_size); + Common::AlignUp(WII_DISC_HEADER_SIZE + m_blocks_per_disc * sizeof(u16), m_hd_sector_size); return m_header.disc_table[0] != 0; } |
