Fix warnings

extensions
Volodymyr Shymanskyy 3 years ago
parent a033184b5a
commit aa0379bb40

@ -46,7 +46,7 @@ _try {
_throwif (m3Err_malformedFunctionSignature, maxNumTypes < 2);
maxNumTypes -= 2;
_throwif ("insane argument count", maxNumTypes > d_m3MaxSaneFunctionArgRetCount);
_throwif (m3Err_tooManyArgsRets, maxNumTypes > d_m3MaxSaneFunctionArgRetCount);
_ (AllocFuncType (& funcType, (u32) maxNumTypes));

@ -620,7 +620,7 @@ M3Result m3_GetGlobal (IM3Global i_global,
default: return m3Err_invalidTypeId;
}
o_value->type = i_global->type;
o_value->type = (M3ValueType)(i_global->type);
return m3Err_none;
}
@ -645,7 +645,7 @@ M3Result m3_SetGlobal (IM3Global i_global,
M3ValueType m3_GetGlobalType (IM3Global i_global)
{
return (i_global) ? i_global->type : c_m3Type_none;
return (i_global) ? (M3ValueType)(i_global->type) : c_m3Type_none;
}

@ -62,6 +62,7 @@ _ (ReadLEB_i7 (& form, & i_bytes, i_end));
u32 numArgs;
_ (ReadLEB_u32 (& numArgs, & i_bytes, i_end));
_throwif (m3Err_tooManyArgsRets, numArgs > d_m3MaxSaneFunctionArgRetCount);
#if defined(M3_COMPILER_MSVC)
u8 argTypes [d_m3MaxSaneFunctionArgRetCount];
#else
@ -80,7 +81,7 @@ _ (NormalizeType (& argType, wasmType));
u32 numRets;
_ (ReadLEB_u32 (& numRets, & i_bytes, i_end));
_throwif ("argument+returns count overflow", numRets + numArgs > d_m3MaxSaneFunctionArgRetCount);
_throwif (m3Err_tooManyArgsRets, numRets + numArgs > d_m3MaxSaneFunctionArgRetCount);
_ (AllocFuncType (& ftype, numRets + numArgs));
ftype->numArgs = numArgs;

@ -117,7 +117,6 @@ M3ImportContext, * IM3ImportContext;
d_m3ErrorConst (none, NULL)
// general errors
d_m3ErrorConst (typeListOverflow, "type list count exceeds 32 types")
d_m3ErrorConst (mallocFailed, "memory allocation failed")
// parse errors
@ -132,7 +131,8 @@ d_m3ErrorConst (missingUTF8, "invalid length UTF-8 string")
d_m3ErrorConst (wasmSectionUnderrun, "section underrun while parsing Wasm binary")
d_m3ErrorConst (wasmSectionOverrun, "section overrun while parsing Wasm binary")
d_m3ErrorConst (invalidTypeId, "unknown value_type")
d_m3ErrorConst (tooManyMemorySections, "Wasm MVP can only define one memory per module")
d_m3ErrorConst (tooManyMemorySections, "only one memory per module is supported")
d_m3ErrorConst (tooManyArgsRets, "too many arguments or return values")
// link errors
d_m3ErrorConst (moduleAlreadyLinked, "attempting to bind module to multiple runtimes")

Loading…
Cancel
Save