summaryrefslogtreecommitdiff
path: root/padlkrng.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2017-08-20 07:09:10 -0400
committerJeffrey Walton <noloader@gmail.com>2017-08-20 07:09:10 -0400
commit40d0710d43bbd134b695b44c73d05e208344f0fe (patch)
treefb3002836f05dc46e9bbb0705b846a07e19083bf /padlkrng.cpp
parent88f08afcb0451f32e3db8e8e4929e046584b6ea4 (diff)
downloadcryptopp-git-40d0710d43bbd134b695b44c73d05e208344f0fe.tar.gz
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.
Diffstat (limited to 'padlkrng.cpp')
-rw-r--r--padlkrng.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/padlkrng.cpp b/padlkrng.cpp
index d4b494da..5e4de194 100644
--- a/padlkrng.cpp
+++ b/padlkrng.cpp
@@ -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;
}