From 090716ba4f7ac5220339512ccde15d16a241b158 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 12 Feb 2020 12:15:13 +0100 Subject: [PATCH] [libcalamares] Warnings-- in Entropy - reading a file yields a qint64 - need to mash the unsigned data from twister to signed char data. --- src/libcalamares/utils/Entropy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcalamares/utils/Entropy.cpp b/src/libcalamares/utils/Entropy.cpp index 643346855..ce1f6ba9d 100644 --- a/src/libcalamares/utils/Entropy.cpp +++ b/src/libcalamares/utils/Entropy.cpp @@ -35,7 +35,7 @@ CalamaresUtils::getEntropy( int size, QByteArray& b ) char* buffer = b.data(); std::fill( buffer, buffer + size, 0xcb ); - int readSize = 0; + qint64 readSize = 0; QFile urandom( "/dev/urandom" ); if ( urandom.exists() && urandom.open( QIODevice::ReadOnly ) ) { @@ -62,7 +62,7 @@ CalamaresUtils::getEntropy( int size, QByteArray& b ) #define GET_ONE_BYTE \ if ( readSize < size ) \ { \ - buffer[ readSize++ ] = next & 0xff; \ + buffer[ readSize++ ] = char( next & 0xffU ); \ next = next >> 8; \ } GET_ONE_BYTE