From 6c7222e071ffe7d20c138faac0da1d708e0a7779 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 29 Aug 2021 15:12:57 +0100 Subject: Add -Wold-style-cast --- lib/output/pq/pqStmt.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/output/pq/pqStmt.cpp') diff --git a/lib/output/pq/pqStmt.cpp b/lib/output/pq/pqStmt.cpp index c6399e4..bb7a79c 100644 --- a/lib/output/pq/pqStmt.cpp +++ b/lib/output/pq/pqStmt.cpp @@ -22,8 +22,8 @@ namespace MyGrate::Output::Pq { PqPrepStmt::execute(const std::span vs) { Bindings b {vs}; - res = {PQexecPrepared( - conn, name.c_str(), (int)vs.size(), b.values.data(), b.lengths.data(), b.formats.data(), 0), + res = {PQexecPrepared(conn, name.c_str(), static_cast(vs.size()), b.values.data(), b.lengths.data(), + b.formats.data(), 0), &PQclear}; verify(PQresultStatus(res.get()) == PGRES_COMMAND_OK || PQresultStatus(res.get()) == PGRES_TUPLES_OK, name, conn); @@ -54,7 +54,7 @@ namespace MyGrate::Output::Pq { return i->second; } auto nam {scprintf<"pst%0lx">(c->stmts.size())}; - ResPtr res {PQprepare(c->conn.get(), nam.c_str(), q, (int)n, nullptr), PQclear}; + ResPtr res {PQprepare(c->conn.get(), nam.c_str(), q, static_cast(n), nullptr), PQclear}; verify(PQresultStatus(res.get()) == PGRES_COMMAND_OK, q, c->conn.get()); return c->stmts.emplace(q, std::move(nam)).first->second; } -- cgit v1.2.3