Fix more warnings

extensions
Volodymyr Shymanskyy 5 years ago
parent 272a2e889d
commit 461ab0d056

@ -235,8 +235,8 @@ typedef int64_t (* M3Callback) (IM3Function i_currentFunction, void * i_ref);
// const char * const i_functionName, const char * const i_signature);
M3Result m3_Call (IM3Function i_function);
M3Result m3_CallWithArgs (IM3Function i_function, int32_t i_argc, const char * const * i_argv);
M3Result m3_CallMain (IM3Function i_function, int32_t i_argc, const char * const * i_argv);
M3Result m3_CallWithArgs (IM3Function i_function, uint32_t i_argc, const char * const * i_argv);
M3Result m3_CallMain (IM3Function i_function, uint32_t i_argc, const char * const * i_argv);
// void * /* return */ m3_Call (IM3Function i_function, M3Result * o_result);

@ -332,7 +332,7 @@ M3Result m3_LinkFunction (IM3Module io_module, const char * const i_functionN
EmitWord (page, callerOp);
for (i32 j = 0; j < i; ++j)
for (u32 j = 0; j < i; ++j)
EmitWord (page, pushers [j]);
EmitWord (page, i_function);

@ -245,7 +245,7 @@ M3Result Read_u8 (u8 * o_value, bytes_t * io_bytes, cbytes_t i_end)
}
M3Result ReadLebUnsigned (u64 * o_value, i32 i_maxNumBits, bytes_t * io_bytes, cbytes_t i_end)
M3Result ReadLebUnsigned (u64 * o_value, u32 i_maxNumBits, bytes_t * io_bytes, cbytes_t i_end)
{
M3Result result = c_m3Err_wasmUnderrun;
@ -281,7 +281,7 @@ M3Result ReadLebUnsigned (u64 * o_value, i32 i_maxNumBits, bytes_t * io_bytes,
}
M3Result ReadLebSigned (i64 * o_value, i32 i_maxNumBits, bytes_t * io_bytes, cbytes_t i_end)
M3Result ReadLebSigned (i64 * o_value, u32 i_maxNumBits, bytes_t * io_bytes, cbytes_t i_end)
{
M3Result result = c_m3Err_wasmUnderrun;

@ -232,8 +232,8 @@ M3Result Read_u64 (u64 * o_value, const u8 ** io_bytes, cbytes_t i_end);
M3Result Read_u32 (u32 * o_value, const u8 ** io_bytes, cbytes_t i_end);
M3Result Read_u8 (u8 * o_value, const u8 ** io_bytes, cbytes_t i_end);
M3Result ReadLebUnsigned (u64 * o_value, i32 i_maxNumBits, bytes_t * io_bytes, cbytes_t i_end);
M3Result ReadLebSigned (i64 * o_value, i32 i_maxNumBits, bytes_t * io_bytes, cbytes_t i_end);
M3Result ReadLebUnsigned (u64 * o_value, u32 i_maxNumBits, bytes_t * io_bytes, cbytes_t i_end);
M3Result ReadLebSigned (i64 * o_value, u32 i_maxNumBits, bytes_t * io_bytes, cbytes_t i_end);
M3Result ReadLEB_u32 (u32 * o_value, bytes_t* io_bytes, cbytes_t i_end);
M3Result ReadLEB_u7 (u8 * o_value, bytes_t * io_bytes, cbytes_t i_end);
M3Result ReadLEB_i7 (i8 * o_value, bytes_t * io_bytes, cbytes_t i_end);

@ -284,7 +284,7 @@ _ (ReadLEB_u32 (& numElements, & bytes, end));
u32 endElement = numElements + offset;
if (endElement > offset)
if (endElement > offset) // TODO: check this, endElement depends on offset
{
io_module->table0 = (IM3Function*)m3RellocArray (io_module->table0, IM3Function, endElement, io_module->table0Size);
@ -384,7 +384,7 @@ M3Result m3_Call (IM3Function i_function)
}
M3Result m3_CallWithArgs (IM3Function i_function, int32_t i_argc, const char * const * i_argv)
M3Result m3_CallWithArgs (IM3Function i_function, uint32_t i_argc, const char * const * i_argv)
{
M3Result result = c_m3Err_none;
@ -410,7 +410,7 @@ M3Result m3_CallWithArgs (IM3Function i_function, int32_t i_argc, const char *
// The format is currently not user-friendly by default,
// as this is used in spec tests
for (int i = 0; i < ftype->numArgs; ++i)
for (u32 i = 0; i < ftype->numArgs; ++i)
{
m3stack_t s = &stack[i];
ccstr_t str = i_argv[i];
@ -462,7 +462,7 @@ _ ((M3Result)Call (i_function->compiled, stack, linearMemory, d_m3OpDefaultArgs
_catch: return result;
}
M3Result m3_CallMain (IM3Function i_function, int32_t i_argc, const char * const * i_argv)
M3Result m3_CallMain (IM3Function i_function, uint32_t i_argc, const char * const * i_argv)
{
M3Result result = c_m3Err_none;
@ -486,7 +486,7 @@ _ (Module_EnsureMemorySize (module, & i_function->module->memory, 3000000));
i32 * pointers = (i32 *) (memory->wasmPages + offset);
for (i32 i = 0; i < i_argc; ++i)
for (u32 i = 0; i < i_argc; ++i)
{
size_t argLength = strlen (i_argv [i]) + 1;

@ -54,7 +54,7 @@ d_m3OpDef (CallIndirect)
i32 tableIndex = * (i32 *) (sp + type->numArgs);
if (tableIndex >= 0 and tableIndex < module->table0Size)
if (tableIndex >= 0 and (u32)tableIndex < module->table0Size)
{
m3ret_t r = c_m3Err_none;

@ -71,7 +71,7 @@ void PrintFuncTypeSignature (IM3FuncType i_funcType)
size_t SPrintArg (char * o_string, size_t i_n, m3stack_t i_sp, u8 i_type)
{
size_t len = 0;
int len = 0;
* o_string = 0;

Loading…
Cancel
Save