strat: use m_ for member variables
This commit is contained in:
@@ -23,9 +23,9 @@ namespace ams::fssrv::fscreator {
|
||||
NON_COPYABLE(RomFileSystemCreator);
|
||||
NON_MOVEABLE(RomFileSystemCreator);
|
||||
private:
|
||||
MemoryResource *allocator;
|
||||
MemoryResource *m_allocator;
|
||||
public:
|
||||
explicit RomFileSystemCreator(MemoryResource *mr) : allocator(mr) { /* ... */ }
|
||||
explicit RomFileSystemCreator(MemoryResource *mr) : m_allocator(mr) { /* ... */ }
|
||||
|
||||
virtual Result Create(std::shared_ptr<fs::fsa::IFileSystem> *out, std::shared_ptr<fs::IStorage> storage) override;
|
||||
};
|
||||
|
||||
@@ -30,15 +30,15 @@ namespace ams::fssrv::fscreator {
|
||||
NON_COPYABLE(StorageOnNcaCreator);
|
||||
NON_MOVEABLE(StorageOnNcaCreator);
|
||||
private:
|
||||
MemoryResource *allocator;
|
||||
fssystem::IBufferManager * const buffer_manager;
|
||||
const fssystem::NcaCryptoConfiguration &nca_crypto_cfg;
|
||||
bool is_prod;
|
||||
bool is_enabled_program_verification;
|
||||
MemoryResource *m_allocator;
|
||||
fssystem::IBufferManager * const m_buffer_manager;
|
||||
const fssystem::NcaCryptoConfiguration &m_nca_crypto_cfg;
|
||||
bool m_is_prod;
|
||||
bool m_is_enabled_program_verification;
|
||||
private:
|
||||
Result VerifyNcaHeaderSign2(fssystem::NcaReader *nca_reader, fs::IStorage *storage);
|
||||
public:
|
||||
explicit StorageOnNcaCreator(MemoryResource *mr, const fssystem::NcaCryptoConfiguration &cfg, bool prod, fssystem::IBufferManager *bm) : allocator(mr), buffer_manager(bm), nca_crypto_cfg(cfg), is_prod(prod), is_enabled_program_verification(true) {
|
||||
explicit StorageOnNcaCreator(MemoryResource *mr, const fssystem::NcaCryptoConfiguration &cfg, bool prod, fssystem::IBufferManager *bm) : m_allocator(mr), m_buffer_manager(bm), m_nca_crypto_cfg(cfg), m_is_prod(prod), m_is_enabled_program_verification(true) {
|
||||
/* ... */
|
||||
}
|
||||
|
||||
|
||||
@@ -22,17 +22,17 @@ namespace ams::fssrv {
|
||||
|
||||
class MemoryResourceFromExpHeap : public ams::MemoryResource {
|
||||
private:
|
||||
lmem::HeapHandle heap_handle;
|
||||
lmem::HeapHandle m_heap_handle;
|
||||
public:
|
||||
constexpr explicit MemoryResourceFromExpHeap(lmem::HeapHandle handle) : heap_handle(handle) { /* ... */ }
|
||||
constexpr explicit MemoryResourceFromExpHeap(lmem::HeapHandle handle) : m_heap_handle(handle) { /* ... */ }
|
||||
protected:
|
||||
virtual void *AllocateImpl(size_t size, size_t align) override {
|
||||
return lmem::AllocateFromExpHeap(this->heap_handle, size, static_cast<s32>(align));
|
||||
return lmem::AllocateFromExpHeap(m_heap_handle, size, static_cast<s32>(align));
|
||||
}
|
||||
|
||||
virtual void DeallocateImpl(void *p, size_t size, size_t align) override {
|
||||
AMS_UNUSED(size, align);
|
||||
return lmem::FreeToExpHeap(this->heap_handle, p);
|
||||
return lmem::FreeToExpHeap(m_heap_handle, p);
|
||||
}
|
||||
|
||||
virtual bool IsEqualImpl(const MemoryResource &rhs) const override {
|
||||
@@ -43,24 +43,24 @@ namespace ams::fssrv {
|
||||
|
||||
class PeakCheckableMemoryResourceFromExpHeap : public ams::MemoryResource {
|
||||
private:
|
||||
lmem::HeapHandle heap_handle;
|
||||
os::SdkMutex mutex;
|
||||
size_t peak_free_size;
|
||||
size_t current_free_size;
|
||||
lmem::HeapHandle m_heap_handle;
|
||||
os::SdkMutex m_mutex;
|
||||
size_t m_peak_free_size;
|
||||
size_t m_current_free_size;
|
||||
public:
|
||||
constexpr explicit PeakCheckableMemoryResourceFromExpHeap(size_t heap_size) : heap_handle(nullptr), mutex(), peak_free_size(heap_size), current_free_size(heap_size) { /* ... */ }
|
||||
constexpr explicit PeakCheckableMemoryResourceFromExpHeap(size_t heap_size) : m_heap_handle(nullptr), m_mutex(), m_peak_free_size(heap_size), m_current_free_size(heap_size) { /* ... */ }
|
||||
|
||||
void SetHeapHandle(lmem::HeapHandle handle) {
|
||||
this->heap_handle = handle;
|
||||
m_heap_handle = handle;
|
||||
}
|
||||
|
||||
size_t GetPeakFreeSize() const { return this->peak_free_size; }
|
||||
size_t GetCurrentFreeSize() const { return this->current_free_size; }
|
||||
size_t GetPeakFreeSize() const { return m_peak_free_size; }
|
||||
size_t GetCurrentFreeSize() const { return m_current_free_size; }
|
||||
|
||||
void ClearPeak() { this->peak_free_size = this->current_free_size; }
|
||||
void ClearPeak() { m_peak_free_size = m_current_free_size; }
|
||||
|
||||
std::scoped_lock<os::SdkMutex> GetScopedLock() {
|
||||
return std::scoped_lock(this->mutex);
|
||||
return std::scoped_lock(m_mutex);
|
||||
}
|
||||
|
||||
void OnAllocate(void *p, size_t size);
|
||||
|
||||
@@ -27,17 +27,17 @@ namespace ams::fssrv {
|
||||
|
||||
class MemoryResourceFromStandardAllocator : public ams::MemoryResource {
|
||||
private:
|
||||
mem::StandardAllocator *allocator;
|
||||
os::SdkMutex mutex;
|
||||
size_t peak_free_size;
|
||||
size_t current_free_size;
|
||||
size_t peak_allocated_size;
|
||||
mem::StandardAllocator *m_allocator;
|
||||
os::SdkMutex m_mutex;
|
||||
size_t m_peak_free_size;
|
||||
size_t m_current_free_size;
|
||||
size_t m_peak_allocated_size;
|
||||
public:
|
||||
explicit MemoryResourceFromStandardAllocator(mem::StandardAllocator *allocator);
|
||||
public:
|
||||
size_t GetPeakFreeSize() const { return this->peak_free_size; }
|
||||
size_t GetCurrentFreeSize() const { return this->current_free_size; }
|
||||
size_t GetPeakAllocatedSize() const { return this->peak_allocated_size; }
|
||||
size_t GetPeakFreeSize() const { return m_peak_free_size; }
|
||||
size_t GetCurrentFreeSize() const { return m_current_free_size; }
|
||||
size_t GetPeakAllocatedSize() const { return m_peak_allocated_size; }
|
||||
|
||||
void ClearPeak();
|
||||
protected:
|
||||
|
||||
@@ -33,34 +33,34 @@ namespace ams::fssrv {
|
||||
private:
|
||||
using Buffer = std::unique_ptr<char[], fs::impl::Deleter>;
|
||||
private:
|
||||
Buffer buffer;
|
||||
const char *path;
|
||||
Result result;
|
||||
Buffer m_buffer;
|
||||
const char *m_path;
|
||||
Result m_result;
|
||||
private:
|
||||
static Result Normalize(const char **out_path, Buffer *out_buf, const char *path, bool preserve_unc, bool preserve_tail_sep, bool has_mount_name);
|
||||
public:
|
||||
/* TODO: Remove non-option constructor. */
|
||||
explicit PathNormalizer(const char *p) : buffer(), path(nullptr), result(ResultSuccess()) {
|
||||
this->result = Normalize(std::addressof(this->path), std::addressof(this->buffer), p, false, false, false);
|
||||
explicit PathNormalizer(const char *p) : m_buffer(), m_path(nullptr), m_result(ResultSuccess()) {
|
||||
m_result = Normalize(std::addressof(m_path), std::addressof(m_buffer), p, false, false, false);
|
||||
}
|
||||
|
||||
PathNormalizer(const char *p, u32 option) : buffer(), path(nullptr), result(ResultSuccess()) {
|
||||
PathNormalizer(const char *p, u32 option) : m_buffer(), m_path(nullptr), m_result(ResultSuccess()) {
|
||||
if ((option & Option_AcceptEmpty) && p[0] == '\x00') {
|
||||
this->path = path;
|
||||
m_path = p;
|
||||
} else {
|
||||
const bool preserve_unc = (option & Option_PreserveUnc);
|
||||
const bool preserve_tail_sep = (option & Option_PreserveTailSeparator);
|
||||
const bool has_mount_name = (option & Option_HasMountName);
|
||||
this->result = Normalize(std::addressof(this->path), std::addressof(this->buffer), p, preserve_unc, preserve_tail_sep, has_mount_name);
|
||||
m_result = Normalize(std::addressof(m_path), std::addressof(m_buffer), p, preserve_unc, preserve_tail_sep, has_mount_name);
|
||||
}
|
||||
}
|
||||
|
||||
Result GetResult() const {
|
||||
return this->result;
|
||||
return m_result;
|
||||
}
|
||||
|
||||
const char *GetPath() const {
|
||||
return this->path;
|
||||
return m_path;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@ namespace ams::fssrv::impl {
|
||||
class FileInterfaceAdapter {
|
||||
NON_COPYABLE(FileInterfaceAdapter);
|
||||
private:
|
||||
ams::sf::SharedPointer<FileSystemInterfaceAdapter> parent_filesystem;
|
||||
std::unique_ptr<fs::fsa::IFile> base_file;
|
||||
util::unique_lock<fssystem::SemaphoreAdapter> open_count_semaphore;
|
||||
ams::sf::SharedPointer<FileSystemInterfaceAdapter> m_parent_filesystem;
|
||||
std::unique_ptr<fs::fsa::IFile> m_base_file;
|
||||
util::unique_lock<fssystem::SemaphoreAdapter> m_open_count_semaphore;
|
||||
public:
|
||||
FileInterfaceAdapter(std::unique_ptr<fs::fsa::IFile> &&file, FileSystemInterfaceAdapter *parent, util::unique_lock<fssystem::SemaphoreAdapter> &&sema);
|
||||
~FileInterfaceAdapter();
|
||||
@@ -63,9 +63,9 @@ namespace ams::fssrv::impl {
|
||||
class DirectoryInterfaceAdapter {
|
||||
NON_COPYABLE(DirectoryInterfaceAdapter);
|
||||
private:
|
||||
ams::sf::SharedPointer<FileSystemInterfaceAdapter> parent_filesystem;
|
||||
std::unique_ptr<fs::fsa::IDirectory> base_dir;
|
||||
util::unique_lock<fssystem::SemaphoreAdapter> open_count_semaphore;
|
||||
ams::sf::SharedPointer<FileSystemInterfaceAdapter> m_parent_filesystem;
|
||||
std::unique_ptr<fs::fsa::IDirectory> m_base_dir;
|
||||
util::unique_lock<fssystem::SemaphoreAdapter> m_open_count_semaphore;
|
||||
public:
|
||||
DirectoryInterfaceAdapter(std::unique_ptr<fs::fsa::IDirectory> &&dir, FileSystemInterfaceAdapter *parent, util::unique_lock<fssystem::SemaphoreAdapter> &&sema);
|
||||
~DirectoryInterfaceAdapter();
|
||||
@@ -79,11 +79,11 @@ namespace ams::fssrv::impl {
|
||||
class FileSystemInterfaceAdapter : public ams::sf::ISharedObject {
|
||||
NON_COPYABLE(FileSystemInterfaceAdapter);
|
||||
private:
|
||||
std::shared_ptr<fs::fsa::IFileSystem> base_fs;
|
||||
util::unique_lock<fssystem::SemaphoreAdapter> mount_count_semaphore;
|
||||
os::ReaderWriterLock invalidation_lock;
|
||||
bool open_count_limited;
|
||||
bool deep_retry_enabled = false;
|
||||
std::shared_ptr<fs::fsa::IFileSystem> m_base_fs;
|
||||
util::unique_lock<fssystem::SemaphoreAdapter> m_mount_count_semaphore;
|
||||
os::ReaderWriterLock m_invalidation_lock;
|
||||
bool m_open_count_limited;
|
||||
bool m_deep_retry_enabled = false;
|
||||
public:
|
||||
FileSystemInterfaceAdapter(std::shared_ptr<fs::fsa::IFileSystem> &&fs, bool open_limited);
|
||||
/* TODO: Other constructors. */
|
||||
|
||||
@@ -31,11 +31,11 @@ namespace ams::fssrv::impl {
|
||||
NON_COPYABLE(StorageInterfaceAdapter);
|
||||
private:
|
||||
/* TODO: Nintendo uses fssystem::AsynchronousAccessStorage here. */
|
||||
std::shared_ptr<fs::IStorage> base_storage;
|
||||
util::unique_lock<fssystem::SemaphoreAdapter> open_count_semaphore;
|
||||
os::ReaderWriterLock invalidation_lock;
|
||||
std::shared_ptr<fs::IStorage> m_base_storage;
|
||||
util::unique_lock<fssystem::SemaphoreAdapter> m_open_count_semaphore;
|
||||
os::ReaderWriterLock m_invalidation_lock;
|
||||
/* TODO: DataStorageContext. */
|
||||
bool deep_retry_enabled = false;
|
||||
bool m_deep_retry_enabled = false;
|
||||
public:
|
||||
StorageInterfaceAdapter(fs::IStorage *storage);
|
||||
StorageInterfaceAdapter(std::unique_ptr<fs::IStorage> storage);
|
||||
|
||||
Reference in New Issue
Block a user