mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-07-14 13:12:13 +02:00
Adopt std::numeric_limits
This commit is contained in:
parent
e3cf8fa301
commit
84e94f97b3
@ -184,7 +184,7 @@ namespace ams::ncm {
|
||||
}
|
||||
|
||||
Result ContentMetaDatabaseInterface::ListContentInfo(sf::Out<u32> out_count, const sf::OutArray<ContentInfo> &out_info, ContentMetaKey key, u32 offset) {
|
||||
R_UNLESS(offset >> 0x1f == 0, ncm::ResultInvalidOffset());
|
||||
R_UNLESS(offset <= std::numeric_limits<s32>::max(), ncm::ResultInvalidOffset());
|
||||
R_TRY(this->EnsureEnabled());
|
||||
|
||||
const void *value = nullptr;
|
||||
@ -470,7 +470,7 @@ namespace ams::ncm {
|
||||
}
|
||||
|
||||
Result ContentMetaDatabaseInterface::ListContentMetaInfo(sf::Out<u32> out_entries_written, const sf::OutArray<ContentMetaInfo> &out_meta_info, ContentMetaKey key, u32 start_index) {
|
||||
R_UNLESS(start_index >> 0x1f == 0, ncm::ResultInvalidOffset());
|
||||
R_UNLESS(start_index <= std::numeric_limits<s32>::max(), ncm::ResultInvalidOffset());
|
||||
R_TRY(this->EnsureEnabled());
|
||||
|
||||
const void* value = nullptr;
|
||||
|
@ -123,7 +123,7 @@ namespace ams::ncm {
|
||||
|
||||
Result ContentStorageInterface::WritePlaceHolder(PlaceHolderId placeholder_id, u64 offset, sf::InBuffer data) {
|
||||
/* Offset is too large */
|
||||
R_UNLESS(offset >> 0x3f == 0, ncm::ResultInvalidOffset());
|
||||
R_UNLESS(offset<= std::numeric_limits<s64>::max(), ncm::ResultInvalidOffset());
|
||||
R_TRY(this->EnsureEnabled());
|
||||
R_TRY(this->placeholder_accessor.Write(placeholder_id, offset, data.GetPointer(), data.GetSize()));
|
||||
return ResultSuccess();
|
||||
@ -265,7 +265,7 @@ namespace ams::ncm {
|
||||
}
|
||||
|
||||
Result ContentStorageInterface::ListContentId(sf::Out<u32> out_count, const sf::OutArray<ContentId> &out_buf, u32 start_offset) {
|
||||
R_UNLESS(start_offset >> 0x1f == 0, ncm::ResultInvalidOffset());
|
||||
R_UNLESS(start_offset <= std::numeric_limits<s32>::max(), ncm::ResultInvalidOffset());
|
||||
R_TRY(this->EnsureEnabled());
|
||||
|
||||
char content_root_path[FS_MAX_PATH] = {0};
|
||||
@ -365,7 +365,7 @@ namespace ams::ncm {
|
||||
|
||||
Result ContentStorageInterface::ReadContentIdFile(sf::OutBuffer buf, ContentId content_id, u64 offset) {
|
||||
/* Offset is too large */
|
||||
R_UNLESS(offset >> 0x3f == 0, ncm::ResultInvalidOffset());
|
||||
R_UNLESS(offset<= std::numeric_limits<s64>::max(), ncm::ResultInvalidOffset());
|
||||
R_TRY(this->EnsureEnabled());
|
||||
char content_path[FS_MAX_PATH] = {0};
|
||||
this->GetContentPath(content_path, content_id);
|
||||
@ -452,7 +452,7 @@ namespace ams::ncm {
|
||||
|
||||
Result ContentStorageInterface::WriteContentForDebug(ContentId content_id, u64 offset, sf::InBuffer data) {
|
||||
/* Offset is too large */
|
||||
R_UNLESS(offset >> 0x3f == 0, ncm::ResultInvalidOffset());
|
||||
R_UNLESS(offset<= std::numeric_limits<s64>::max(), ncm::ResultInvalidOffset());
|
||||
R_TRY(this->EnsureEnabled());
|
||||
|
||||
bool is_development = false;
|
||||
|
@ -154,7 +154,7 @@ namespace ams::ncm {
|
||||
|
||||
Result ReadOnlyContentStorageInterface::ReadContentIdFile(sf::OutBuffer buf, ContentId content_id, u64 offset) {
|
||||
/* Offset is too large */
|
||||
R_UNLESS(offset >> 0x3f == 0, ncm::ResultInvalidOffset());
|
||||
R_UNLESS(offset<= std::numeric_limits<s64>::max(), ncm::ResultInvalidOffset());
|
||||
R_TRY(this->EnsureEnabled());
|
||||
|
||||
char content_path[FS_MAX_PATH] = {0};
|
||||
|
Loading…
Reference in New Issue
Block a user