Fix unsigned-signed comparison mismatch.

This commit is contained in:
John Ralls 2016-10-28 12:56:13 -07:00
parent afb57d0e7b
commit 70c803d6aa
4 changed files with 6 additions and 5 deletions

View File

@ -89,7 +89,7 @@ public:
GncSqlBackend(conn, book, format), m_exists{false} {} GncSqlBackend(conn, book, format), m_exists{false} {}
bool connected() const noexcept { return m_conn != nullptr; } bool connected() const noexcept { return m_conn != nullptr; }
/** FIXME: Just a pass-through to m_conn: */ /** FIXME: Just a pass-through to m_conn: */
void set_error(int error, int repeat, bool retry) noexcept void set_error(int error, unsigned int repeat, bool retry) noexcept
{ {
m_conn->set_error(error, repeat, retry); m_conn->set_error(error, repeat, retry);
} }

View File

@ -58,7 +58,8 @@ public:
return dbi_conn_error(m_conn, nullptr); } return dbi_conn_error(m_conn, nullptr); }
QofBackend* qbe () const noexcept { return m_qbe; } QofBackend* qbe () const noexcept { return m_qbe; }
dbi_conn conn() const noexcept { return m_conn; } dbi_conn conn() const noexcept { return m_conn; }
inline void set_error(int error, int repeat, bool retry) noexcept override inline void set_error(int error, unsigned int repeat,
bool retry) noexcept override
{ {
m_last_error = error; m_last_error = error;
m_error_repeat = repeat; m_error_repeat = repeat;
@ -96,7 +97,7 @@ private:
* the original call is allowed. error_repeat tracks the number of attempts * the original call is allowed. error_repeat tracks the number of attempts
* and can be used to prevent infinite loops. * and can be used to prevent infinite loops.
*/ */
int m_error_repeat; unsigned int m_error_repeat;
/** Signals the calling function that it should retry (the error handler /** Signals the calling function that it should retry (the error handler
* detected transient error and managed to resolve it, but it can't run the * detected transient error and managed to resolve it, but it can't run the
* original query) * original query)

View File

@ -313,7 +313,7 @@ public:
* If not 0 will normally be meaningless outside of implementation code. * If not 0 will normally be meaningless outside of implementation code.
*/ */
virtual int dberror() const noexcept = 0; virtual int dberror() const noexcept = 0;
virtual void set_error(int error, int repeat, bool retry) noexcept = 0; virtual void set_error(int error, unsigned int repeat, bool retry) noexcept = 0;
virtual bool verify() noexcept = 0; virtual bool verify() noexcept = 0;
virtual bool retry_connection(const char* msg) noexcept = 0; virtual bool retry_connection(const char* msg) noexcept = 0;

View File

@ -105,7 +105,7 @@ public:
virtual std::string quote_string (const std::string& str) virtual std::string quote_string (const std::string& str)
const noexcept override { return std::string{str}; } const noexcept override { return std::string{str}; }
int dberror() const noexcept override { return 0; } int dberror() const noexcept override { return 0; }
void set_error(int error, int repeat, bool retry) noexcept override { return; } void set_error(int error, unsigned int repeat, bool retry) noexcept override { return; }
bool verify() noexcept override { return true; } bool verify() noexcept override { return true; }
bool retry_connection(const char* msg) noexcept override { return true; } bool retry_connection(const char* msg) noexcept override { return true; }
private: private: