ams: globally prefer R_RETURN to return for ams::Result

This commit is contained in:
Michael Scire
2022-03-26 14:48:33 -07:00
parent dd78ede99f
commit bbf22b4c60
325 changed files with 1955 additions and 1993 deletions

View File

@@ -26,43 +26,43 @@ namespace ams::htcfs {
public:
Client(htclow::HtclowManager *manager) : m_impl(manager) { /* ... */ }
public:
Result OpenFile(s32 *out_handle, const char *path, fs::OpenMode mode, bool case_sensitive) { return ConvertToFsResult(m_impl.OpenFile(out_handle, path, mode, case_sensitive)); }
Result FileExists(bool *out, const char *path, bool case_sensitive) { return ConvertToFsResult(m_impl.FileExists(out, path, case_sensitive)); }
Result DeleteFile(const char *path, bool case_sensitive) { return ConvertToFsResult(m_impl.DeleteFile(path, case_sensitive)); }
Result RenameFile(const char *old_path, const char *new_path, bool case_sensitive) { return ConvertToFsResult(m_impl.RenameFile(old_path, new_path, case_sensitive)); }
Result GetEntryType(fs::DirectoryEntryType *out, const char *path, bool case_sensitive) { return ConvertToFsResult(m_impl.GetEntryType(out, path, case_sensitive)); }
Result OpenDirectory(s32 *out_handle, const char *path, fs::OpenDirectoryMode mode, bool case_sensitive) { return ConvertToFsResult(m_impl.OpenDirectory(out_handle, path, mode, case_sensitive)); }
Result DirectoryExists(bool *out, const char *path, bool case_sensitive) { return ConvertToFsResult(m_impl.DirectoryExists(out, path, case_sensitive)); }
Result CreateDirectory(const char *path, bool case_sensitive) { return ConvertToFsResult(m_impl.CreateDirectory(path, case_sensitive)); }
Result DeleteDirectory(const char *path, bool recursively, bool case_sensitive) { return ConvertToFsResult(m_impl.DeleteDirectory(path, recursively, case_sensitive)); }
Result RenameDirectory(const char *old_path, const char *new_path, bool case_sensitive) { return ConvertToFsResult(m_impl.RenameDirectory(old_path, new_path, case_sensitive)); }
Result CreateFile(const char *path, s64 size, bool case_sensitive) { return ConvertToFsResult(m_impl.CreateFile(path, size, case_sensitive)); }
Result GetFileTimeStamp(u64 *out_create, u64 *out_access, u64 *out_modify, const char *path, bool case_sensitive) { return ConvertToFsResult(m_impl.GetFileTimeStamp(out_create, out_access, out_modify, path, case_sensitive)); }
Result GetCaseSensitivePath(char *dst, size_t dst_size, const char *path) { return ConvertToFsResult(m_impl.GetCaseSensitivePath(dst, dst_size, path)); }
Result GetDiskFreeSpace(s64 *out_free, s64 *out_total, s64 *out_total_free, const char *path) { return ConvertToFsResult(m_impl.GetDiskFreeSpace(out_free, out_total, out_total_free, path)); }
Result OpenFile(s32 *out_handle, const char *path, fs::OpenMode mode, bool case_sensitive) { R_RETURN(ConvertToFsResult(m_impl.OpenFile(out_handle, path, mode, case_sensitive))); }
Result FileExists(bool *out, const char *path, bool case_sensitive) { R_RETURN(ConvertToFsResult(m_impl.FileExists(out, path, case_sensitive))); }
Result DeleteFile(const char *path, bool case_sensitive) { R_RETURN(ConvertToFsResult(m_impl.DeleteFile(path, case_sensitive))); }
Result RenameFile(const char *old_path, const char *new_path, bool case_sensitive) { R_RETURN(ConvertToFsResult(m_impl.RenameFile(old_path, new_path, case_sensitive))); }
Result GetEntryType(fs::DirectoryEntryType *out, const char *path, bool case_sensitive) { R_RETURN(ConvertToFsResult(m_impl.GetEntryType(out, path, case_sensitive))); }
Result OpenDirectory(s32 *out_handle, const char *path, fs::OpenDirectoryMode mode, bool case_sensitive) { R_RETURN(ConvertToFsResult(m_impl.OpenDirectory(out_handle, path, mode, case_sensitive))); }
Result DirectoryExists(bool *out, const char *path, bool case_sensitive) { R_RETURN(ConvertToFsResult(m_impl.DirectoryExists(out, path, case_sensitive))); }
Result CreateDirectory(const char *path, bool case_sensitive) { R_RETURN(ConvertToFsResult(m_impl.CreateDirectory(path, case_sensitive))); }
Result DeleteDirectory(const char *path, bool recursively, bool case_sensitive) { R_RETURN(ConvertToFsResult(m_impl.DeleteDirectory(path, recursively, case_sensitive))); }
Result RenameDirectory(const char *old_path, const char *new_path, bool case_sensitive) { R_RETURN(ConvertToFsResult(m_impl.RenameDirectory(old_path, new_path, case_sensitive))); }
Result CreateFile(const char *path, s64 size, bool case_sensitive) { R_RETURN(ConvertToFsResult(m_impl.CreateFile(path, size, case_sensitive))); }
Result GetFileTimeStamp(u64 *out_create, u64 *out_access, u64 *out_modify, const char *path, bool case_sensitive) { R_RETURN(ConvertToFsResult(m_impl.GetFileTimeStamp(out_create, out_access, out_modify, path, case_sensitive))); }
Result GetCaseSensitivePath(char *dst, size_t dst_size, const char *path) { R_RETURN(ConvertToFsResult(m_impl.GetCaseSensitivePath(dst, dst_size, path))); }
Result GetDiskFreeSpace(s64 *out_free, s64 *out_total, s64 *out_total_free, const char *path) { R_RETURN(ConvertToFsResult(m_impl.GetDiskFreeSpace(out_free, out_total, out_total_free, path))); }
Result CloseDirectory(s32 handle) { return ConvertToFsResult(m_impl.CloseDirectory(handle)); }
Result CloseDirectory(s32 handle) { R_RETURN(ConvertToFsResult(m_impl.CloseDirectory(handle))); }
Result GetEntryCount(s64 *out, s32 handle) { return ConvertToFsResult(m_impl.GetEntryCount(out, handle)); }
Result ReadDirectory(s64 *out, fs::DirectoryEntry *out_entries, size_t max_out_entries, s32 handle) { return ConvertToFsResult(m_impl.ReadDirectory(out, out_entries, max_out_entries, handle)); }
Result ReadDirectoryLarge(s64 *out, fs::DirectoryEntry *out_entries, size_t max_out_entries, s32 handle) { return ConvertToFsResult(m_impl.ReadDirectoryLarge(out, out_entries, max_out_entries, handle)); }
Result GetPriorityForDirectory(s32 *out, s32 handle) { return ConvertToFsResult(m_impl.GetPriorityForDirectory(out, handle)); }
Result SetPriorityForDirectory(s32 priority, s32 handle) { return ConvertToFsResult(m_impl.SetPriorityForDirectory(priority, handle)); }
Result GetEntryCount(s64 *out, s32 handle) { R_RETURN(ConvertToFsResult(m_impl.GetEntryCount(out, handle))); }
Result ReadDirectory(s64 *out, fs::DirectoryEntry *out_entries, size_t max_out_entries, s32 handle) { R_RETURN(ConvertToFsResult(m_impl.ReadDirectory(out, out_entries, max_out_entries, handle))); }
Result ReadDirectoryLarge(s64 *out, fs::DirectoryEntry *out_entries, size_t max_out_entries, s32 handle) { R_RETURN(ConvertToFsResult(m_impl.ReadDirectoryLarge(out, out_entries, max_out_entries, handle))); }
Result GetPriorityForDirectory(s32 *out, s32 handle) { R_RETURN(ConvertToFsResult(m_impl.GetPriorityForDirectory(out, handle))); }
Result SetPriorityForDirectory(s32 priority, s32 handle) { R_RETURN(ConvertToFsResult(m_impl.SetPriorityForDirectory(priority, handle))); }
Result CloseFile(s32 handle) { return ConvertToFsResult(m_impl.CloseFile(handle)); }
Result CloseFile(s32 handle) { R_RETURN(ConvertToFsResult(m_impl.CloseFile(handle))); }
Result ReadFile(s64 *out, void *buffer, s32 handle, s64 offset, s64 buffer_size, fs::ReadOption option) { return ConvertToFsResult(m_impl.ReadFile(out, buffer, handle, offset, buffer_size, option)); }
Result ReadFileLarge(s64 *out, void *buffer, s32 handle, s64 offset, s64 buffer_size, fs::ReadOption option) { return ConvertToFsResult(m_impl.ReadFileLarge(out, buffer, handle, offset, buffer_size, option)); }
Result WriteFile(const void *buffer, s32 handle, s64 offset, s64 buffer_size, fs::WriteOption option) { return ConvertToFsResult(m_impl.WriteFile(buffer, handle, offset, buffer_size, option)); }
Result WriteFileLarge(const void *buffer, s32 handle, s64 offset, s64 buffer_size, fs::WriteOption option) { return ConvertToFsResult(m_impl.WriteFileLarge(buffer, handle, offset, buffer_size, option)); }
Result GetFileSize(s64 *out, s32 handle) { return ConvertToFsResult(m_impl.GetFileSize(out, handle)); }
Result SetFileSize(s64 size, s32 handle) { return ConvertToFsResult(m_impl.SetFileSize(size, handle)); }
Result FlushFile(s32 handle) { return ConvertToFsResult(m_impl.FlushFile(handle)); }
Result GetPriorityForFile(s32 *out, s32 handle) { return ConvertToFsResult(m_impl.GetPriorityForFile(out, handle)); }
Result SetPriorityForFile(s32 priority, s32 handle) { return ConvertToFsResult(m_impl.SetPriorityForFile(priority, handle)); }
Result ReadFile(s64 *out, void *buffer, s32 handle, s64 offset, s64 buffer_size, fs::ReadOption option) { R_RETURN(ConvertToFsResult(m_impl.ReadFile(out, buffer, handle, offset, buffer_size, option))); }
Result ReadFileLarge(s64 *out, void *buffer, s32 handle, s64 offset, s64 buffer_size, fs::ReadOption option) { R_RETURN(ConvertToFsResult(m_impl.ReadFileLarge(out, buffer, handle, offset, buffer_size, option))); }
Result WriteFile(const void *buffer, s32 handle, s64 offset, s64 buffer_size, fs::WriteOption option) { R_RETURN(ConvertToFsResult(m_impl.WriteFile(buffer, handle, offset, buffer_size, option))); }
Result WriteFileLarge(const void *buffer, s32 handle, s64 offset, s64 buffer_size, fs::WriteOption option) { R_RETURN(ConvertToFsResult(m_impl.WriteFileLarge(buffer, handle, offset, buffer_size, option))); }
Result GetFileSize(s64 *out, s32 handle) { R_RETURN(ConvertToFsResult(m_impl.GetFileSize(out, handle))); }
Result SetFileSize(s64 size, s32 handle) { R_RETURN(ConvertToFsResult(m_impl.SetFileSize(size, handle))); }
Result FlushFile(s32 handle) { R_RETURN(ConvertToFsResult(m_impl.FlushFile(handle))); }
Result GetPriorityForFile(s32 *out, s32 handle) { R_RETURN(ConvertToFsResult(m_impl.GetPriorityForFile(out, handle))); }
Result SetPriorityForFile(s32 priority, s32 handle) { R_RETURN(ConvertToFsResult(m_impl.SetPriorityForFile(priority, handle))); }
Result GetWorkingDirectory(char *dst, size_t dst_size) { return ConvertToFsResult(m_impl.GetWorkingDirectory(dst, dst_size)); }
Result GetWorkingDirectorySize(s32 *out) { return ConvertToFsResult(m_impl.GetWorkingDirectorySize(out)); }
Result GetWorkingDirectory(char *dst, size_t dst_size) { R_RETURN(ConvertToFsResult(m_impl.GetWorkingDirectory(dst, dst_size))); }
Result GetWorkingDirectorySize(s32 *out) { R_RETURN(ConvertToFsResult(m_impl.GetWorkingDirectorySize(out))); }
};
void InitializeClient(htclow::HtclowManager *manager);

