Skip to content

Commit

Permalink
OrcLib: ArchiveCreate: add missing 'const' method qualifier
Browse files Browse the repository at this point in the history
  • Loading branch information
jgautier-anssi authored and fabienfl-orc committed Jun 4, 2024
1 parent bc10abc commit b63499a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/OrcLib/ArchiveCreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@ ArchiveCreate::ArchiveCreate(bool bComputeHash)

ArchiveCreate::~ArchiveCreate(void) {}

std::shared_ptr<ByteStream> ArchiveCreate::GetStreamToAdd(const std::shared_ptr<ByteStream>& astream)
std::shared_ptr<ByteStream> ArchiveCreate::GetStreamToAdd(const std::shared_ptr<ByteStream>& 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<CryptoHashStream>();
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;
Expand Down
2 changes: 1 addition & 1 deletion src/OrcLib/ArchiveCreate.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ArchiveCreate : public OrcArchive
ArchiveFormat m_Format;
ArchiveItems m_Queue;

std::shared_ptr<ByteStream> GetStreamToAdd(const std::shared_ptr<ByteStream>& astream);
std::shared_ptr<ByteStream> GetStreamToAdd(const std::shared_ptr<ByteStream>& astream) const;

ArchiveCreate(bool bComputeHash);

Expand Down

0 comments on commit b63499a

Please sign in to comment.