Flag cpychecker false positives in adapters

This commit is contained in:
Daniele Varrazzo 2019-01-21 01:52:23 +00:00
parent bcd7fca543
commit d344ff818a
11 changed files with 15 additions and 13 deletions

View File

@ -108,7 +108,7 @@ asis_setup(asisObject *self, PyObject *obj)
);
Py_INCREF(obj);
self->wrapped = obj;
self->wrapped = TO_STATE(obj);
Dprintf("asis_setup: good asis object at %p, refcnt = "
FORMAT_CODE_PY_SSIZE_T,

View File

@ -133,7 +133,7 @@ static PyObject *
binary_getquoted(binaryObject *self, PyObject *args)
{
if (self->buffer == NULL) {
self->buffer = binary_quote(self);
self->buffer = TO_STATE(binary_quote(self));
}
Py_XINCREF(self->buffer);
return self->buffer;
@ -210,7 +210,7 @@ binary_setup(binaryObject *self, PyObject *str)
self->buffer = NULL;
self->conn = NULL;
Py_INCREF(str);
self->wrapped = str;
self->wrapped = TO_STATE(str);
Dprintf("binary_setup: good binary object at %p, refcnt = "
FORMAT_CODE_PY_SSIZE_T,

View File

@ -177,7 +177,7 @@ pydatetime_setup(pydatetimeObject *self, PyObject *obj, int type)
self->type = type;
Py_INCREF(obj);
self->wrapped = obj;
self->wrapped = TO_STATE(obj);
Dprintf("pydatetime_setup: good pydatetime object at %p, refcnt = "
FORMAT_CODE_PY_SSIZE_T,

View File

@ -240,7 +240,7 @@ list_setup(listObject *self, PyObject *obj)
self->connection = NULL;
Py_INCREF(obj);
self->wrapped = obj;
self->wrapped = TO_STATE(obj);
Dprintf("list_setup: good list object at %p, refcnt = "
FORMAT_CODE_PY_SSIZE_T,

View File

@ -163,7 +163,7 @@ mxdatetime_setup(mxdatetimeObject *self, PyObject *obj, int type)
self->type = type;
Py_INCREF(obj);
self->wrapped = obj;
self->wrapped = TO_STATE(obj);
Dprintf("mxdatetime_setup: good mxdatetime object at %p, refcnt = "
FORMAT_CODE_PY_SSIZE_T,

View File

@ -96,7 +96,7 @@ pboolean_setup(pbooleanObject *self, PyObject *obj)
);
Py_INCREF(obj);
self->wrapped = obj;
self->wrapped = TO_STATE(obj);
Dprintf("pboolean_setup: good pboolean object at %p, refcnt = "
FORMAT_CODE_PY_SSIZE_T,

View File

@ -161,7 +161,7 @@ pdecimal_setup(pdecimalObject *self, PyObject *obj)
);
Py_INCREF(obj);
self->wrapped = obj;
self->wrapped = TO_STATE(obj);
Dprintf("pdecimal_setup: good pdecimal object at %p, refcnt = "
FORMAT_CODE_PY_SSIZE_T,

View File

@ -35,6 +35,7 @@
/** the Float object **/
IGNORE_REFCOUNT /* bug davidmalcolm/gcc-python-plugin#165 */
static PyObject *
pfloat_getquoted(pfloatObject *self, PyObject *args)
{
@ -134,7 +135,7 @@ pfloat_setup(pfloatObject *self, PyObject *obj)
);
Py_INCREF(obj);
self->wrapped = obj;
self->wrapped = TO_STATE(obj);
Dprintf("pfloat_setup: good pfloat object at %p, refcnt = "
FORMAT_CODE_PY_SSIZE_T,

View File

@ -139,7 +139,7 @@ pint_setup(pintObject *self, PyObject *obj)
);
Py_INCREF(obj);
self->wrapped = obj;
self->wrapped = TO_STATE(obj);
Dprintf("pint_setup: good pint object at %p, refcnt = "
FORMAT_CODE_PY_SSIZE_T,

View File

@ -74,6 +74,7 @@ qstring_quote(qstringObject *self)
/* encode the string into buffer */
Bytes_AsStringAndSize(str, &s, &len);
if (!(buffer = psycopg_escape_string(self->conn, s, len, NULL, &qlen))) {
FAKE_RAISE();
goto exit;
}
@ -98,7 +99,7 @@ static PyObject *
qstring_getquoted(qstringObject *self, PyObject *args)
{
if (self->buffer == NULL) {
self->buffer = qstring_quote(self);
self->buffer = TO_STATE(qstring_quote(self));
}
Py_XINCREF(self->buffer);
return self->buffer;
@ -215,7 +216,7 @@ qstring_setup(qstringObject *self, PyObject *str)
);
Py_INCREF(str);
self->wrapped = str;
self->wrapped = TO_STATE(str);
Dprintf("qstring_setup: good qstring object at %p, refcnt = "
FORMAT_CODE_PY_SSIZE_T,

View File

@ -99,8 +99,8 @@ static struct PyMemberDef isqlquoteObject_members[] = {
static int
isqlquote_setup(isqlquoteObject *self, PyObject *wrapped)
{
self->wrapped = wrapped;
Py_INCREF(wrapped);
self->wrapped = TO_STATE(wrapped);
return 0;
}