From b63499a8296f260b7028537fd85cce038df32a74 Mon Sep 17 00:00:00 2001 From: Jean Gautier Date: Thu, 7 Dec 2023 18:02:16 +0100 Subject: [PATCH] OrcLib: ArchiveCreate: add missing 'const' method qualifier --- src/OrcLib/ArchiveCreate.cpp | 12 ++++++------ src/OrcLib/ArchiveCreate.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/OrcLib/ArchiveCreate.cpp b/src/OrcLib/ArchiveCreate.cpp index b40c5b3a..0e1d1720 100644 --- a/src/OrcLib/ArchiveCreate.cpp +++ b/src/OrcLib/ArchiveCreate.cpp @@ -47,23 +47,23 @@ ArchiveCreate::ArchiveCreate(bool bComputeHash) ArchiveCreate::~ArchiveCreate(void) {} -std::shared_ptr ArchiveCreate::GetStreamToAdd(const std::shared_ptr& astream) +std::shared_ptr ArchiveCreate::GetStreamToAdd(const std::shared_ptr& stream) const { HRESULT hr = E_FAIL; - if (astream == nullptr) + if (stream == nullptr) return nullptr; - // Move back to the begining of the stream - astream->SetFilePointer(0LL, FILE_BEGIN, nullptr); + // Move back to the beginning of the stream + stream->SetFilePointer(0LL, FILE_BEGIN, nullptr); if (!m_bComputeHash) { - return astream; + return stream; } auto pHashStream = make_shared(); - hr = pHashStream->OpenToRead(CryptoHashStream::Algorithm::MD5 | CryptoHashStream::Algorithm::SHA1, astream); + hr = pHashStream->OpenToRead(CryptoHashStream::Algorithm::MD5 | CryptoHashStream::Algorithm::SHA1, stream); if (FAILED(hr)) { return nullptr; diff --git a/src/OrcLib/ArchiveCreate.h b/src/OrcLib/ArchiveCreate.h index 88a5fa48..d83a34c6 100644 --- a/src/OrcLib/ArchiveCreate.h +++ b/src/OrcLib/ArchiveCreate.h @@ -31,7 +31,7 @@ class ArchiveCreate : public OrcArchive ArchiveFormat m_Format; ArchiveItems m_Queue; - std::shared_ptr GetStreamToAdd(const std::shared_ptr& astream); + std::shared_ptr GetStreamToAdd(const std::shared_ptr& astream) const; ArchiveCreate(bool bComputeHash);