From bcf79c78c5d8e43aa627c86e3d023d663b1c1343 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Wed, 24 Aug 2016 05:39:31 +0100 Subject: [PATCH] Change some asserts in equihash.cpp to be static. Signed-off-by: Daira Hopwood --- src/crypto/equihash.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/crypto/equihash.cpp b/src/crypto/equihash.cpp index 523f18c45..f17bce04d 100644 --- a/src/crypto/equihash.cpp +++ b/src/crypto/equihash.cpp @@ -136,7 +136,7 @@ void CompressArray(const unsigned char* in, size_t in_len, // comparison void EhIndexToArray(const eh_index i, unsigned char* array) { - assert(sizeof(eh_index) == 4); + BOOST_STATIC_ASSERT(sizeof(eh_index) == 4); eh_index bei = htobe32(i); memcpy(array, &bei, sizeof(eh_index)); } @@ -145,7 +145,7 @@ void EhIndexToArray(const eh_index i, unsigned char* array) // comparison eh_index ArrayToEhIndex(const unsigned char* array) { - assert(sizeof(eh_index) == 4); + BOOST_STATIC_ASSERT(sizeof(eh_index) == 4); eh_index bei; memcpy(&bei, array, sizeof(eh_index)); return be32toh(bei); @@ -154,7 +154,7 @@ eh_index ArrayToEhIndex(const unsigned char* array) eh_trunc TruncateIndex(const eh_index i, const unsigned int ilen) { // Truncate to 8 bits - assert(sizeof(eh_trunc) == 1); + BOOST_STATIC_ASSERT(sizeof(eh_trunc) == 1); return (i >> (ilen - 8)) & 0xff; } @@ -208,7 +208,7 @@ StepRow::StepRow(const unsigned char* hashIn, size_t hInLen, template template StepRow::StepRow(const StepRow& a) { - assert(W <= WIDTH); + BOOST_STATIC_ASSERT(W <= WIDTH); std::copy(a.hash, a.hash+W, hash); }