From f6f77bf6398cd6b06ce6778fafc772ed42261a3e Mon Sep 17 00:00:00 2001 From: AJR Date: Fri, 31 Dec 2021 13:27:44 -0500 Subject: Move filesystem library into separate namespace and use shorter uX type names there --- src/lib/formats/fsblk_vec.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/lib/formats/fsblk_vec.cpp') diff --git a/src/lib/formats/fsblk_vec.cpp b/src/lib/formats/fsblk_vec.cpp index ff66b2b20ed..e80cad8c51c 100644 --- a/src/lib/formats/fsblk_vec.cpp +++ b/src/lib/formats/fsblk_vec.cpp @@ -1,7 +1,7 @@ // license:BSD-3-Clause // copyright-holders:Olivier Galibert -// Block device on vector +// Block device on vector #include "fsblk_vec.h" @@ -10,12 +10,14 @@ #include #include -const uint8_t *fsblk_vec_t::blk_t::rodata() +namespace fs { + +const u8 *fsblk_vec_t::blk_t::rodata() { return m_data; } -uint8_t *fsblk_vec_t::blk_t::data() +u8 *fsblk_vec_t::blk_t::data() { return m_data; } @@ -24,20 +26,21 @@ void fsblk_vec_t::blk_t::drop_weak_references() { } -uint32_t fsblk_vec_t::block_count() const +u32 fsblk_vec_t::block_count() const { return m_data.size() / m_block_size; } -fsblk_t::block_t fsblk_vec_t::get(uint32_t id) +fsblk_t::block_t fsblk_vec_t::get(u32 id) { if(id >= block_count()) throw std::out_of_range(util::string_format("Block number overflow: requiring block %d on device of size %d (%d bytes, block size %d)", id, block_count(), m_data.size(), m_block_size)); return block_t(new blk_t(m_data.data() + m_block_size*id, m_block_size)); } -void fsblk_vec_t::fill(uint8_t data) +void fsblk_vec_t::fill(u8 data) { std::fill(m_data.begin(), m_data.end(), data); } +} // namespace fs -- cgit v1.2.3-70-g09d2