diff --git a/stratosphere/boot2/source/boot2_main.cpp b/stratosphere/boot2/source/boot2_main.cpp index 1c290701f..704a36751 100644 --- a/stratosphere/boot2/source/boot2_main.cpp +++ b/stratosphere/boot2/source/boot2_main.cpp @@ -151,11 +151,11 @@ int main(int argc, char **argv) LaunchTitle(0x0100000000000007, 3, 0, NULL); bool maintenance = ShouldForceMaintenanceMode(); - for (unsigned int i = 0; i < sizeof(g_additional_launch_programs) / sizeof(g_additional_launch_programs[0]); i++) { - if (!maintenance || std::get(g_additional_launch_programs[i])) { - LaunchTitle(std::get(g_additional_launch_programs[i]), 3, 0, NULL); + for (auto &launch_program : g_additional_launch_programs) { + if (!maintenance || std::get(launch_program)) { + LaunchTitle(std::get(launch_program), 3, 0, NULL); } } return 0; -} \ No newline at end of file +} diff --git a/stratosphere/loader/source/ldr_launch_queue.cpp b/stratosphere/loader/source/ldr_launch_queue.cpp index 94df49965..cbca94b02 100644 --- a/stratosphere/loader/source/ldr_launch_queue.cpp +++ b/stratosphere/loader/source/ldr_launch_queue.cpp @@ -79,4 +79,4 @@ LaunchQueue::LaunchItem *LaunchQueue::get_item(u64 tid) { return NULL; } return &g_launch_queue[idx]; -} \ No newline at end of file +} diff --git a/stratosphere/sm/source/sm_registration.cpp b/stratosphere/sm/source/sm_registration.cpp index 714ca42b8..15a25719f 100644 --- a/stratosphere/sm/source/sm_registration.cpp +++ b/stratosphere/sm/source/sm_registration.cpp @@ -21,9 +21,9 @@ u64 GetServiceNameLength(u64 service) { /* Utilities. */ Registration::Process *Registration::GetProcessForPid(u64 pid) { - for (unsigned int i = 0; i < REGISTRATION_LIST_MAX_PROCESS; i++) { - if (g_process_list[i].pid == pid) { - return &g_process_list[i]; + for (auto &process : g_process_list) { + if (process.pid == pid) { + return &process; } } return NULL; @@ -33,10 +33,10 @@ Registration::Process *Registration::GetFreeProcess() { return GetProcessForPid(0); } -Registration::Service *Registration::GetService(u64 service) { - for (unsigned int i = 0; i < REGISTRATION_LIST_MAX_SERVICE; i++) { - if (g_service_list[i].service_name == service) { - return &g_service_list[i]; +Registration::Service *Registration::GetService(u64 service_name) { + for (auto &service : g_service_list) { + if (service.service_name == service_name) { + return &service; } } return NULL;