ams_mitm: refactor for R_TRY

This commit is contained in:
Michael Scire
2019-06-20 04:04:33 -07:00
parent 4191dcee75
commit 60b831f369
32 changed files with 662 additions and 1246 deletions

View File

@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <switch.h>
#include <stratosphere.hpp>
#include <cstring>
@@ -43,16 +43,12 @@ void LaunchAllMitmModules() {
/* Create thread for each module. */
for (u32 i = 0; i < static_cast<u32>(MitmModuleId_Count); i++) {
const auto cur_module = &g_module_definitions[i];
if (R_FAILED(g_module_threads[i].Initialize(cur_module->main, nullptr, cur_module->stack_size, cur_module->priority))) {
std::abort();
}
R_ASSERT(g_module_threads[i].Initialize(cur_module->main, nullptr, cur_module->stack_size, cur_module->priority));
}
/* Start thread for each module. */
for (u32 i = 0; i < static_cast<u32>(MitmModuleId_Count); i++) {
if (R_FAILED(g_module_threads[i].Start())) {
std::abort();
}
R_ASSERT(g_module_threads[i].Start());
}
}