mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-31 23:08:22 -04:00
strat: use m_ for member variables
This commit is contained in:
parent
ce28591ab2
commit
a595c232b9
425 changed files with 8531 additions and 8484 deletions
|
@ -49,7 +49,7 @@ namespace ams::ncm {
|
|||
}
|
||||
|
||||
void PlaceHolderAccessor::MakePath(PathString *out_placeholder_path, PlaceHolderId placeholder_id) const {
|
||||
MakePlaceHolderFilePath(out_placeholder_path, placeholder_id, this->make_placeholder_path_func, *this->root_path);
|
||||
MakePlaceHolderFilePath(out_placeholder_path, placeholder_id, m_make_placeholder_path_func, *m_root_path);
|
||||
}
|
||||
|
||||
void PlaceHolderAccessor::MakeBaseDirectoryPath(PathString *out, const char *root_path) {
|
||||
|
@ -95,7 +95,7 @@ namespace ams::ncm {
|
|||
}
|
||||
|
||||
bool PlaceHolderAccessor::LoadFromCache(fs::FileHandle *out_handle, PlaceHolderId placeholder_id) {
|
||||
std::scoped_lock lk(this->cache_mutex);
|
||||
std::scoped_lock lk(m_cache_mutex);
|
||||
|
||||
/* Attempt to find an entry in the cache. */
|
||||
CacheEntry *entry = this->FindInCache(placeholder_id);
|
||||
|
@ -110,13 +110,13 @@ namespace ams::ncm {
|
|||
}
|
||||
|
||||
void PlaceHolderAccessor::StoreToCache(PlaceHolderId placeholder_id, fs::FileHandle handle) {
|
||||
std::scoped_lock lk(this->cache_mutex);
|
||||
std::scoped_lock lk(m_cache_mutex);
|
||||
|
||||
/* Store placeholder id and file handle to a free entry. */
|
||||
CacheEntry *entry = this->GetFreeEntry();
|
||||
entry->id = placeholder_id;
|
||||
entry->handle = handle;
|
||||
entry->counter = this->cur_counter++;
|
||||
entry->counter = m_cur_counter++;
|
||||
}
|
||||
|
||||
void PlaceHolderAccessor::Invalidate(CacheEntry *entry) {
|
||||
|
@ -136,8 +136,8 @@ namespace ams::ncm {
|
|||
|
||||
/* Attempt to find a cache entry with the same placeholder id. */
|
||||
for (size_t i = 0; i < MaxCacheEntries; i++) {
|
||||
if (placeholder_id == this->caches[i].id) {
|
||||
return std::addressof(this->caches[i]);
|
||||
if (placeholder_id == m_caches[i].id) {
|
||||
return std::addressof(m_caches[i]);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -146,16 +146,16 @@ namespace ams::ncm {
|
|||
PlaceHolderAccessor::CacheEntry *PlaceHolderAccessor::GetFreeEntry() {
|
||||
/* Try to find an already free entry. */
|
||||
for (size_t i = 0; i < MaxCacheEntries; i++) {
|
||||
if (this->caches[i].id == InvalidPlaceHolderId) {
|
||||
return std::addressof(this->caches[i]);
|
||||
if (m_caches[i].id == InvalidPlaceHolderId) {
|
||||
return std::addressof(m_caches[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the oldest entry. */
|
||||
CacheEntry *entry = std::addressof(this->caches[0]);
|
||||
CacheEntry *entry = std::addressof(m_caches[0]);
|
||||
for (size_t i = 1; i < MaxCacheEntries; i++) {
|
||||
if (entry->counter < this->caches[i].counter) {
|
||||
entry = std::addressof(this->caches[i]);
|
||||
if (entry->counter < m_caches[i].counter) {
|
||||
entry = std::addressof(m_caches[i]);
|
||||
}
|
||||
}
|
||||
this->Invalidate(entry);
|
||||
|
@ -164,7 +164,7 @@ namespace ams::ncm {
|
|||
|
||||
void PlaceHolderAccessor::GetPath(PathString *placeholder_path, PlaceHolderId placeholder_id) {
|
||||
{
|
||||
std::scoped_lock lock(this->cache_mutex);
|
||||
std::scoped_lock lock(m_cache_mutex);
|
||||
this->Invalidate(this->FindInCache(placeholder_id));
|
||||
}
|
||||
this->MakePath(placeholder_path, placeholder_id);
|
||||
|
@ -210,7 +210,7 @@ namespace ams::ncm {
|
|||
ON_SCOPE_EXIT { this->StoreToCache(placeholder_id, file); };
|
||||
|
||||
/* Write data to the placeholder file. */
|
||||
return fs::WriteFile(file, offset, buffer, size, this->delay_flush ? fs::WriteOption::Flush : fs::WriteOption::None);
|
||||
return fs::WriteFile(file, offset, buffer, size, m_delay_flush ? fs::WriteOption::Flush : fs::WriteOption::None);
|
||||
}
|
||||
|
||||
Result PlaceHolderAccessor::SetPlaceHolderFileSize(PlaceHolderId placeholder_id, s64 size) {
|
||||
|
@ -246,7 +246,7 @@ namespace ams::ncm {
|
|||
|
||||
void PlaceHolderAccessor::InvalidateAll() {
|
||||
/* Invalidate all cache entries. */
|
||||
for (auto &entry : this->caches) {
|
||||
for (auto &entry : m_caches) {
|
||||
if (entry.id != InvalidPlaceHolderId) {
|
||||
this->Invalidate(std::addressof(entry));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue