Fix compile under Clang

padlkrng.cpp:45:34: error: no matching function for call to 'STDMIN'
                const size_t rem = STDMIN(ret, STDMIN(size, 16U));
                                               ^~~~~~
./misc.h:516:36: note: candidate template ignored: deduced conflicting types for parameter 'T' ('unsigned long' vs. 'unsigned int')
template <class T> inline const T& STDMIN(const T& a, const T& b)
                                   ^
1 error generated.
pull/462/head
Jeffrey Walton 2017-08-20 07:09:10 -04:00
parent 88f08afcb0
commit 40d0710d43
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ void PadlockRNG::GenerateBlock(byte *output, size_t size)
);
const size_t ret = m_msr & 0x1f;
const size_t rem = STDMIN(ret, STDMIN(size, 16U));
const size_t rem = STDMIN<size_t>(ret, STDMIN<size_t>(size, 16U));
std::memcpy(output, m_buffer, rem);
size -= rem; output += rem;
}
@ -61,7 +61,7 @@ void PadlockRNG::GenerateBlock(byte *output, size_t size)
}
const size_t ret = (m_msr = result) & 0x1f;
const size_t rem = STDMIN(ret, STDMIN(size, 16U));
const size_t rem = STDMIN<size_t>(ret, STDMIN<size_t>(size, 16U));
std::memcpy(output, buffer, rem);
size -= rem; output += rem;
}