Skip to content

Commit 2b167dc

Browse files
committed
some cleanup
1 parent d525119 commit 2b167dc

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

test/utils/wasm3_engine.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66

77
#include <test/utils/adler32.hpp>
88
#include <test/utils/wasm_engine.hpp>
9-
#include <algorithm>
109
#include <cassert>
1110
#include <cstring>
12-
#include <stdexcept>
1311

1412
namespace fizzy::test
1513
{
@@ -90,7 +88,7 @@ bool Wasm3Engine::instantiate(bytes_view wasm_binary)
9088
return false;
9189
}
9290

93-
auto const ret = m3_LinkRawFunction(module, "env", "adler32", "i(ii)", env_adler32);
91+
const auto ret = m3_LinkRawFunction(module, "env", "adler32", "i(ii)", env_adler32);
9492
if (ret != m3Err_none && ret != m3Err_functionLookupFailed)
9593
return false;
9694

@@ -123,10 +121,8 @@ std::optional<WasmEngine::FuncRef> Wasm3Engine::find_function(
123121
if (m3_FindFunction(&function, m_runtime, name.data()) != m3Err_none)
124122
return std::nullopt;
125123

126-
std::vector<M3ValueType> inputs;
127-
std::vector<M3ValueType> outputs;
128-
std::tie(inputs, outputs) = translate_function_signature<M3ValueType, M3ValueType::c_m3Type_i32,
129-
M3ValueType::c_m3Type_i64>(signature);
124+
const auto [inputs, outputs] = translate_function_signature<M3ValueType,
125+
M3ValueType::c_m3Type_i32, M3ValueType::c_m3Type_i64>(signature);
130126

131127
if (inputs.size() != m3_GetArgCount(function))
132128
return std::nullopt;
@@ -150,7 +146,7 @@ WasmEngine::Result Wasm3Engine::execute(
150146

151147
std::vector<const void*> argPtrs;
152148
argPtrs.reserve(args.size());
153-
for (auto const& arg : args)
149+
for (const auto& arg : args)
154150
argPtrs.push_back(&arg);
155151

156152
// This ensures input count/type matches. For the return value we assume find_function did the
@@ -162,7 +158,7 @@ WasmEngine::Result Wasm3Engine::execute(
162158

163159
uint64_t ret_value = 0;
164160
// This should not fail because we check GetRetCount.
165-
[[maybe_unused]] auto const ret = m3_GetResultsV(function, &ret_value);
161+
[[maybe_unused]] const auto ret = m3_GetResultsV(function, &ret_value);
166162
assert(ret == m3Err_none);
167163
return {false, ret_value};
168164
}

0 commit comments

Comments
 (0)