summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2012-03-04 18:01:08 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2012-03-04 18:01:08 +0000
commit531084d561ee5aaaccbc892373f8551ae7ef3b1a (patch)
tree1c4fb07b660debc358d7a172fc4180dc4279c08c
parent0e832b97ea7a84220f2148db3746e10f85eadef2 (diff)
downloadpsycopg2-531084d561ee5aaaccbc892373f8551ae7ef3b1a.tar.gz
Stricter types usage in several PyArg_ParseTuple calls
-rw-r--r--psycopg/connection_type.c4
-rw-r--r--psycopg/lobject_type.c4
-rw-r--r--psycopg/typecast.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/psycopg/connection_type.c b/psycopg/connection_type.c
index 9cdd640..374d34f 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 a55272c..625a293 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 9c36b02..8504631 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;