From ee7c2dda51d1db37ecc45a33c1bf50ae50437ae4 Mon Sep 17 00:00:00 2001 From: randomdan Date: Mon, 9 Jul 2012 18:26:22 +0000 Subject: Fixes suggested by cppcheck --- libodbcpp/command.cpp | 2 +- libodbcpp/selectcommand.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'libodbcpp') diff --git a/libodbcpp/command.cpp b/libodbcpp/command.cpp index 0e100c0..801060f 100644 --- a/libodbcpp/command.cpp +++ b/libodbcpp/command.cpp @@ -31,7 +31,7 @@ ODBC::Command::Command(const Connection & c, const std::string & s) : ODBC::Command::~Command() { - for (Params::iterator i = params.begin(); i != params.end(); i++) { + for (Params::iterator i = params.begin(); i != params.end(); ++i) { if (*i) { delete *i; } diff --git a/libodbcpp/selectcommand.cpp b/libodbcpp/selectcommand.cpp index f44472f..5f87a5a 100644 --- a/libodbcpp/selectcommand.cpp +++ b/libodbcpp/selectcommand.cpp @@ -14,7 +14,7 @@ ODBC::SelectCommand::SelectCommand(const Connection & c, const std::string & s) ODBC::SelectCommand::~SelectCommand() { - for (Columns::iterator i = columns.begin(); i != columns.end(); i++) { + for (Columns::iterator i = columns.begin(); i != columns.end(); ++i) { if (*i) { delete *i; } @@ -36,7 +36,7 @@ ODBC::SelectCommand::fetch() bool ODBC::SelectCommand::fetch(SQLSMALLINT orientation, SQLLEN offset) { - if (columns.size() == 0) { + if (columns.empty()) { execute(); } RETCODE rc = SQLFetchScroll(hStmt, orientation, offset); @@ -48,7 +48,7 @@ ODBC::SelectCommand::fetch(SQLSMALLINT orientation, SQLLEN offset) RETCODE diagrc = SQLGetDiagRec(SQL_HANDLE_STMT, hStmt, 1, sqlstatus, NULL, NULL, 0, NULL); if (SQL_SUCCEEDED(diagrc)) { if (!strncmp((const char*)sqlstatus, "01004", 5)) { - for (Columns::iterator i = columns.begin(); i != columns.end(); i++) { + for (Columns::iterator i = columns.begin(); i != columns.end(); ++i) { (*i)->resize(); } return fetch(SQL_FETCH_RELATIVE, 0); @@ -61,7 +61,7 @@ ODBC::SelectCommand::fetch(SQLSMALLINT orientation, SQLLEN offset) case SQL_SUCCESS: { bool resized = false; - for (Columns::iterator i = columns.begin(); i != columns.end(); i++) { + for (Columns::iterator i = columns.begin(); i != columns.end(); ++i) { resized |= (*i)->resize(); } if (resized) { @@ -141,7 +141,7 @@ ODBC::SelectCommand::operator[](unsigned int col) const const DB::Column& ODBC::SelectCommand::operator[](const Glib::ustring & colName) const { - for (Columns::const_iterator col = columns.begin(); col != columns.end(); col++) { + for (Columns::const_iterator col = columns.begin(); col != columns.end(); ++col) { if ((*col)->name == colName) { return **col; } @@ -153,7 +153,7 @@ unsigned int ODBC::SelectCommand::getOrdinal(const Glib::ustring & colName) const { unsigned int n = 0; - for (Columns::const_iterator col = columns.begin(); col != columns.end(); col++) { + for (Columns::const_iterator col = columns.begin(); col != columns.end(); ++col) { if ((*col)->name == colName) { return n; } -- cgit v1.2.3