fix warning in gcrypt usage

This commit is contained in:
arvidn 2019-02-12 12:04:04 +01:00 committed by Arvid Norberg
parent 69cff71cb6
commit 9e376cae9f
2 changed files with 4 additions and 4 deletions

View File

@ -94,9 +94,9 @@ namespace libtorrent {
hasher& hasher::update(span<char const> data)
{
TORRENT_ASSERT(!data.empty());
TORRENT_ASSERT(data.size() > 0);
#ifdef TORRENT_USE_LIBGCRYPT
gcry_md_write(m_context, data.data(), data.size());
gcry_md_write(m_context, data.data(), static_cast<std::size_t>(data.size()));
#elif TORRENT_USE_COMMONCRYPTO
CC_SHA1_Update(&m_context, reinterpret_cast<unsigned char const*>(data.data()), CC_LONG(data.size()));
#elif TORRENT_USE_CRYPTOAPI

View File

@ -82,9 +82,9 @@ namespace libtorrent {
hasher512& hasher512::update(span<char const> data)
{
TORRENT_ASSERT(!data.empty());
TORRENT_ASSERT(data.size() > 0);
#ifdef TORRENT_USE_LIBGCRYPT
gcry_md_write(m_context, data.data(), data.size());
gcry_md_write(m_context, data.data(), static_cast<std::size_t>(data.size()));
#elif TORRENT_USE_COMMONCRYPTO
CC_SHA512_Update(&m_context, reinterpret_cast<unsigned char const*>(data.data()), CC_LONG(data.size()));
#elif TORRENT_USE_CRYPTOAPI_SHA_512