From c8860013bafff30913f9ac78ce2ffcafd3c0bc25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 20 Aug 2018 12:10:01 +0200 Subject: [PATCH] go: Use longer variables names --- bindings/go/evmc/evmc.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/bindings/go/evmc/evmc.go b/bindings/go/evmc/evmc.go index 279f51a1b..782352c51 100644 --- a/bindings/go/evmc/evmc.go +++ b/bindings/go/evmc/evmc.go @@ -17,10 +17,10 @@ package evmc static inline int set_option(struct evmc_instance* instance, char* name, char* value) { - int r = evmc_set_option(instance, name, value); + int ret = evmc_set_option(instance, name, value); free(name); free(value); - return r; + return ret; } struct extended_context @@ -199,23 +199,23 @@ func (instance *Instance) Execute(ctx HostContext, rev Revision, ctxId := addHostContext(ctx) // FIXME: Clarify passing by pointer vs passing by value. - d := evmcAddress(destination) - s := evmcAddress(sender) - v := evmcUint256be(value) - ch := evmcUint256be(codeHash) - r := C.execute_wrapper(instance.handle, C.int64_t(ctxId), uint32(rev), &d, &s, &v, - bytesPtr(input), C.size_t(len(input)), &ch, C.int64_t(gas), C.int32_t(depth), C.enum_evmc_call_kind(kind), flags, - bytesPtr(code), C.size_t(len(code))) + evmcDestination := evmcAddress(destination) + evmcSender := evmcAddress(sender) + evmcValue := evmcUint256be(value) + evmcCodeHash := evmcUint256be(codeHash) + result := C.execute_wrapper(instance.handle, C.int64_t(ctxId), uint32(rev), &evmcDestination, &evmcSender, &evmcValue, + bytesPtr(input), C.size_t(len(input)), &evmcCodeHash, C.int64_t(gas), C.int32_t(depth), C.enum_evmc_call_kind(kind), + flags, bytesPtr(code), C.size_t(len(code))) removeHostContext(ctxId) - output = C.GoBytes(unsafe.Pointer(r.output_data), C.int(r.output_size)) - gasLeft = int64(r.gas_left) - if r.status_code != C.EVMC_SUCCESS { - err = Error(r.status_code) + output = C.GoBytes(unsafe.Pointer(result.output_data), C.int(result.output_size)) + gasLeft = int64(result.gas_left) + if result.status_code != C.EVMC_SUCCESS { + err = Error(result.status_code) } - if r.release != nil { - C.evmc_release_result(&r) + if result.release != nil { + C.evmc_release_result(&result) } return output, gasLeft, err