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

@ -68,7 +68,7 @@ namespace ams::htclow::mux {
/* Process for the channel. */
if (auto it = m_channel_impl_map.GetMap().find(header.channel); it != m_channel_impl_map.GetMap().end()) {
return m_channel_impl_map[it->second].ProcessReceivePacket(header, body, body_size);
R_RETURN(m_channel_impl_map[it->second].ProcessReceivePacket(header, body, body_size));
} else {
if (header.packet_type == PacketType_Data || header.packet_type == PacketType_MaxData) {
this->SendErrorPacket(header.channel);
@ -209,7 +209,7 @@ namespace ams::htclow::mux {
R_UNLESS(it != m_channel_impl_map.GetMap().end(), htclow::ResultChannelNotExist());
/* Perform the connection. */
return m_channel_impl_map[it->second].DoConnectBegin(out_task_id);
R_RETURN(m_channel_impl_map[it->second].DoConnectBegin(out_task_id));
}
Result Mux::ConnectEnd(impl::ChannelInternalType channel, u32 task_id) {
@ -230,7 +230,7 @@ namespace ams::htclow::mux {
R_UNLESS(it != m_channel_impl_map.GetMap().end(), htclow::ResultChannelNotExist());
/* Perform the disconnection. */
return m_channel_impl_map[it->second].DoConnectEnd();
R_RETURN(m_channel_impl_map[it->second].DoConnectEnd());
}
ChannelState Mux::GetChannelState(impl::ChannelInternalType channel) {
@ -256,7 +256,7 @@ namespace ams::htclow::mux {
R_UNLESS(it != m_channel_impl_map.GetMap().end(), htclow::ResultChannelNotExist());
/* Perform the connection. */
return m_channel_impl_map[it->second].DoFlush(out_task_id);
R_RETURN(m_channel_impl_map[it->second].DoFlush(out_task_id));
}
Result Mux::FlushEnd(u32 task_id) {
@ -291,7 +291,7 @@ namespace ams::htclow::mux {
R_UNLESS(it != m_channel_impl_map.GetMap().end(), htclow::ResultChannelNotExist());
/* Perform the connection. */
return m_channel_impl_map[it->second].DoReceiveBegin(out_task_id, size);
R_RETURN(m_channel_impl_map[it->second].DoReceiveBegin(out_task_id, size));
}
Result Mux::ReceiveEnd(size_t *out, void *dst, size_t dst_size, impl::ChannelInternalType channel, u32 task_id) {
@ -308,7 +308,7 @@ namespace ams::htclow::mux {
R_UNLESS(it != m_channel_impl_map.GetMap().end(), htclow::ResultChannelNotExist());
/* Perform the receive. */
return m_channel_impl_map[it->second].DoReceiveEnd(out, dst, dst_size);
R_RETURN(m_channel_impl_map[it->second].DoReceiveEnd(out, dst, dst_size));
} else {
*out = 0;
R_SUCCEED();
@ -324,7 +324,7 @@ namespace ams::htclow::mux {
R_UNLESS(it != m_channel_impl_map.GetMap().end(), htclow::ResultChannelNotExist());
/* Perform the connection. */
return m_channel_impl_map[it->second].DoSend(out_task_id, out, src, src_size);
R_RETURN(m_channel_impl_map[it->second].DoSend(out_task_id, out, src, src_size));
}
Result Mux::SendEnd(u32 task_id) {
@ -344,7 +344,7 @@ namespace ams::htclow::mux {
}
Result Mux::WaitReceiveBegin(u32 *out_task_id, impl::ChannelInternalType channel, size_t size) {
return this->ReceiveBegin(out_task_id, channel, size);
R_RETURN(this->ReceiveBegin(out_task_id, channel, size));
}
Result Mux::WaitReceiveEnd(u32 task_id) {
@ -420,7 +420,7 @@ namespace ams::htclow::mux {
R_UNLESS(it != m_channel_impl_map.GetMap().end(), htclow::ResultChannelNotExist());
/* Perform the shutdown. */
return m_channel_impl_map[it->second].DoShutdown();
R_RETURN(m_channel_impl_map[it->second].DoShutdown());
}
}