mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-04 16:53:48 -04:00
ams: revamp assertion system
This commit is contained in:
parent
9572fb2ce3
commit
40400aee1f
168 changed files with 1014 additions and 696 deletions
|
@ -28,7 +28,7 @@ namespace ams::kvdb {
|
|||
private:
|
||||
/* Utility. */
|
||||
static inline void CheckLength(size_t len) {
|
||||
AMS_ASSERT(len < N);
|
||||
AMS_ABORT_UNLESS(len < N);
|
||||
}
|
||||
public:
|
||||
/* Constructors. */
|
||||
|
@ -109,8 +109,8 @@ namespace ams::kvdb {
|
|||
/* Substring utilities. */
|
||||
void GetSubstring(char *dst, size_t dst_size, size_t offset, size_t length) const {
|
||||
/* Make sure output buffer can hold the substring. */
|
||||
AMS_ASSERT(offset + length <= GetLength());
|
||||
AMS_ASSERT(dst_size > length);
|
||||
AMS_ABORT_UNLESS(offset + length <= GetLength());
|
||||
AMS_ABORT_UNLESS(dst_size > length);
|
||||
/* Copy substring to dst. */
|
||||
std::strncpy(dst, this->buffer + offset, length);
|
||||
dst[length] = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue