From 29bed6c3faf2505115793a97a9bf9bc005883371 Mon Sep 17 00:00:00 2001 From: hogliux Date: Tue, 18 Oct 2016 10:37:08 +0100 Subject: [PATCH] Fixed warnings in cryptographic unit test code --- .../juce_cryptography/encryption/juce_BlowFish.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/juce_cryptography/encryption/juce_BlowFish.cpp b/modules/juce_cryptography/encryption/juce_BlowFish.cpp index 49b2ff7e75..f6044233c7 100644 --- a/modules/juce_cryptography/encryption/juce_BlowFish.cpp +++ b/modules/juce_cryptography/encryption/juce_BlowFish.cpp @@ -400,7 +400,7 @@ public: expectGreaterThan (encryptedSize, (int) size); expectLessOrEqual (encryptedSize, (int) bufferSize); - int decryptedSize = blowFish.decrypt (data, encryptedSize); + int decryptedSize = blowFish.decrypt (data, static_cast (encryptedSize)); expectEquals ((int) size, decryptedSize); expectEqualData (data, copy.getData(), size, "Length/Content changed during encryption"); @@ -418,7 +418,7 @@ public: void encryptDecryptTest (const BlowFish& blowFish, const String& data) { - MemoryBlock block (data.toRawUTF8(), data.length()); + MemoryBlock block (data.toRawUTF8(), static_cast (data.length())); encryptDecryptTest (blowFish, block); } @@ -429,8 +429,8 @@ public: for (int i = 0; i < 100; ++i) { - const int keySize = (random.nextInt(17) + 1) * sizeof (uint32); - MemoryBlock key (keySize); + const int keySize = (random.nextInt(17) + 1) * static_cast (sizeof (uint32)); + MemoryBlock key (static_cast (keySize)); fillMemoryBlockWithRandomData (key, random); BlowFish bf (key.getData(), keySize); @@ -441,7 +441,7 @@ public: const int minSize = 8 + sizeof (void*); const int dataSize = random.nextInt (2048 - minSize) + minSize; - MemoryBlock data (dataSize); + MemoryBlock data (static_cast (dataSize)); fillMemoryBlockWithRandomData (data, random); encryptDecryptTest (bf, data); @@ -450,7 +450,7 @@ public: // test unaligned data encryption/decryption - const uintptr_t nudge = random.nextInt (sizeof(void*) - 1); + const uintptr_t nudge = static_cast (random.nextInt (sizeof(void*) - 1)); void* unalignedData = (void*) (reinterpret_cast (data.getData()) + nudge); size_t newSize = data.getSize() - nudge;