Skip to content

Commit

Permalink
Explicit casting of long to int to avoid warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Jul 14, 2017
1 parent b9798ff commit b11fc56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pgmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -4146,7 +4146,7 @@ sourceFieldindex(sourceObject *self, PyObject *param, const char *usage)
if (PyStr_Check(param))
num = PQfnumber(self->result, PyBytes_AsString(param));
else if (PyInt_Check(param))
num = PyInt_AsLong(param);
num = (int)PyInt_AsLong(param);
else
{
PyErr_SetString(PyExc_TypeError, usage);
Expand Down Expand Up @@ -4451,7 +4451,7 @@ pgConnect(PyObject *self, PyObject *args, PyObject *dict)
pghost = PyBytes_AsString(pg_default_host);

if ((pgport == -1) && (pg_default_port != Py_None))
pgport = PyInt_AsLong(pg_default_port);
pgport = (int)PyInt_AsLong(pg_default_port);

if ((!pgopt) && (pg_default_opt != Py_None))
pgopt = PyBytes_AsString(pg_default_opt);
Expand Down

0 comments on commit b11fc56

Please sign in to comment.