namespace sts -> namespace ams
namespace sts::ams -> ams::exosphere, ams::. This is to facilitate future use of ams:: namespace code in mesosphere, as we'll want to include ams::util, ams::result, ams::svc...
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
#include <stratosphere.hpp>
|
||||
#include <stratosphere/kvdb/kvdb_archive.hpp>
|
||||
|
||||
namespace sts::kvdb {
|
||||
namespace ams::kvdb {
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace sts::kvdb {
|
||||
|
||||
Result ArchiveReader::ReadEntryCount(size_t *out) {
|
||||
/* This should only be called at the start of reading stream. */
|
||||
STS_ASSERT(this->offset == 0);
|
||||
AMS_ASSERT(this->offset == 0);
|
||||
|
||||
/* Read and validate header. */
|
||||
ArchiveHeader header;
|
||||
@@ -103,7 +103,7 @@ namespace sts::kvdb {
|
||||
|
||||
Result ArchiveReader::GetEntrySize(size_t *out_key_size, size_t *out_value_size) {
|
||||
/* This should only be called after ReadEntryCount. */
|
||||
STS_ASSERT(this->offset != 0);
|
||||
AMS_ASSERT(this->offset != 0);
|
||||
|
||||
/* Peek the next entry header. */
|
||||
ArchiveEntryHeader header;
|
||||
@@ -117,7 +117,7 @@ namespace sts::kvdb {
|
||||
|
||||
Result ArchiveReader::ReadEntry(void *out_key, size_t key_size, void *out_value, size_t value_size) {
|
||||
/* This should only be called after ReadEntryCount. */
|
||||
STS_ASSERT(this->offset != 0);
|
||||
AMS_ASSERT(this->offset != 0);
|
||||
|
||||
/* Read the next entry header. */
|
||||
ArchiveEntryHeader header;
|
||||
@@ -125,8 +125,8 @@ namespace sts::kvdb {
|
||||
R_TRY(header.Validate());
|
||||
|
||||
/* Key size and Value size must be correct. */
|
||||
STS_ASSERT(key_size == header.key_size);
|
||||
STS_ASSERT(value_size == header.value_size);
|
||||
AMS_ASSERT(key_size == header.key_size);
|
||||
AMS_ASSERT(value_size == header.value_size);
|
||||
|
||||
R_ASSERT(this->Read(out_key, key_size));
|
||||
R_ASSERT(this->Read(out_value, value_size));
|
||||
@@ -147,7 +147,7 @@ namespace sts::kvdb {
|
||||
|
||||
void ArchiveWriter::WriteHeader(size_t entry_count) {
|
||||
/* This should only be called at start of write. */
|
||||
STS_ASSERT(this->offset == 0);
|
||||
AMS_ASSERT(this->offset == 0);
|
||||
|
||||
ArchiveHeader header = ArchiveHeader::Make(entry_count);
|
||||
R_ASSERT(this->Write(&header, sizeof(header)));
|
||||
@@ -155,7 +155,7 @@ namespace sts::kvdb {
|
||||
|
||||
void ArchiveWriter::WriteEntry(const void *key, size_t key_size, const void *value, size_t value_size) {
|
||||
/* This should only be called after writing header. */
|
||||
STS_ASSERT(this->offset != 0);
|
||||
AMS_ASSERT(this->offset != 0);
|
||||
|
||||
ArchiveEntryHeader header = ArchiveEntryHeader::Make(key_size, value_size);
|
||||
R_ASSERT(this->Write(&header, sizeof(header)));
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <stratosphere.hpp>
|
||||
#include <stratosphere/kvdb/kvdb_file_key_value_store.hpp>
|
||||
|
||||
namespace sts::kvdb {
|
||||
namespace ams::kvdb {
|
||||
|
||||
/* Cache implementation. */
|
||||
void *FileKeyValueStore::Cache::Allocate(size_t size) {
|
||||
@@ -57,7 +57,7 @@ namespace sts::kvdb {
|
||||
this->backing_buffer_free_offset = 0;
|
||||
this->count = 0;
|
||||
this->entries = static_cast<decltype(this->entries)>(this->Allocate(sizeof(*this->entries) * this->capacity));
|
||||
STS_ASSERT(this->entries != nullptr);
|
||||
AMS_ASSERT(this->entries != nullptr);
|
||||
}
|
||||
|
||||
std::optional<size_t> FileKeyValueStore::Cache::TryGet(void *out_value, size_t max_out_size, const void *key, size_t key_size) {
|
||||
@@ -104,7 +104,7 @@ namespace sts::kvdb {
|
||||
}
|
||||
|
||||
/* Ensure key size is small enough. */
|
||||
STS_ASSERT(key_size <= MaxKeySize);
|
||||
AMS_ASSERT(key_size <= MaxKeySize);
|
||||
|
||||
/* If we're at capacity, invalidate the cache. */
|
||||
if (this->count == this->capacity) {
|
||||
|
||||
Reference in New Issue
Block a user