From 531084d561ee5aaaccbc892373f8551ae7ef3b1a Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sun, 4 Mar 2012 18:01:08 +0000 Subject: [PATCH] Stricter types usage in several PyArg_ParseTuple calls --- psycopg/connection_type.c | 4 ++-- psycopg/lobject_type.c | 4 ++-- psycopg/typecast.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/psycopg/connection_type.c b/psycopg/connection_type.c index 9cdd640f..374d34f8 100644 --- a/psycopg/connection_type.c +++ b/psycopg/connection_type.c @@ -701,8 +701,8 @@ psyco_conn_get_parameter_status(connectionObject *self, PyObject *args) static PyObject * psyco_conn_lobject(connectionObject *self, PyObject *args, PyObject *keywds) { - Oid oid=InvalidOid, new_oid=InvalidOid; - char *new_file = NULL; + int oid = (int)InvalidOid, new_oid = (int)InvalidOid; + const char *new_file = NULL; const char *smode = ""; PyObject *factory = (PyObject *)&lobjectType; PyObject *obj; diff --git a/psycopg/lobject_type.c b/psycopg/lobject_type.c index a55272ca..625a2939 100644 --- a/psycopg/lobject_type.c +++ b/psycopg/lobject_type.c @@ -373,7 +373,7 @@ lobject_dealloc(PyObject* obj) static int lobject_init(PyObject *obj, PyObject *args, PyObject *kwds) { - Oid oid=InvalidOid, new_oid=InvalidOid; + int oid = (int)InvalidOid, new_oid = (int)InvalidOid; const char *smode = ""; const char *new_file = NULL; PyObject *conn; @@ -383,7 +383,7 @@ lobject_init(PyObject *obj, PyObject *args, PyObject *kwds) return -1; return lobject_setup((lobjectObject *)obj, - (connectionObject *)conn, oid, smode, new_oid, new_file); + (connectionObject *)conn, (Oid)oid, smode, (Oid)new_oid, new_file); } static PyObject * diff --git a/psycopg/typecast.c b/psycopg/typecast.c index 9c36b02b..8504631b 100644 --- a/psycopg/typecast.c +++ b/psycopg/typecast.c @@ -468,7 +468,7 @@ typecast_repr(PyObject *self) static PyObject * typecast_call(PyObject *obj, PyObject *args, PyObject *kwargs) { - char *string; + const char *string; Py_ssize_t length; PyObject *cursor;