summaryrefslogtreecommitdiff
path: root/lib/output
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-07-05 20:46:41 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-07-05 20:53:13 +0100
commit4d775cd7631a4cbad98028631a9dfec1e02688dd (patch)
treeb0d23042a1f6e90b548eac8788c3db741dd86780 /lib/output
parentPrevent move and copy of WritePqCopyStream (diff)
downloadmygrate-4d775cd7631a4cbad98028631a9dfec1e02688dd.tar.bz2
mygrate-4d775cd7631a4cbad98028631a9dfec1e02688dd.tar.xz
mygrate-4d775cd7631a4cbad98028631a9dfec1e02688dd.zip
Explicit integer type casts
Diffstat (limited to 'lib/output')
-rw-r--r--lib/output/pq/pqConn.cpp8
1 files changed, 4 insertions, 4 deletions
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<PqErr>(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<PqConn *>(cookie);
int rc;
- while (!(rc = PQputCopyData(pq->conn.get(), buf, size))) {
+ while (!(rc = PQputCopyData(pq->conn.get(), buf, (int)size))) {
sleep(1);
}
verify<PqErr>(rc == 1, "copy data", pq->conn.get());
- return size;
+ return (ssize_t)size;
},
nullptr,
- [](void * cookie) -> int {
+ [](void * cookie) {
static_cast<PqConn *>(cookie)->endBulkUpload(nullptr);
return 0;
}});