From 1a68d516b51f6af640de8c848e1f9e4e6b3b6d5f Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Tue, 30 Aug 2022 11:12:19 +0300 Subject: [PATCH] Fix warnings --- source/m3_compile.c | 4 ++-- source/m3_compile.h | 2 +- source/m3_info.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/m3_compile.c b/source/m3_compile.c index 3fa533a..d253fec 100644 --- a/source/m3_compile.c +++ b/source/m3_compile.c @@ -933,7 +933,7 @@ M3Result FindReferencedLocalWithinCurrentBlock (IM3Compilation o, u16 * o_pres M3Result result = m3Err_none; IM3CompilationScope scope = & o->block; - i16 startIndex = scope->blockStackIndex; + u16 startIndex = scope->blockStackIndex; while (scope->opcode == c_waOp_block) { @@ -1874,7 +1874,7 @@ _ (ReadBlockType (o, & blockType)); if (IsConstantSlot (o, slot)) { - u16 newSlot; + u16 newSlot = c_slotUnused; _ (AllocateSlots (o, & newSlot, type)); _ (CopyStackIndexToSlot (o, newSlot, i)); o->wasmStack [i] = newSlot; diff --git a/source/m3_compile.h b/source/m3_compile.h index 52f7ab2..d4a6733 100644 --- a/source/m3_compile.h +++ b/source/m3_compile.h @@ -59,7 +59,7 @@ typedef struct M3CompilationScope pc_t patches; i32 depth; u16 exitStackIndex; - i16 blockStackIndex; + u16 blockStackIndex; // u16 topSlot; IM3FuncType type; m3opcode_t opcode; diff --git a/source/m3_info.c b/source/m3_info.c index f8c0a58..5be93b6 100644 --- a/source/m3_info.c +++ b/source/m3_info.c @@ -356,7 +356,7 @@ void dump_type_stack (IM3Compilation o) { d_m3Log(stack, " "); - for (u32 i = 0; i < o->stackIndex; ++i) + for (u16 i = 0; i < o->stackIndex; ++i) { if (i > 0 and i == o->stackFirstDynamicIndex) printf ("#");