Skip to content

Commit b11fc56

Browse files
committed
Explicit casting of long to int to avoid warnings
1 parent b9798ff commit b11fc56

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pgmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4146,7 +4146,7 @@ sourceFieldindex(sourceObject *self, PyObject *param, const char *usage)
41464146
if (PyStr_Check(param))
41474147
num = PQfnumber(self->result, PyBytes_AsString(param));
41484148
else if (PyInt_Check(param))
4149-
num = PyInt_AsLong(param);
4149+
num = (int)PyInt_AsLong(param);
41504150
else
41514151
{
41524152
PyErr_SetString(PyExc_TypeError, usage);
@@ -4451,7 +4451,7 @@ pgConnect(PyObject *self, PyObject *args, PyObject *dict)
44514451
pghost = PyBytes_AsString(pg_default_host);
44524452

44534453
if ((pgport == -1) && (pg_default_port != Py_None))
4454-
pgport = PyInt_AsLong(pg_default_port);
4454+
pgport = (int)PyInt_AsLong(pg_default_port);
44554455

44564456
if ((!pgopt) && (pg_default_opt != Py_None))
44574457
pgopt = PyBytes_AsString(pg_default_opt);

0 commit comments

Comments
 (0)