clang-tidy: make several member functions const

Found with readability-make-member-function-const

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2021-04-27 00:04:29 -07:00
committed by Luis Díaz Más
parent b789c3414f
commit 4aa5566cf6
6 changed files with 35 additions and 17 deletions
+2 -2
View File
@@ -82,7 +82,7 @@ namespace {
//! Read the timestamp from a broken-down time in buffer \em tm.
int read(struct tm* tm);
//! Set the timestamp of a file
int touch(const std::string& path);
int touch(const std::string& path) const;
private:
time_t actime_{0};
@@ -1790,7 +1790,7 @@ namespace {
return rc;
}
int Timestamp::touch(const std::string& path)
int Timestamp::touch(const std::string& path) const
{
if (0 == actime_) return 1;
struct utimbuf buf;
+1 -1
View File
@@ -233,7 +233,7 @@ INIReader::INIReader(const std::string &filename)
_error = ini_parse(filename.c_str(), ValueHandler, this);
}
int INIReader::ParseError()
int INIReader::ParseError() const
{
return _error;
}
+2 -2
View File
@@ -263,7 +263,7 @@ namespace Exiv2 {
return b;
} // PgfImage::readPgfMagicNumber
uint32_t PgfImage::readPgfHeaderSize(BasicIo& iIo)
uint32_t PgfImage::readPgfHeaderSize(BasicIo& iIo) const
{
DataBuf buffer(4);
long bufRead = iIo.read(buffer.pData_, buffer.size_);
@@ -280,7 +280,7 @@ namespace Exiv2 {
return headerSize;
} // PgfImage::readPgfHeaderSize
DataBuf PgfImage::readPgfHeaderStructure(BasicIo& iIo, int& width, int& height)
DataBuf PgfImage::readPgfHeaderStructure(BasicIo& iIo, int& width, int& height) const
{
DataBuf header(16);
long bufRead = iIo.read(header.pData_, header.size_);