mirror of https://github.com/status-im/evmc.git
EVM-C: Simplify evm_hash256 struct
This commit is contained in:
parent
80581b3df7
commit
0b9b01e05c
|
@ -68,7 +68,7 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
char const code[] = "exec()";
|
char const code[] = "exec()";
|
||||||
const size_t code_size = sizeof(code);
|
const size_t code_size = sizeof(code);
|
||||||
struct evm_hash256 code_hash = {.words = {1, 2, 3}};
|
struct evm_hash256 code_hash = {.bytes = {1, 2, 3,}};
|
||||||
char const input[] = "Hello World!";
|
char const input[] = "Hello World!";
|
||||||
struct evm_uint256 value = {{1, 0, 0, 0}};
|
struct evm_uint256 value = {{1, 0, 0, 0}};
|
||||||
|
|
||||||
|
|
|
@ -48,12 +48,11 @@ struct evm_hash160 {
|
||||||
/// 32 bytes of data. For EVM that means big-endian 256-bit integer. Values of
|
/// 32 bytes of data. For EVM that means big-endian 256-bit integer. Values of
|
||||||
/// this type are converted to host-endian values inside EVM.
|
/// this type are converted to host-endian values inside EVM.
|
||||||
struct evm_hash256 {
|
struct evm_hash256 {
|
||||||
union {
|
/// The 32 bytes of the integer/hash.
|
||||||
/// The 32 bytes of the integer/hash. Memory aligned to 8 bytes.
|
///
|
||||||
uint8_t bytes[32];
|
/// The memory is expected be aligned to 8 bytes, but there no protable way
|
||||||
/// Additional access by uint64 words to enforce 8 bytes alignment.
|
/// to express that.
|
||||||
uint64_t words[4];
|
uint8_t bytes[32];
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// The execution result code.
|
/// The execution result code.
|
||||||
|
|
Loading…
Reference in New Issue