Skip to content

Commit 531084d

Browse files
committed
Stricter types usage in several PyArg_ParseTuple calls
1 parent 0e832b9 commit 531084d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

psycopg/connection_type.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,8 @@ psyco_conn_get_parameter_status(connectionObject *self, PyObject *args)
701701
static PyObject *
702702
psyco_conn_lobject(connectionObject *self, PyObject *args, PyObject *keywds)
703703
{
704-
Oid oid=InvalidOid, new_oid=InvalidOid;
705-
char *new_file = NULL;
704+
int oid = (int)InvalidOid, new_oid = (int)InvalidOid;
705+
const char *new_file = NULL;
706706
const char *smode = "";
707707
PyObject *factory = (PyObject *)&lobjectType;
708708
PyObject *obj;

psycopg/lobject_type.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ lobject_dealloc(PyObject* obj)
373373
static int
374374
lobject_init(PyObject *obj, PyObject *args, PyObject *kwds)
375375
{
376-
Oid oid=InvalidOid, new_oid=InvalidOid;
376+
int oid = (int)InvalidOid, new_oid = (int)InvalidOid;
377377
const char *smode = "";
378378
const char *new_file = NULL;
379379
PyObject *conn;
@@ -383,7 +383,7 @@ lobject_init(PyObject *obj, PyObject *args, PyObject *kwds)
383383
return -1;
384384

385385
return lobject_setup((lobjectObject *)obj,
386-
(connectionObject *)conn, oid, smode, new_oid, new_file);
386+
(connectionObject *)conn, (Oid)oid, smode, (Oid)new_oid, new_file);
387387
}
388388

389389
static PyObject *

psycopg/typecast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ typecast_repr(PyObject *self)
468468
static PyObject *
469469
typecast_call(PyObject *obj, PyObject *args, PyObject *kwargs)
470470
{
471-
char *string;
471+
const char *string;
472472
Py_ssize_t length;
473473
PyObject *cursor;
474474

0 commit comments

Comments
 (0)