fix formatting code

This commit is contained in:
mrdude2478 2023-09-06 06:55:30 +01:00
parent 6e78c58e40
commit 8985923151

View File

@ -159,12 +159,10 @@ namespace netInstStuff {
void OnUnwound() void OnUnwound()
{ {
LOG_DEBUG("unwinding view\n"); LOG_DEBUG("unwinding view\n");
if (m_clientSocket != 0) if (m_clientSocket != 0) {
{
close(m_clientSocket); close(m_clientSocket);
m_clientSocket = 0; m_clientSocket = 0;
} }
curl_global_cleanup(); curl_global_cleanup();
} }
@ -301,13 +299,11 @@ namespace netInstStuff {
OnUnwound(); OnUnwound();
try try {
{
ASSERT_OK(curl_global_init(CURL_GLOBAL_ALL), "Curl failed to initialized"); ASSERT_OK(curl_global_init(CURL_GLOBAL_ALL), "Curl failed to initialized");
// Initialize the server socket if it hasn't already been // Initialize the server socket if it hasn't already been
if (m_serverSocket == 0) if (m_serverSocket == 0) {
{
InitializeServerSocket(); InitializeServerSocket();
if (m_serverSocket <= 0) if (m_serverSocket <= 0)
@ -328,12 +324,12 @@ namespace netInstStuff {
std::vector<std::string> urls; std::vector<std::string> urls;
while (true) while (true) {
{
padUpdate(&pad); padUpdate(&pad);
// If we don't update the UI occasionally the Switch basically crashes on this screen if you press the home button // If we don't update the UI occasionally the Switch basically crashes on this screen if you press the home button
u64 newTime = armGetSystemTick(); u64 newTime = armGetSystemTick();
if (newTime - startTime >= freq * 0.25) { if (newTime - startTime >= freq * 0.25) {
startTime = newTime; startTime = newTime;
inst::ui::mainApp->CallForRender(); inst::ui::mainApp->CallForRender();
@ -556,17 +552,17 @@ namespace netInstStuff {
} }
return urls; return urls;
}
} }
catch (std::runtime_error& e)
{ catch (std::runtime_error& e) {
close(m_serverSocket); close(m_serverSocket);
m_serverSocket = 0; m_serverSocket = 0;
LOG_DEBUG("Failed to perform remote install!\n"); LOG_DEBUG("Failed to perform remote install!\n");
LOG_DEBUG("%s", e.what()); LOG_DEBUG("%s", e.what());
fprintf(stdout, "%s", e.what()); fprintf(stdout, "%s", e.what());
inst::ui::mainApp->CreateShowDialog("inst.net.failed"_lang, (std::string)e.what(), { "common.ok"_lang }, true, "romfs:/images/icons/fail.png"); inst::ui::mainApp->CreateShowDialog("inst.net.failed"_lang, (std::string)e.what(), { "common.ok"_lang }, true, "romfs:/images/icons/fail.png");
return {}; return {};
} }
} }
} }