Skip to content

Commit

Permalink
chore: change var names + cleanup typos (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaucy authored Apr 22, 2024
1 parent 9a9bd4e commit 6849936
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions ecsact/wasm/detail/wasm_ecsact_system_execution.cc
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,17 @@ wasm_trap_t* wasm_ecsact_system_execution_context_generate(
auto memory = get_execution_context_memory(args->data[0]);
auto components_count = args->data[1].of.i32;

std::vector<const void*> component_datas;
component_datas.resize(components_count);
std::vector<const void*> component_data_list;
component_data_list.resize(components_count);

// each i32 element represents a pointer in WASM memory
auto component_datas_wasm =
auto component_data_list_wasm =
static_cast<int32_t*>(get_void_ptr(args->data[3], memory));
for(int i = 0; components_count > i; ++i) {
component_datas[i] = get_const_void_ptr(
component_data_list[i] = get_const_void_ptr(
wasm_val_t{
.kind = WASM_I32,
.of{.i32 = component_datas_wasm[i]},
.of{.i32 = component_data_list_wasm[i]},
},
memory
);
Expand All @@ -201,7 +201,7 @@ wasm_trap_t* wasm_ecsact_system_execution_context_generate(
ctx,
components_count,
static_cast<ecsact_component_id*>(get_void_ptr(args->data[2], memory)),
component_datas.data()
component_data_list.data()
);
return nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion test/wasi_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ int main(int argc, char* argv[]) {
ecsact::core::registry test_registry("Test Registry");

auto test_entity = test_registry.create_entity();
test_registry.add_component(test_entity, wasi_test::DummyCompnent{});
test_registry.add_component(test_entity, wasi_test::DummyComponent{});

ecsactsi_wasm_set_trap_handler(&trap_handler);
load_test_virtual_files();
Expand Down
4 changes: 2 additions & 2 deletions test/wasi_test.ecsact
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
main package wasi_test;

component DummyCompnent {
component DummyComponent {
i32 n;
}

system WasiTestSystem {
readwrite DummyCompnent;
readwrite DummyComponent;
}
2 changes: 1 addition & 1 deletion test/wasi_test_read_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <string>

static const auto example_text = []() -> std::string {
std::cout << "Initialzing static string\n";
std::cout << "Initializing static string\n";
auto content = std::string{};

auto f = std::fopen("example.txt", "rb");
Expand Down

0 comments on commit 6849936

Please # to comment.