From 4d775cd7631a4cbad98028631a9dfec1e02688dd Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 5 Jul 2021 20:46:41 +0100 Subject: Explicit integer type casts --- lib/output/pq/pqConn.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/output/pq/pqConn.cpp b/lib/output/pq/pqConn.cpp index 53fd3db..d35d011 100644 --- a/lib/output/pq/pqConn.cpp +++ b/lib/output/pq/pqConn.cpp @@ -70,17 +70,17 @@ namespace MyGrate::Output::Pq { verify(PQresultStatus(res.get()) == PGRES_COPY_IN, "begin copy", res.get()); return fopencookie(this, "w", {nullptr, - [](void * cookie, const char * buf, size_t size) -> ssize_t { + [](void * cookie, const char * buf, size_t size) { auto pq = static_cast(cookie); int rc; - while (!(rc = PQputCopyData(pq->conn.get(), buf, size))) { + while (!(rc = PQputCopyData(pq->conn.get(), buf, (int)size))) { sleep(1); } verify(rc == 1, "copy data", pq->conn.get()); - return size; + return (ssize_t)size; }, nullptr, - [](void * cookie) -> int { + [](void * cookie) { static_cast(cookie)->endBulkUpload(nullptr); return 0; }}); -- cgit v1.2.3