# HG changeset patch # User Sebastien Jodogne # Date 1502466823 -7200 # Node ID 5ced32a226b1946fdb9cf832373107ae0ae7aa27 # Parent cdc12000160c77940617eb9a6ea26c2891fbb618 cppcheck, and fix issue 62 diff -r cdc12000160c -r 5ced32a226b1 Core/PostgreSQLException.h --- a/Core/PostgreSQLException.h Fri Jan 06 11:03:20 2017 +0100 +++ b/Core/PostgreSQLException.h Fri Aug 11 17:53:43 2017 +0200 @@ -34,7 +34,7 @@ { } - PostgreSQLException(const std::string& message) : + explicit PostgreSQLException(const std::string& message) : std::runtime_error("Error in PostgreSQL: " + message) { } diff -r cdc12000160c -r 5ced32a226b1 Core/PostgreSQLLargeObject.cpp --- a/Core/PostgreSQLLargeObject.cpp Fri Jan 06 11:03:20 2017 +0100 +++ b/Core/PostgreSQLLargeObject.cpp Fri Aug 11 17:53:43 2017 +0200 @@ -151,14 +151,14 @@ for (size_t position = 0; position < size_; ) { size_t remaining = size_ - position; - size_t nbytes = lo_read(pg_, fd_, target + position, remaining); + int nbytes = lo_read(pg_, fd_, target + position, remaining); if (nbytes < 0) { throw PostgreSQLException("Unable to read the large object in the database"); } - position += nbytes; + position += static_cast(nbytes); } } }; diff -r cdc12000160c -r 5ced32a226b1 Core/PostgreSQLResult.h --- a/Core/PostgreSQLResult.h Fri Jan 06 11:03:20 2017 +0100 +++ b/Core/PostgreSQLResult.h Fri Aug 11 17:53:43 2017 +0200 @@ -39,7 +39,7 @@ void CheckColumn(unsigned int column, /*Oid*/ unsigned int expectedType) const; public: - PostgreSQLResult(PostgreSQLStatement& statement); + explicit PostgreSQLResult(PostgreSQLStatement& statement); ~PostgreSQLResult() { diff -r cdc12000160c -r 5ced32a226b1 NEWS --- a/NEWS Fri Jan 06 11:03:20 2017 +0100 +++ b/NEWS Fri Aug 11 17:53:43 2017 +0200 @@ -3,6 +3,7 @@ * Upgrade to PostgreSQL 9.6.1 client library for static builds * Performance warning if runtime debug assertions are turned on +* Fix issue 62 (use correct type for lo_read() value) Release 2.0 (2015/12/02) diff -r cdc12000160c -r 5ced32a226b1 UnitTestsSources/PostgreSQLWrapperTests.cpp --- a/UnitTestsSources/PostgreSQLWrapperTests.cpp Fri Jan 06 11:03:20 2017 +0100 +++ b/UnitTestsSources/PostgreSQLWrapperTests.cpp Fri Aug 11 17:53:43 2017 +0200 @@ -74,7 +74,7 @@ static void CheckDicomTag(const OrthancPluginDicomTag& tag) { for (std::list::const_iterator - it = expectedDicomTags.begin(); it != expectedDicomTags.end(); it++) + it = expectedDicomTags.begin(); it != expectedDicomTags.end(); ++it) { if (it->group == tag.group && it->element == tag.element &&