summaryrefslogtreecommitdiff
path: root/libpqpp/pq-modifycommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libpqpp/pq-modifycommand.cpp')
-rw-r--r--libpqpp/pq-modifycommand.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libpqpp/pq-modifycommand.cpp b/libpqpp/pq-modifycommand.cpp
index 4c25a7e..8697b10 100644
--- a/libpqpp/pq-modifycommand.cpp
+++ b/libpqpp/pq-modifycommand.cpp
@@ -11,13 +11,13 @@ PQ::ModifyCommand::ModifyCommand(Connection * conn, const std::string & sql, con
unsigned int
PQ::ModifyCommand::execute(bool anc)
{
- PGresult * res
- = PQexecPrepared(c->conn, prepare(), values.size(), &values.front(), &lengths.front(), &formats.front(), 0);
+ PGresult * res = PQexecPrepared(c->conn, prepare(), static_cast<int>(values.size()), &values.front(),
+ &lengths.front(), &formats.front(), 0);
c->checkResult(res, PGRES_COMMAND_OK, PGRES_TUPLES_OK);
- unsigned int rows = atoi(PQcmdTuples(res));
+ auto rows = atoi(PQcmdTuples(res));
PQclear(res);
if (rows == 0 && !anc) {
throw DB::NoRowsAffected();
}
- return rows;
+ return static_cast<unsigned int>(rows);
}