pgvector.git / summary / log / commit / refs

commit    29dbbe022dca3e3963c19da174460c8f3151fc70
Author:   Andrew Kane <andrew@ankane.org>
Date:     Fri Aug 14 02:09:21 2026 +0000

    Fixed conversion warnings with pq_sendint16 and pq_sendint32 [skip ci]


src/halfvec.c | 4 ++-- src/sparsevec.c | 8 ++++---- src/vector.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/halfvec.c b/src/halfvec.c index 3ef1d467..4515daf3 100644 --- a/src/halfvec.c +++ b/src/halfvec.c @@ -410,8 +410,8 @@ halfvec_send(PG_FUNCTION_ARGS) StringInfoData buf; pq_begintypsend(&buf); - pq_sendint16(&buf, vec->dim); - pq_sendint16(&buf, vec->unused); + pq_sendint16(&buf, (uint16) vec->dim); + pq_sendint16(&buf, (uint16) vec->unused); for (int i = 0; i < vec->dim; i++) pq_sendhalf(&buf, vec->x[i]); diff --git a/src/sparsevec.c b/src/sparsevec.c index 4d8c8b3c..ef42146d 100644 --- a/src/sparsevec.c +++ b/src/sparsevec.c @@ -569,13 +569,13 @@ sparsevec_send(PG_FUNCTION_ARGS) StringInfoData buf; pq_begintypsend(&buf); - pq_sendint32(&buf, svec->dim); - pq_sendint32(&buf, svec->nnz); - pq_sendint32(&buf, svec->unused); + pq_sendint32(&buf, (uint32) svec->dim); + pq_sendint32(&buf, (uint32) svec->nnz); + pq_sendint32(&buf, (uint32) svec->unused); /* Binary representation uses zero-based numbering for indices */ for (int i = 0; i < svec->nnz; i++) - pq_sendint32(&buf, svec->indices[i]); + pq_sendint32(&buf, (uint32) svec->indices[i]); for (int i = 0; i < svec->nnz; i++) pq_sendfloat4(&buf, values[i]); diff --git a/src/vector.c b/src/vector.c index 813ce228..296a8f39 100644 --- a/src/vector.c +++ b/src/vector.c @@ -413,8 +413,8 @@ vector_send(PG_FUNCTION_ARGS) StringInfoData buf; pq_begintypsend(&buf); - pq_sendint16(&buf, vec->dim); - pq_sendint16(&buf, vec->unused); + pq_sendint16(&buf, (uint16) vec->dim); + pq_sendint16(&buf, (uint16) vec->unused); for (int i = 0; i < vec->dim; i++) pq_sendfloat4(&buf, vec->x[i]); [parent: 0cd6b580780f]