diff --git a/eth/main.cpp b/eth/main.cpp index 461494cef..db6acbbca 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -364,7 +364,7 @@ int main(int argc, char** argv) { coinbase = h160(fromHex(argv[++i], WhenError::Throw)); } - catch (BadHexCharacter& _e) + catch (BadHexCharacter&) { cerr << "Bad hex in " << arg << " option: " << argv[i] << endl; return -1; diff --git a/libdevcore/CommonData.h b/libdevcore/CommonData.h index 38ccd71f0..93bad71a3 100644 --- a/libdevcore/CommonData.h +++ b/libdevcore/CommonData.h @@ -116,9 +116,9 @@ inline void toBigEndian(_T _val, _Out& o_out) template inline _T fromBigEndian(_In const& _bytes) { - _T ret = 0; + _T ret = (_T)0; for (auto i: _bytes) - ret = (ret << 8) | (byte)(typename std::make_unsigned::type)i; + ret = (_T)((ret << 8) | (byte)(typename std::make_unsigned::type)i); return ret; } diff --git a/libethash/ethash.h b/libethash/ethash.h index 7594fc835..bc62a29cc 100644 --- a/libethash/ethash.h +++ b/libethash/ethash.h @@ -85,7 +85,7 @@ typedef uint8_t const ethash_seedhash_t[32]; typedef void const* ethash_light_t; static inline ethash_light_t ethash_new_light(ethash_params const* params, ethash_seedhash_t seed) { - void* ret = malloc(params->cache_size); + void* ret = malloc((size_t)params->cache_size); ethash_mkcache(ret, params, seed); return ret; } @@ -98,7 +98,7 @@ static inline void ethash_delete_light(ethash_light_t light) { typedef void const* ethash_full_t; static inline ethash_full_t ethash_new_full(ethash_params const* params, ethash_light_t light) { - void* ret = malloc(params->full_size); + void* ret = malloc((size_t)params->full_size); ethash_compute_full_data(ret, params, light); return ret; } diff --git a/libethash/io.c b/libethash/io.c index 0e935fa59..07387caaf 100644 --- a/libethash/io.c +++ b/libethash/io.c @@ -61,13 +61,13 @@ bool ethash_io_write(char const *dirname, { 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; } @@ -77,7 +77,7 @@ bool ethash_io_write(char const *dirname, } *data = temp_data_ptr; - *data_size = params->full_size; + *data_size = (size_t)params->full_size; return true; fail_free: diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 3dd9d3b60..a777205e9 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -48,7 +48,7 @@ namespace dev namespace eth { -const Ethash::WorkPackage Ethash::NullWorkPackage; +const Ethash::WorkPackage Ethash::NullWorkPackage = Ethash::WorkPackage(); std::string Ethash::name() { @@ -81,7 +81,7 @@ bool Ethash::preVerify(BlockInfo const& _header) h256 boundary = u256((bigint(1) << 256) / _header.difficulty); - return ethash_quick_check_difficulty( + return !!ethash_quick_check_difficulty( _header.headerHash(WithoutNonce).data(), (uint64_t)(u64)_header.nonce, _header.mixHash.data(), diff --git a/mix/ContractCallDataEncoder.cpp b/mix/ContractCallDataEncoder.cpp index 56aeb1d34..e1f02f631 100644 --- a/mix/ContractCallDataEncoder.cpp +++ b/mix/ContractCallDataEncoder.cpp @@ -118,7 +118,7 @@ unsigned ContractCallDataEncoder::encodeSingleItem(QString const& _data, Solidit result = bytes(alignSize); toBigEndian((u256)i, result); } - catch (std::exception const& ex) + catch (std::exception const&) { // manage input as a string. QByteArray bytesAr = src.toLocal8Bit();