summaryrefslogtreecommitdiff
path: root/libodbcpp/selectcommand.cpp
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2012-07-09 18:26:22 +0000
committerrandomdan <randomdan@localhost>2012-07-09 18:26:22 +0000
commitee7c2dda51d1db37ecc45a33c1bf50ae50437ae4 (patch)
tree277a063ebd26c514460248f4a3831bf58e149758 /libodbcpp/selectcommand.cpp
parentFix printf warnings on 64bit (diff)
downloadlibdbpp-odbc-ee7c2dda51d1db37ecc45a33c1bf50ae50437ae4.tar.bz2
libdbpp-odbc-ee7c2dda51d1db37ecc45a33c1bf50ae50437ae4.tar.xz
libdbpp-odbc-ee7c2dda51d1db37ecc45a33c1bf50ae50437ae4.zip
Fixes suggested by cppcheck
Diffstat (limited to 'libodbcpp/selectcommand.cpp')
-rw-r--r--libodbcpp/selectcommand.cpp12
1 files changed, 6 insertions, 6 deletions
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;
}