summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-07-02 12:35:39 (GMT)
committerBrad King <brad.king@kitware.com>2013-07-02 12:35:39 (GMT)
commit04897c02cc8a083759a884bcc0e0eea82916470d (patch)
tree5d474c545c12256b342778a917eb09eed8643356
parentd9ece45a36af9c0640ee4fe0d4a1519dcd8f874d (diff)
parent75994d953e261b388aa31e4d8ecd8af9fe53142b (diff)
downloadCMake-04897c02cc8a083759a884bcc0e0eea82916470d.zip
CMake-04897c02cc8a083759a884bcc0e0eea82916470d.tar.gz
CMake-04897c02cc8a083759a884bcc0e0eea82916470d.tar.bz2
Merge branch 'sha2-alignment' into release
-rw-r--r--Source/cmCryptoHash.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx
index a1505bd..a4f6ac4 100644
--- a/Source/cmCryptoHash.cxx
+++ b/Source/cmCryptoHash.cxx
@@ -54,8 +54,8 @@ std::string cmCryptoHash::HashFile(const char* file)
this->Initialize();
// Should be efficient enough on most system:
- const int bufferSize = 4096;
- char buffer[bufferSize];
+ cm_sha2_uint64_t buffer[512];
+ char* buffer_c = reinterpret_cast<char*>(buffer);
unsigned char const* buffer_uc =
reinterpret_cast<unsigned char const*>(buffer);
// This copy loop is very sensitive on certain platforms with
@@ -65,7 +65,7 @@ std::string cmCryptoHash::HashFile(const char* file)
// error occurred. Therefore, the loop should be safe everywhere.
while(fin)
{
- fin.read(buffer, bufferSize);
+ fin.read(buffer_c, sizeof(buffer));
if(int gcount = static_cast<int>(fin.gcount()))
{
this->Append(buffer_uc, gcount);