diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2014-07-24 10:57:14 -0230 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2014-07-24 10:57:14 -0230 |
commit | cd14da9dfca3b56f59a677d6d87161e27e19a324 (patch) | |
tree | c81ede729bd41033c56090ce9a3c885314657c2e /cpp/src/IceWS/Util.cpp | |
parent | Fixed potential ACM test failure (diff) | |
download | ice-cd14da9dfca3b56f59a677d6d87161e27e19a324.tar.bz2 ice-cd14da9dfca3b56f59a677d6d87161e27e19a324.tar.xz ice-cd14da9dfca3b56f59a677d6d87161e27e19a324.zip |
Fixed WinRT build
Diffstat (limited to 'cpp/src/IceWS/Util.cpp')
-rw-r--r-- | cpp/src/IceWS/Util.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cpp/src/IceWS/Util.cpp b/cpp/src/IceWS/Util.cpp index b4ee81fc485..5c2ac3df08a 100644 --- a/cpp/src/IceWS/Util.cpp +++ b/cpp/src/IceWS/Util.cpp @@ -31,14 +31,16 @@ IceWS::calcSHA1(const vector<unsigned char>& data) ::SHA1(&data[0], static_cast<unsigned long>(data.size()), &hash[0]); return hash; #else - auto dataA = ref new Platform::Array<unsigned char>(const_cast<unsigned char*>(&data[0]), data.size()); + auto dataA = ref new Platform::Array<unsigned char>(const_cast<unsigned char*>(&data[0]), + static_cast<unsigned int>(data.size())); auto hasher = Windows::Security::Cryptography::Core::HashAlgorithmProvider::OpenAlgorithm("SHA1"); auto hashed = hasher->HashData(Windows::Security::Cryptography::CryptographicBuffer::CreateFromByteArray(dataA)); auto reader = ::Windows::Storage::Streams::DataReader::FromBuffer(hashed); std::vector<unsigned char> result(reader->UnconsumedBufferLength); if(!result.empty()) { - reader->ReadBytes(::Platform::ArrayReference<unsigned char>(&result[0], result.size())); + reader->ReadBytes(::Platform::ArrayReference<unsigned char>(&result[0], + static_cast<unsigned int>(result.size()))); } return result; #endif |