Browse Source

ethash_return_value get a _t for consistency

cl-refactor
Lefteris Karapetsas 10 years ago
parent
commit
d7b3e00407
  1. 12
      ethash.h
  2. 10
      internal.c

12
ethash.h

@ -73,16 +73,14 @@ struct ethash_full;
typedef struct ethash_full* ethash_full_t; typedef struct ethash_full* ethash_full_t;
typedef int(*ethash_callback_t)(unsigned); typedef int(*ethash_callback_t)(unsigned);
// LTODO: for consistency's sake maybe use ethash_return_value_t?
typedef struct ethash_return_value { typedef struct ethash_return_value {
ethash_h256_t result; ethash_h256_t result;
ethash_h256_t mix_hash; ethash_h256_t mix_hash;
} ethash_return_value; } ethash_return_value_t;
uint64_t ethash_get_datasize(uint64_t const block_number); uint64_t ethash_get_datasize(uint64_t const block_number);
uint64_t ethash_get_cachesize(uint64_t const block_number); uint64_t ethash_get_cachesize(uint64_t const block_number);
// LTODO: for consistency's sake maybe use ethash_cache_t?
typedef struct ethash_cache { typedef struct ethash_cache {
void* mem; void* mem;
uint64_t cache_size; uint64_t cache_size;
@ -131,7 +129,7 @@ void ethash_light_delete(ethash_light_t light);
* parameters given. * parameters given.
*/ */
bool ethash_light_compute( bool ethash_light_compute(
ethash_return_value* ret, ethash_return_value_t* ret,
ethash_light_t light, ethash_light_t light,
uint64_t full_size, uint64_t full_size,
const ethash_h256_t* header_hash, const ethash_h256_t* header_hash,
@ -195,7 +193,7 @@ void ethash_full_delete(ethash_full_t full);
* at some point return a non-zero value * at some point return a non-zero value
*/ */
bool ethash_full_compute( bool ethash_full_compute(
ethash_return_value* ret, ethash_return_value_t* ret,
ethash_full_t full, ethash_full_t full,
ethash_h256_t const* header_hash, ethash_h256_t const* header_hash,
uint64_t const nonce uint64_t const nonce
@ -265,14 +263,14 @@ static inline void ethash_params_init(ethash_params* params, uint32_t const bloc
void ethash_mkcache(ethash_cache_t* cache, ethash_params const* params, ethash_h256_t const* seed); void ethash_mkcache(ethash_cache_t* cache, ethash_params const* params, ethash_h256_t const* seed);
void ethash_full( void ethash_full(
ethash_return_value* ret, ethash_return_value_t* ret,
void const* full_mem, void const* full_mem,
ethash_params const* params, ethash_params const* params,
ethash_h256_t const* header_hash, ethash_h256_t const* header_hash,
uint64_t const nonce uint64_t const nonce
); );
void ethash_light( void ethash_light(
ethash_return_value* ret, ethash_return_value_t* ret,
ethash_cache_t const* cache, ethash_cache_t const* cache,
ethash_params const* params, ethash_params const* params,
ethash_h256_t const* header_hash, ethash_h256_t const* header_hash,

10
internal.c

@ -189,7 +189,7 @@ bool ethash_compute_full_data(void* mem, uint64_t full_size, ethash_cache_t cons
} }
static bool ethash_hash( static bool ethash_hash(
ethash_return_value* ret, ethash_return_value_t* ret,
node const* full_nodes, node const* full_nodes,
ethash_cache_t const* cache, ethash_cache_t const* cache,
uint64_t full_size, uint64_t full_size,
@ -343,7 +343,7 @@ void ethash_light_delete(ethash_light_t light)
} }
bool ethash_light_compute( bool ethash_light_compute(
ethash_return_value* ret, ethash_return_value_t* ret,
ethash_light_t light, ethash_light_t light,
uint64_t full_size, uint64_t full_size,
const ethash_h256_t* header_hash, const ethash_h256_t* header_hash,
@ -445,7 +445,7 @@ void ethash_full_delete(ethash_full_t full)
} }
bool ethash_full_compute( bool ethash_full_compute(
ethash_return_value* ret, ethash_return_value_t* ret,
ethash_full_t full, ethash_full_t full,
ethash_h256_t const* header_hash, ethash_h256_t const* header_hash,
uint64_t const nonce uint64_t const nonce
@ -486,7 +486,7 @@ void ethash_mkcache(
} }
void ethash_full( void ethash_full(
ethash_return_value* ret, ethash_return_value_t* ret,
void const* full_mem, void const* full_mem,
ethash_params const* params, ethash_params const* params,
ethash_h256_t const* header_hash, ethash_h256_t const* header_hash,
@ -496,7 +496,7 @@ void ethash_full(
ethash_hash(ret, (node const *) full_mem, NULL, params->full_size, header_hash, nonce, NULL); ethash_hash(ret, (node const *) full_mem, NULL, params->full_size, header_hash, nonce, NULL);
} }
void ethash_light( void ethash_light(
ethash_return_value* ret, ethash_return_value_t* ret,
ethash_cache_t const* cache, ethash_cache_t const* cache,
ethash_params const* params, ethash_params const* params,
ethash_h256_t const* header_hash, ethash_h256_t const* header_hash,

Loading…
Cancel
Save