From c0e7772f520d003fce8620a02c185ce0a6282df3 Mon Sep 17 00:00:00 2001 From: jangko Date: Thu, 7 Apr 2022 21:14:49 +0700 Subject: [PATCH] Fix for styleCheck:usages --- evmc.nimble | 2 ++ evmc/evmc_nim.nim | 4 ++-- tests/test_host_vm.nim | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/evmc.nimble b/evmc.nimble index 82eedc5..eabca45 100644 --- a/evmc.nimble +++ b/evmc.nimble @@ -15,6 +15,8 @@ proc test(name: string, lang: string = "cpp") = mkDir "build" --run switch("out", ("./build/" & name)) + switch("styleCheck", "usages") + switch("styleCheck", "error") setCommand lang, "tests/" & name & ".nim" task test_debug, "Run all tests - test implementation": diff --git a/evmc/evmc_nim.nim b/evmc/evmc_nim.nim index b239e5c..71112c8 100644 --- a/evmc/evmc_nim.nim +++ b/evmc/evmc_nim.nim @@ -55,11 +55,11 @@ proc copyCode*(ctx: HostContext, address: var evmc_address, codeOffset: int = 0) let size = ctx.getCodeSize(address) if size - codeOffset > 0: result = newSeq[byte](size - codeOffset) - let read = ctx.host.copy_code(ctx.context, address, code_offset.csize_t, result[0].addr, result.len.csize_t).int + let read = ctx.host.copy_code(ctx.context, address, codeOffset.csize_t, result[0].addr, result.len.csize_t).int doAssert(read == result.len) proc copyCode*(ctx: HostContext, address: var evmc_address, codeOffset: int, output: ptr byte, output_len: int): int = - ctx.host.copy_code(ctx.context, address, code_offset.csize_t, output, output_len.csize_t).int + ctx.host.copy_code(ctx.context, address, codeOffset.csize_t, output, output_len.csize_t).int proc selfdestruct*(ctx: HostContext, address, beneficiary: var evmc_address) = ctx.host.selfdestruct(ctx.context, address, beneficiary) diff --git a/tests/test_host_vm.nim b/tests/test_host_vm.nim index 2c74b14..1f1360e 100644 --- a/tests/test_host_vm.nim +++ b/tests/test_host_vm.nim @@ -18,10 +18,10 @@ import stew/byteutils {.compile: "evmc_c/example_host.cpp".} {.compile: "evmc_c/example_vm.cpp".} -{.passL: "-lstdc++"} +{.passl: "-lstdc++"} when defined(posix): - {.passC: "-std=c++14".} + {.passc: "-std=c++14".} # The original EVMC C/C++ `example_host_create_context` test code wants struct # `evmc_tx_context` passed by value, and `(tx_context: evmc_tx_context)` looks