From 2c1a2af2c88f72d3dc91550f2c5095820569f7d0 Mon Sep 17 00:00:00 2001 From: Steven Massey Date: Thu, 15 Apr 2021 17:05:43 -0700 Subject: [PATCH] spaces --- source/m3_compile.c | 8 +++++--- source/m3_core.h | 2 +- source/m3_env.c | 4 ++-- source/m3_info.c | 10 +++++----- source/m3_module.c | 2 +- source/m3_parse.c | 2 +- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/source/m3_compile.c b/source/m3_compile.c index 12e5e49..e057719 100644 --- a/source/m3_compile.c +++ b/source/m3_compile.c @@ -112,7 +112,7 @@ i16 GetStackTopIndex (IM3Compilation o) u16 GetStackHeight (IM3Compilation o) { - return o->stackIndex - o->stackFirstDynamicIndex; + return o->stackIndex - o->stackFirstDynamicIndex; } u8 GetStackTopTypeAtOffset (IM3Compilation o, u16 i_offset) @@ -1243,8 +1243,10 @@ _ ((i_opcode == 0x23) ? Compile_GetGlobal (o, global) : Compile_SetGlo M3Result EmitPatchingBranch (IM3Compilation o, IM3CompilationScope i_scope) { - M3Result result; + M3Result result ; +_try { + _ (EmitOp (o, op_Branch)); // IM3BranchPatch is two word struct; reserve two words @@ -1253,7 +1255,7 @@ _ (EmitOp (o, op_Branch)); patch->next = i_scope->patches; i_scope->patches = patch; - _catch: +} _catch: return result; } diff --git a/source/m3_core.h b/source/m3_core.h index 5853c2f..015ab12 100644 --- a/source/m3_core.h +++ b/source/m3_core.h @@ -240,7 +240,7 @@ M3Result ReadLEB_i32 (i32 * o_value, bytes_t * io_bytes, cbytes_t M3Result ReadLEB_i64 (i64 * o_value, bytes_t * io_bytes, cbytes_t i_end); M3Result Read_utf8 (cstr_t * o_utf8, bytes_t * io_bytes, cbytes_t i_end); -cstr_t SPrintValue (void * i_value, u8 i_type); +cstr_t SPrintValue (void * i_value, u8 i_type); size_t SPrintArg (char * o_string, size_t i_stringBufferSize, m3stack_t i_sp, u8 i_type); void ReportError (IM3Runtime io_runtime, IM3Module i_module, IM3Function i_function, ccstr_t i_errorMessage, ccstr_t i_file, u32 i_lineNum); diff --git a/source/m3_env.c b/source/m3_env.c index 259fc5d..e47751f 100644 --- a/source/m3_env.c +++ b/source/m3_env.c @@ -291,8 +291,8 @@ M3Result EvaluateExpression (IM3Module i_module, void * o_expressed, u8 i_type m3ret_t r = Call (m3code, stack, NULL, d_m3OpDefaultArgs); if (r == 0) - { m3log (runtime, "expression result: %s", SPrintValue (stack, i_type)); - if (SizeOfType (i_type) == sizeof (u32)) + { m3log (runtime, "expression result: %s", SPrintValue (stack, i_type)); + if (SizeOfType (i_type) == sizeof (u32)) { * (u32 *) o_expressed = * ((u32 *) stack); } diff --git a/source/m3_info.c b/source/m3_info.c index b746f02..2581559 100644 --- a/source/m3_info.c +++ b/source/m3_info.c @@ -16,8 +16,8 @@ // a central function you can be breakpoint: void ExceptionBreakpoint (cstr_t i_exception, cstr_t i_message) { - printf ("\nexception: '%s' @ %s\n", i_exception, i_message); - return; + printf ("\nexception: '%s' @ %s\n", i_exception, i_message); + return; } @@ -122,9 +122,9 @@ size_t SPrintArg (char * o_string, size_t i_stringBufferSize, m3stack_t i_sp, cstr_t SPrintValue (void * i_value, u8 i_type) { - static char string [100]; - SPrintArg (string, 100, (m3stack_t) i_value, i_type); - return string; + static char string [100]; + SPrintArg (string, 100, (m3stack_t) i_value, i_type); + return string; } diff --git a/source/m3_module.c b/source/m3_module.c index 82e68d6..1566fb0 100644 --- a/source/m3_module.c +++ b/source/m3_module.c @@ -36,7 +36,7 @@ void m3_FreeModule (IM3Module i_module) for (u32 i = 0; i < i_module->numGlobals; ++i) { - m3_Free (i_module->globals[i].name); + m3_Free (i_module->globals[i].name); } for (u32 i = 0; i < i_module->numGlobals; ++i) { diff --git a/source/m3_parse.c b/source/m3_parse.c index ee7f3a2..81f55f5 100644 --- a/source/m3_parse.c +++ b/source/m3_parse.c @@ -412,7 +412,7 @@ _ (ReadLEB_u32 (& segment->size, & i_bytes, i_end)); i, segment->memoryRegion, segment->initExprSize, segment->size); i_bytes += segment->size; - _throwif("data segment underflow", i_bytes > i_end); + _throwif("data segment underflow", i_bytes > i_end); } _catch: