Skip to content

Commit

Permalink
Remove compiler warnings for 32-bit Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Jun 21, 2020
1 parent f96cee9 commit 18a1ceb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pgconn.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ _conn_non_query_result(int status, PGresult* result, PGconn *cnx)
}
/* for a single insert, return the oid */
PQclear(result);
return PyInt_FromLong(oid);
return PyInt_FromLong((long) oid);
}
case PGRES_COPY_OUT: /* no data will be received */
case PGRES_COPY_IN:
Expand Down
2 changes: 1 addition & 1 deletion pglarge.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ large_getattr(largeObject *self, PyObject *nameobj)
/* large object oid */
if (!strcmp(name, "oid")) {
if (_check_lo_obj(self, 0))
return PyInt_FromLong(self->lo_oid);
return PyInt_FromLong((long) self->lo_oid);
PyErr_Clear();
Py_INCREF(Py_None);
return Py_None;
Expand Down
2 changes: 1 addition & 1 deletion pgquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ _query_build_field_info(PGresult *res, int col_num) {
info = PyTuple_New(4);
if (info) {
PyTuple_SET_ITEM(info, 0, PyStr_FromString(PQfname(res, col_num)));
PyTuple_SET_ITEM(info, 1, PyInt_FromLong(PQftype(res, col_num)));
PyTuple_SET_ITEM(info, 1, PyInt_FromLong((long) PQftype(res, col_num)));
PyTuple_SET_ITEM(info, 2, PyInt_FromLong(PQfsize(res, col_num)));
PyTuple_SET_ITEM(info, 3, PyInt_FromLong(PQfmod(res, col_num)));
}
Expand Down
4 changes: 2 additions & 2 deletions pgsource.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ source_oidstatus(sourceObject *self, PyObject *noargs)
return Py_None;
}

return PyInt_FromLong(oid);
return PyInt_FromLong((long) oid);
}

/* Fetch rows from last result. */
Expand Down Expand Up @@ -671,7 +671,7 @@ _source_buildinfo(sourceObject *self, int num)
PyTuple_SET_ITEM(result, 1,
PyStr_FromString(PQfname(self->result, num)));
PyTuple_SET_ITEM(result, 2,
PyInt_FromLong(PQftype(self->result, num)));
PyInt_FromLong((long) PQftype(self->result, num)));
PyTuple_SET_ITEM(result, 3,
PyInt_FromLong(PQfsize(self->result, num)));
PyTuple_SET_ITEM(result, 4,
Expand Down

0 comments on commit 18a1ceb

Please sign in to comment.