From 90fe9cdc62ab372bcee7f3f6a7cedcd63f2e036a Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 31 Mar 2015 15:16:26 +0200 Subject: [PATCH] various fixes in the code for the msvc build to work --- io.c | 6 +++--- io.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/io.c b/io.c index dd4f1f9e8..5a8eebae5 100644 --- a/io.c +++ b/io.c @@ -57,17 +57,17 @@ bool ethash_io_write(char const *dirname, ethash_blockhash_t seedhash, void const* cache, uint8_t **data, - size_t *data_size) + uint64_t *data_size) { char info_buffer[DAG_MEMO_BYTESIZE]; // allocate the bytes - uint8_t *temp_data_ptr = malloc(params->full_size); + uint8_t *temp_data_ptr = malloc((size_t)params->full_size); if (!temp_data_ptr) { goto end; } ethash_compute_full_data(temp_data_ptr, params, cache); - if (!ethash_io_write_file(dirname, PASS_ARR(DAG_FILE_NAME), temp_data_ptr, params->full_size)) { + if (!ethash_io_write_file(dirname, PASS_ARR(DAG_FILE_NAME), temp_data_ptr, (size_t)params->full_size)) { goto fail_free; } diff --git a/io.h b/io.h index 0fa292362..dd611754d 100644 --- a/io.h +++ b/io.h @@ -73,7 +73,7 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_blockhash_t seed * data calculated by @see ethash_prep_full(). Memory * ownership is transfered to the callee. Remember that * you eventually need to free this with a call to free(). - * @param[out] data_size Pass a size_t by value. If the function is succesfull + * @param[out] data_size Pass a uint64_t by value. If the function is succesfull * then this will contain the number of bytes allocated * for @a data. * @return True for success and false in case of failure. @@ -83,7 +83,7 @@ bool ethash_io_write(char const *dirname, ethash_blockhash_t seedhash, void const* cache, uint8_t **data, - size_t *data_size); + uint64_t *data_size); static inline void ethash_io_serialize_info(uint32_t revision, ethash_blockhash_t seed_hash,