Skip to content

Commit 4dea323

Browse files
authored
feat: add const qualifier to minst create (#86)
1 parent 3eaf217 commit 4dea323

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v4
2323
- uses: greut/eclint-action@v0
2424
- uses: jidicula/clang-format-action@v4.11.0
25-
with: { clang-format-version: "19" }
25+
with: { clang-format-version: "20" }
2626

2727
test-windows:
2828
if: >-

ecsact/si/wasmer/detail/logger.cc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ auto ecsact::wasm::detail::push_stdio_str(
5454
_stdio_strings[level] += std::string(str);
5555
}
5656

57-
auto ecsact::wasm::detail::consume_stdio_str_as_log_lines(const log_transaction&)
58-
-> std::vector<log_line_entry> {
57+
auto ecsact::wasm::detail::consume_stdio_str_as_log_lines(
58+
const log_transaction&
59+
) -> std::vector<log_line_entry> {
5960
using namespace std::string_view_literals;
6061

6162
auto result = std::vector<log_line_entry>{};
@@ -74,10 +75,12 @@ auto ecsact::wasm::detail::consume_stdio_str_as_log_lines(const log_transaction&
7475
continue;
7576
}
7677

77-
result.push_back(log_line_entry{
78-
.log_level = log_level,
79-
.message = message,
80-
});
78+
result.push_back(
79+
log_line_entry{
80+
.log_level = log_level,
81+
.message = message,
82+
}
83+
);
8184
}
8285
}
8386

ecsact/si/wasmer/detail/minst/minst.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,15 @@ auto minst_trap::message() const -> std::string {
116116

117117
auto minst::create( //
118118
wasm_engine_t* engine,
119-
std::span<std::byte> wasm_data,
119+
std::span<const std::byte> wasm_data,
120120
import_resolver_t import_resolver
121121
) -> std::variant<minst, minst_error> {
122122
auto self = minst{};
123123

124124
auto wasm_bytes = wasm_byte_vec_t{
125125
.size = wasm_data.size(),
126-
.data = reinterpret_cast<wasm_byte_t*>(wasm_data.data()),
126+
.data =
127+
reinterpret_cast<wasm_byte_t*>(const_cast<std::byte*>(wasm_data.data())),
127128
};
128129

129130
self._engine = engine;

ecsact/si/wasmer/detail/minst/minst.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public:
8282

8383
static auto create( //
8484
wasm_engine_t* engine,
85-
std::span<std::byte> wasm_data,
85+
std::span<const std::byte> wasm_data,
8686
import_resolver_t import_resolver
8787
) -> std::variant<minst, minst_error>;
8888

ecsact/si/wasmer/detail/wasm.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ ecsact_si_wasm_error ecsact_si_wasm_load(
172172
}
173173
#endif
174174
auto import_resolver = [&](const minst_import imp) -> minst_import_resolve_t {
175-
auto module_name = imp.module();
176175
auto method_name = imp.name();
177176

178177
if(imp.module() == "env") {

0 commit comments

Comments
 (0)