From 1d61aece0e023e4c41cf24547fa1ac2f8028219d Mon Sep 17 00:00:00 2001 From: Nathanne Isip Date: Sat, 30 Nov 2024 09:07:54 +0800 Subject: [PATCH] Fixed type static conversion errors. --- src/quickdigest5.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/quickdigest5.cpp b/src/quickdigest5.cpp index f8a3eb7..5e1904e 100644 --- a/src/quickdigest5.cpp +++ b/src/quickdigest5.cpp @@ -190,11 +190,11 @@ std::vector QuickDigest5::digestFile(const std::string& filepath) { std::vector buffer(4096); while(file) { - file.read(reinterpret_cast(buffer.data()), (size_t) buffer.size()); + file.read(reinterpret_cast(buffer.data()), (std::streamsize) buffer.size()); std::streamsize bytesRead = file.gcount(); if(bytesRead > 0) - QuickDigest5.update(buffer.data(), bytesRead); + QuickDigest5.update(buffer.data(), (size_t) bytesRead); } QuickDigest5.finalize(); @@ -209,7 +209,7 @@ std::string QuickDigest5::toHash(const std::string& input) { ss << std::hex << std::setw(2) << std::setfill('0') - << (int) digest[i]; + << (int) digest[(size_t) i]; return ss.str(); } @@ -222,7 +222,7 @@ std::string QuickDigest5::fileToHash(const std::string& filepath) { ss << std::hex << std::setw(2) << std::setfill('0') - << (int) digest[i]; + << (int) digest[(size_t) i]; return ss.str(); }