Skip to content

Commit

Permalink
Fix broken const correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
tamasmeszaros committed Oct 23, 2023
1 parent d485f7d commit f4413b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/LibBGCode/binarize/binarize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ EResult ThumbnailBlock::write(FILE& file, EChecksumType checksum_type)
return EResult::InvalidThumbnailDataSize;

// write block header
const BlockHeader block_header((uint16_t)EBlockType::Thumbnail, (uint16_t)ECompressionType::None, (uint32_t)data.size());
BlockHeader block_header((uint16_t)EBlockType::Thumbnail, (uint16_t)ECompressionType::None, (uint32_t)data.size());
EResult res = block_header.write(file);
if (res != EResult::Success)
// propagate error
Expand Down
2 changes: 1 addition & 1 deletion src/LibBGCode/core/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ long BlockHeader::get_position() const
return m_position;
}

EResult BlockHeader::write(FILE& file) const
EResult BlockHeader::write(FILE& file)
{
m_position = ftell(&file);
if (!write_to_file(file, &type, sizeof(type)))
Expand Down
4 changes: 2 additions & 2 deletions src/LibBGCode/core/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,14 @@ struct BlockHeader
// Position is set by calling write() and read() methods.
long get_position() const;

EResult write(FILE& file) const;
EResult write(FILE& file);
EResult read(FILE& file);

// Returs the size of this BlockHeader, in bytes
size_t get_size() const;

private:
mutable long m_position{ 0 };
long m_position{ 0 };
};

struct ThumbnailParams
Expand Down

0 comments on commit f4413b3

Please sign in to comment.