]> Git Repo - VerusCoin.git/commitdiff
Change some asserts in equihash.cpp to be static.
authorDaira Hopwood <[email protected]>
Wed, 24 Aug 2016 04:39:31 +0000 (05:39 +0100)
committerDaira Hopwood <[email protected]>
Wed, 24 Aug 2016 05:13:13 +0000 (06:13 +0100)
Signed-off-by: Daira Hopwood <[email protected]>
src/crypto/equihash.cpp

index 523f18c45fe1be2331c9539fcf20ae49ec3c75b9..f17bce04d8a8f297159ef1be1bde5d7ed5d840b4 100644 (file)
@@ -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<WIDTH>::StepRow(const unsigned char* hashIn, size_t hInLen,
 template<size_t WIDTH> template<size_t W>
 StepRow<WIDTH>::StepRow(const StepRow<W>& a)
 {
-    assert(W <= WIDTH);
+    BOOST_STATIC_ASSERT(W <= WIDTH);
     std::copy(a.hash, a.hash+W, hash);
 }
 
This page took 0.032998 seconds and 4 git commands to generate.