Skip to content

Commit

Permalink
go: Use longer variables names
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed Aug 20, 2018
1 parent c9f8d9d commit c886001
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions bindings/go/evmc/evmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c886001

Please sign in to comment.