indent labels

This commit is contained in:
jacob 2024-04-03 23:20:31 -05:00
parent bfe64f7373
commit 354c372e26
7 changed files with 24 additions and 18 deletions

View File

@ -802,7 +802,6 @@ struct ase_decode_image_result ase_decode_image(struct arena *arena, struct buff
abort: abort:
scratch_end(scratch); scratch_end(scratch);
return res; return res;
} }

View File

@ -818,9 +818,11 @@ INTERNAL void parse(struct arena *arena, struct parser *p)
} }
abort: abort:
scratch_end(scratch);
p->at = at; p->at = at;
p->root = root; p->root = root;
scratch_end(scratch);
} }
/* ========================== * /* ========================== *

View File

@ -138,6 +138,7 @@ struct sys_window_settings *settings_deserialize(struct arena *arena, struct buf
if (!found_height) { error = STR("Missing \"height\""); goto abort; } if (!found_height) { error = STR("Missing \"height\""); goto abort; }
abort: abort:
if (error_out && (error.len > 0 || json_error.msg.len > 0)) { if (error_out && (error.len > 0 || json_error.msg.len > 0)) {
if (json_error.msg.len > 0) { if (json_error.msg.len > 0) {
*error_out = string_format(arena, *error_out = string_format(arena,

View File

@ -197,6 +197,7 @@ INTERNAL WORK_TASK_FUNC_DEF(sheet_load_asset_task, vparams)
} }
abort: abort:
if (!success) { if (!success) {
logf_error("Error loading sheet \"%F\": %F", FMT_STR(path), FMT_STR(error_msg)); logf_error("Error loading sheet \"%F\": %F", FMT_STR(path), FMT_STR(error_msg));

View File

@ -148,6 +148,7 @@ INTERNAL WORK_TASK_FUNC_DEF(sound_load_asset_task, vparams)
} }
abort: abort:
if (!success) { if (!success) {
logf_error("Error loading sound \"%F\": %F", FMT_STR(path), FMT_STR(error_msg)); logf_error("Error loading sound \"%F\": %F", FMT_STR(path), FMT_STR(error_msg));

View File

@ -1861,7 +1861,7 @@ int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance,
if (L.thread_tls_index == TLS_OUT_OF_INDEXES) { if (L.thread_tls_index == TLS_OUT_OF_INDEXES) {
/* TODO: GetLastError */ /* TODO: GetLastError */
error_msg = L"Platform initialization error: TLS_OUT_OF_INDEXES"; error_msg = L"Platform initialization error: TLS_OUT_OF_INDEXES";
goto error; goto abort;
} }
/* Initialize main thread context. /* Initialize main thread context.
@ -1901,7 +1901,7 @@ int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance,
if (!RegisterClassExW(wc)) { if (!RegisterClassExW(wc)) {
/* TODO: GetLastError */ /* TODO: GetLastError */
error_msg = L"Failed to register window class"; error_msg = L"Failed to register window class";
goto error; goto abort;
} }
} }
@ -1916,21 +1916,22 @@ int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance,
if (!RegisterRawInputDevices(&rid, 1, sizeof(rid))) { if (!RegisterRawInputDevices(&rid, 1, sizeof(rid))) {
/* TODO: GetLastError */ /* TODO: GetLastError */
error_msg = L"Failed to register raw input device"; error_msg = L"Failed to register raw input device";
goto error; goto abort;
} }
} }
error:
if (error_msg) {
MessageBoxExW(NULL, error_msg, L"Fatal initialization error", MB_ICONSTOP, 0);
ASSERT(false);
return 1;
}
/* Create app thread & wait for return */ /* Create app thread & wait for return */
struct sys_thread app_thread = sys_thread_init(&app_thread_entry_point, NULL, STR("[P9] App thread")); struct sys_thread app_thread = sys_thread_init(&app_thread_entry_point, NULL, STR("[P9] App thread"));
sys_thread_join(&app_thread); sys_thread_join(&app_thread);
abort:
if (error_msg) {
MessageBoxExW(NULL, error_msg, L"Fatal initialization error", MB_ICONSTOP, 0);
ASSERT(false);
return 1;
}
win32_tls_release(&main_thread_tls); win32_tls_release(&main_thread_tls);
/* Uninitialize COM */ /* Uninitialize COM */

View File

@ -200,6 +200,7 @@ INTERNAL WORK_TASK_FUNC_DEF(texture_load_asset_task, vparams)
} }
abort: abort:
if (!success) { if (!success) {
logf_error("Error loading texture \"%F\": %F", FMT_STR(path), FMT_STR(error_msg)); logf_error("Error loading texture \"%F\": %F", FMT_STR(path), FMT_STR(error_msg));