View File

@@ -261,19 +261,19 @@ namespace ams::htcfs {
}
Result ClientImpl::SendToRpcChannel(const void *src, s64 size) {
return this->SendToHtclow(src, size, std::addressof(m_rpc_channel));
R_RETURN(this->SendToHtclow(src, size, std::addressof(m_rpc_channel)));
}
Result ClientImpl::ReceiveFromRpcChannel(void *dst, s64 size) {
return this->ReceiveFromHtclow(dst, size, std::addressof(m_rpc_channel));
R_RETURN(this->ReceiveFromHtclow(dst, size, std::addressof(m_rpc_channel)));
}
Result ClientImpl::ReceiveFromDataChannel(s64 size) {
return m_data_channel.WaitReceive(size);
R_RETURN(m_data_channel.WaitReceive(size));
}
Result ClientImpl::SendToDataChannel() {
return m_data_channel.Flush();
R_RETURN(m_data_channel.Flush());
}
Result ClientImpl::SendToHtclow(const void *src, s64 size, htclow::Channel *channel) {
@@ -856,14 +856,14 @@ namespace ams::htcfs {
const auto htcfs_result = ConvertHtcfsResult(response.params[0]);
if (R_FAILED(htcfs_result)) {
R_UNLESS(response.body_size == 0, htcfs::ResultUnexpectedResponseBodySize());
return htcfs_result;
R_RETURN(htcfs_result);
}
/* Check our operation's result. */
const auto native_result = ConvertNativeResult(response.params[1]);
if (R_FAILED(native_result)) {
R_UNLESS(response.body_size == 0, htcfs::ResultUnexpectedResponseBodySize());
return native_result;
R_RETURN(native_result);
}
/* Check the body size. */
@@ -1016,7 +1016,7 @@ namespace ams::htcfs {
/* Receive the entries. */
*out = response.params[2];
return this->ReceiveFromRpcChannel(out_entries, response.body_size);
R_RETURN(this->ReceiveFromRpcChannel(out_entries, response.body_size));
}
Result ClientImpl::ReadDirectoryLarge(s64 *out, fs::DirectoryEntry *out_entries, size_t max_out_entries, s32 handle) {
@@ -1052,14 +1052,14 @@ namespace ams::htcfs {
const auto htcfs_result = ConvertHtcfsResult(response.params[0]);
if (R_FAILED(htcfs_result)) {
R_UNLESS(response.body_size == 0, htcfs::ResultUnexpectedResponseBodySize());
return htcfs_result;
R_RETURN(htcfs_result);
}
/* Check our operation's result. */
const auto native_result = ConvertNativeResult(response.params[1]);
if (R_FAILED(native_result)) {
R_UNLESS(response.body_size == 0, htcfs::ResultUnexpectedResponseBodySize());
return native_result;
R_RETURN(native_result);
}
/* Check that the number of entries read is allowable. */
@@ -1208,14 +1208,14 @@ namespace ams::htcfs {
const auto htcfs_result = ConvertHtcfsResult(response.params[0]);
if (R_FAILED(htcfs_result)) {
R_UNLESS(response.body_size == 0, htcfs::ResultUnexpectedResponseBodySize());
return htcfs_result;
R_RETURN(htcfs_result);
}
/* Check our operation's result. */
const auto native_result = ConvertNativeResult(response.params[1]);
if (R_FAILED(native_result)) {
R_UNLESS(response.body_size == 0, htcfs::ResultUnexpectedResponseBodySize());
return native_result;
R_RETURN(native_result);
}
/* Check the body size. */
@@ -1265,14 +1265,14 @@ namespace ams::htcfs {
const auto htcfs_result = ConvertHtcfsResult(response.params[0]);
if (R_FAILED(htcfs_result)) {
R_UNLESS(response.body_size == 0, htcfs::ResultUnexpectedResponseBodySize());
return htcfs_result;
R_RETURN(htcfs_result);
}
/* Check our operation's result. */
const auto native_result = ConvertNativeResult(response.params[1]);
if (R_FAILED(native_result)) {
R_UNLESS(response.body_size == 0, htcfs::ResultUnexpectedResponseBodySize());
return native_result;
R_RETURN(native_result);
}
/* Check that the size read is allowable. */
@@ -1348,7 +1348,7 @@ namespace ams::htcfs {
/* Verify that the host reports ready to receive our data. */
if (static_cast<HtcfsResult>(response.params[0]) != HtcfsResult::Ready) {
return ConvertHtcfsResult(response.params[0]);
R_RETURN(ConvertHtcfsResult(response.params[0]));
}
/* Verify that our send will be valid. */
@@ -1569,7 +1569,7 @@ namespace ams::htcfs {
const auto htcfs_result = ConvertHtcfsResult(response.params[0]);
if (R_FAILED(htcfs_result)) {
R_UNLESS(response.body_size == 0, htcfs::ResultUnexpectedResponseBodySize());
return htcfs_result;
R_RETURN(htcfs_result);
}
/* Check that the body size is valid. */
@@ -1610,7 +1610,7 @@ namespace ams::htcfs {
const auto htcfs_result = ConvertHtcfsResult(response.params[0]);
if (R_FAILED(htcfs_result)) {
R_UNLESS(response.body_size == 0, htcfs::ResultUnexpectedResponseBodySize());
return htcfs_result;
R_RETURN(htcfs_result);
}
/* Check that the size is representable. */

View File

@@ -117,8 +117,8 @@ namespace ams::htcfs {
Result SendToHtclow(const void *src, s64 size, htclow::Channel *channel);
Result ReceiveFromHtclow(void *dst, s64 size, htclow::Channel *channel);
Result SendRequest(const Header &request) { return this->SendRequest(request, nullptr, 0, nullptr, 0); }
Result SendRequest(const Header &request, const void *arg1, size_t arg1_size) { return this->SendRequest(request, arg1, arg1_size, nullptr, 0); }
Result SendRequest(const Header &request) { R_RETURN(this->SendRequest(request, nullptr, 0, nullptr, 0)); }
Result SendRequest(const Header &request, const void *arg1, size_t arg1_size) { R_RETURN(this->SendRequest(request, arg1, arg1_size, nullptr, 0)); }
Result SendRequest(const Header &request, const void *arg1, size_t arg1_size, const void *arg2, size_t arg2_size);
void InitializeDataChannelForReceive(void *dst, size_t size);

View File

@@ -26,23 +26,23 @@ namespace ams::htcfs {
}
Result DirectoryServiceObject::GetEntryCount(ams::sf::Out<s64> out) {
return htcfs::GetClient().GetEntryCount(out.GetPointer(), m_handle);
R_RETURN(htcfs::GetClient().GetEntryCount(out.GetPointer(), m_handle));
}
Result DirectoryServiceObject::Read(ams::sf::Out<s64> out, const ams::sf::OutMapAliasArray<fs::DirectoryEntry> &out_entries) {
if (out_entries.GetSize() * sizeof(fs::DirectoryEntry) >= ClientImpl::MaxPacketBodySize) {
return htcfs::GetClient().ReadDirectoryLarge(out.GetPointer(), out_entries.GetPointer(), out_entries.GetSize(), m_handle);
R_RETURN(htcfs::GetClient().ReadDirectoryLarge(out.GetPointer(), out_entries.GetPointer(), out_entries.GetSize(), m_handle));
} else {
return htcfs::GetClient().ReadDirectory(out.GetPointer(), out_entries.GetPointer(), out_entries.GetSize(), m_handle);
R_RETURN(htcfs::GetClient().ReadDirectory(out.GetPointer(), out_entries.GetPointer(), out_entries.GetSize(), m_handle));
}
}
Result DirectoryServiceObject::SetPriorityForDirectory(s32 priority) {
return htcfs::GetClient().SetPriorityForDirectory(priority, m_handle);
R_RETURN(htcfs::GetClient().SetPriorityForDirectory(priority, m_handle));
}
Result DirectoryServiceObject::GetPriorityForDirectory(ams::sf::Out<s32> out) {
return htcfs::GetClient().GetPriorityForDirectory(out.GetPointer(), m_handle);
R_RETURN(htcfs::GetClient().GetPriorityForDirectory(out.GetPointer(), m_handle));
}

View File

@@ -30,9 +30,9 @@ namespace ams::htcfs {
R_UNLESS(offset >= 0, htcfs::ResultInvalidArgument());
if (buffer.GetSize() >= ClientImpl::MaxPacketBodySize) {
return htcfs::GetClient().ReadFileLarge(out.GetPointer(), buffer.GetPointer(), m_handle, offset, buffer.GetSize(), option);
R_RETURN(htcfs::GetClient().ReadFileLarge(out.GetPointer(), buffer.GetPointer(), m_handle, offset, buffer.GetSize(), option));
} else {
return htcfs::GetClient().ReadFile(out.GetPointer(), buffer.GetPointer(), m_handle, offset, buffer.GetSize(), option);
R_RETURN(htcfs::GetClient().ReadFile(out.GetPointer(), buffer.GetPointer(), m_handle, offset, buffer.GetSize(), option));
}
}
@@ -41,33 +41,33 @@ namespace ams::htcfs {
R_UNLESS(offset >= 0, htcfs::ResultInvalidArgument());
if (buffer.GetSize() >= ClientImpl::MaxPacketBodySize) {
return htcfs::GetClient().WriteFileLarge(buffer.GetPointer(), m_handle, offset, buffer.GetSize(), option);
R_RETURN(htcfs::GetClient().WriteFileLarge(buffer.GetPointer(), m_handle, offset, buffer.GetSize(), option));
} else {
return htcfs::GetClient().WriteFile(buffer.GetPointer(), m_handle, offset, buffer.GetSize(), option);
R_RETURN(htcfs::GetClient().WriteFile(buffer.GetPointer(), m_handle, offset, buffer.GetSize(), option));
}
}
Result FileServiceObject::GetFileSize(ams::sf::Out<s64> out) {
return htcfs::GetClient().GetFileSize(out.GetPointer(), m_handle);
R_RETURN(htcfs::GetClient().GetFileSize(out.GetPointer(), m_handle));
}
Result FileServiceObject::SetFileSize(s64 size) {
/* Validate size. */
R_UNLESS(size >= 0, htcfs::ResultInvalidArgument());
return htcfs::GetClient().SetFileSize(size, m_handle);
R_RETURN(htcfs::GetClient().SetFileSize(size, m_handle));
}
Result FileServiceObject::FlushFile() {
return htcfs::GetClient().FlushFile(m_handle);
R_RETURN(htcfs::GetClient().FlushFile(m_handle));
}
Result FileServiceObject::SetPriorityForFile(s32 priority) {
return htcfs::GetClient().SetPriorityForFile(priority, m_handle);
R_RETURN(htcfs::GetClient().SetPriorityForFile(priority, m_handle));
}
Result FileServiceObject::GetPriorityForFile(ams::sf::Out<s32> out) {
return htcfs::GetClient().GetPriorityForFile(out.GetPointer(), m_handle);
R_RETURN(htcfs::GetClient().GetPriorityForFile(out.GetPointer(), m_handle));
}
}

View File

@@ -86,7 +86,7 @@ namespace ams::htcfs {
R_UNLESS(IsValidPath(path), htcfs::ResultInvalidArgument());
/* Get whether the file exists. */
return htcfs::GetClient().FileExists(out.GetPointer(), path.str, case_sensitive);
R_RETURN(htcfs::GetClient().FileExists(out.GetPointer(), path.str, case_sensitive));
}
Result FileSystemServiceObject::DeleteFile(const tma::Path &path, bool case_sensitive) {
@@ -94,7 +94,7 @@ namespace ams::htcfs {
R_UNLESS(IsValidPath(path), htcfs::ResultInvalidArgument());
/* Delete the file. */
return htcfs::GetClient().DeleteFile(path.str, case_sensitive);
R_RETURN(htcfs::GetClient().DeleteFile(path.str, case_sensitive));
}
Result FileSystemServiceObject::RenameFile(const tma::Path &old_path, const tma::Path &new_path, bool case_sensitive) {
@@ -103,7 +103,7 @@ namespace ams::htcfs {
R_UNLESS(IsValidPath(new_path), htcfs::ResultInvalidArgument());
/* Rename the file. */
return htcfs::GetClient().RenameFile(old_path.str, new_path.str, case_sensitive);
R_RETURN(htcfs::GetClient().RenameFile(old_path.str, new_path.str, case_sensitive));
}
Result FileSystemServiceObject::GetIOType(sf::Out<s32> out, const tma::Path &path, bool case_sensitive) {
@@ -112,7 +112,7 @@ namespace ams::htcfs {
/* Get the entry type. */
static_assert(sizeof(s32) == sizeof(fs::DirectoryEntryType));
return htcfs::GetClient().GetEntryType(reinterpret_cast<fs::DirectoryEntryType *>(out.GetPointer()), path.str, case_sensitive);
R_RETURN(htcfs::GetClient().GetEntryType(reinterpret_cast<fs::DirectoryEntryType *>(out.GetPointer()), path.str, case_sensitive));
}
Result FileSystemServiceObject::OpenDirectory(sf::Out<sf::SharedPointer<tma::IDirectoryAccessor>> out, const tma::Path &path, s32 open_mode, bool case_sensitive) {
@@ -133,7 +133,7 @@ namespace ams::htcfs {
R_UNLESS(IsValidPath(path), htcfs::ResultInvalidArgument());
/* Get whether the file exists. */
return htcfs::GetClient().DirectoryExists(out.GetPointer(), path.str, case_sensitive);
R_RETURN(htcfs::GetClient().DirectoryExists(out.GetPointer(), path.str, case_sensitive));
}
Result FileSystemServiceObject::CreateDirectory(const tma::Path &path, bool case_sensitive) {
@@ -141,7 +141,7 @@ namespace ams::htcfs {
R_UNLESS(IsValidPath(path), htcfs::ResultInvalidArgument());
/* Create the directory. */
return htcfs::GetClient().CreateDirectory(path.str, case_sensitive);
R_RETURN(htcfs::GetClient().CreateDirectory(path.str, case_sensitive));
}
Result FileSystemServiceObject::DeleteDirectory(const tma::Path &path, bool recursively, bool case_sensitive) {
@@ -149,7 +149,7 @@ namespace ams::htcfs {
R_UNLESS(IsValidPath(path), htcfs::ResultInvalidArgument());
/* Delete the directory. */
return htcfs::GetClient().DeleteDirectory(path.str, recursively, case_sensitive);
R_RETURN(htcfs::GetClient().DeleteDirectory(path.str, recursively, case_sensitive));
}
Result FileSystemServiceObject::RenameDirectory(const tma::Path &old_path, const tma::Path &new_path, bool case_sensitive) {
@@ -158,7 +158,7 @@ namespace ams::htcfs {
R_UNLESS(IsValidPath(new_path), htcfs::ResultInvalidArgument());
/* Rename the file. */
return htcfs::GetClient().RenameDirectory(old_path.str, new_path.str, case_sensitive);
R_RETURN(htcfs::GetClient().RenameDirectory(old_path.str, new_path.str, case_sensitive));
}
Result FileSystemServiceObject::CreateFile(const tma::Path &path, s64 size, bool case_sensitive) {
@@ -166,7 +166,7 @@ namespace ams::htcfs {
R_UNLESS(IsValidPath(path), htcfs::ResultInvalidArgument());
/* Create the file. */
return htcfs::GetClient().CreateFile(path.str, size, case_sensitive);
R_RETURN(htcfs::GetClient().CreateFile(path.str, size, case_sensitive));
}
Result FileSystemServiceObject::GetFileTimeStamp(sf::Out<u64> out_create, sf::Out<u64> out_access, sf::Out<u64> out_modify, const tma::Path &path, bool case_sensitive) {
@@ -174,7 +174,7 @@ namespace ams::htcfs {
R_UNLESS(IsValidPath(path), htcfs::ResultInvalidArgument());
/* Get the timestamp. */
return htcfs::GetClient().GetFileTimeStamp(out_create.GetPointer(), out_access.GetPointer(), out_modify.GetPointer(), path.str, case_sensitive);
R_RETURN(htcfs::GetClient().GetFileTimeStamp(out_create.GetPointer(), out_access.GetPointer(), out_modify.GetPointer(), path.str, case_sensitive));
}
Result FileSystemServiceObject::GetCaseSensitivePath(const tma::Path &path, const sf::OutBuffer &out) {
@@ -182,7 +182,7 @@ namespace ams::htcfs {
R_UNLESS(IsValidPath(path), htcfs::ResultInvalidArgument());
/* Get the case sensitive path. */
return htcfs::GetClient().GetCaseSensitivePath(reinterpret_cast<char *>(out.GetPointer()), out.GetSize(), path.str);
R_RETURN(htcfs::GetClient().GetCaseSensitivePath(reinterpret_cast<char *>(out.GetPointer()), out.GetSize(), path.str));
}
Result FileSystemServiceObject::GetDiskFreeSpaceExW(sf::Out<s64> out_free, sf::Out<s64> out_total, sf::Out<s64> out_total_free, const tma::Path &path) {
@@ -190,7 +190,7 @@ namespace ams::htcfs {
R_UNLESS(IsValidPath(path), htcfs::ResultInvalidArgument());
/* Get the timestamp. */
return htcfs::GetClient().GetDiskFreeSpace(out_free.GetPointer(), out_total.GetPointer(), out_total_free.GetPointer(), path.str);
R_RETURN(htcfs::GetClient().GetDiskFreeSpace(out_free.GetPointer(), out_total.GetPointer(), out_total_free.GetPointer(), path.str));
}
}

View File

@@ -49,7 +49,7 @@ namespace ams::htcfs {
}
inline Result ConvertHtcfsResult(s64 param) {
return ConvertHtcfsResult(static_cast<HtcfsResult>(param));
R_RETURN(ConvertHtcfsResult(static_cast<HtcfsResult>(param)));
}
}

View File

@@ -26,7 +26,7 @@ namespace ams::htcfs {
R_CONVERT(htcfs::ResultInternalError, fs::ResultInternal())
} R_END_TRY_CATCH;
return result;
R_RETURN(result);
}
}

View File

@@ -19,11 +19,11 @@
namespace ams::htcfs {
Result GetWorkingDirectory(char *dst, size_t dst_size) {
return htcfs::GetClient().GetWorkingDirectory(dst, dst_size);
R_RETURN(htcfs::GetClient().GetWorkingDirectory(dst, dst_size));
}
Result GetWorkingDirectorySize(s32 *out) {
return htcfs::GetClient().GetWorkingDirectorySize(out);
R_RETURN(htcfs::GetClient().GetWorkingDirectorySize(out));
}
}