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:
Michael Scire
2019-10-24 02:30:10 -07:00
committed by SciresM
parent 4059dc6187
commit 8cb77ac136
397 changed files with 968 additions and 926 deletions

View File

@@ -20,13 +20,13 @@
#include "lz4.h"
namespace sts::util {
namespace ams::util {
/* Compression utilities. */
int CompressLZ4(void *dst, size_t dst_size, const void *src, size_t src_size) {
/* Size checks. */
STS_ASSERT(dst_size <= std::numeric_limits<int>::max());
STS_ASSERT(src_size <= std::numeric_limits<int>::max());
AMS_ASSERT(dst_size <= std::numeric_limits<int>::max());
AMS_ASSERT(src_size <= std::numeric_limits<int>::max());
/* This is just a thin wrapper around LZ4. */
return LZ4_compress_default(reinterpret_cast<const char *>(src), reinterpret_cast<char *>(dst), static_cast<int>(src_size), static_cast<int>(dst_size));
@@ -35,8 +35,8 @@ namespace sts::util {
/* Decompression utilities. */
int DecompressLZ4(void *dst, size_t dst_size, const void *src, size_t src_size) {
/* Size checks. */
STS_ASSERT(dst_size <= std::numeric_limits<int>::max());
STS_ASSERT(src_size <= std::numeric_limits<int>::max());
AMS_ASSERT(dst_size <= std::numeric_limits<int>::max());
AMS_ASSERT(src_size <= std::numeric_limits<int>::max());
/* This is just a thin wrapper around LZ4. */
return LZ4_decompress_safe(reinterpret_cast<const char *>(src), reinterpret_cast<char *>(dst), static_cast<int>(src_size), static_cast<int>(dst_size));

View File

@@ -20,7 +20,7 @@
#include "ini.h"
namespace sts::util::ini {
namespace ams::util::ini {
/* Ensure that types are the same for Handler vs ini_handler. */
static_assert(std::is_same<Handler, ::ini_handler>::value, "Bad ini::Handler definition!");
@@ -50,7 +50,7 @@ namespace sts::util::ini {
size_t try_read = std::min(size_t(num - 1), ctx->num_left);
size_t actually_read;
R_ASSERT(fsFileRead(ctx->f, ctx->offset, str, try_read, FsReadOption_None, &actually_read));
STS_ASSERT(actually_read == try_read);
AMS_ASSERT(actually_read == try_read);
/* Only "read" up to the first \n. */
size_t offset = actually_read;