mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-25 18:33:44 +03:00
Further cpychecker annotations
This commit is contained in:
parent
d38ffc6cf1
commit
1f62b47dc5
|
@ -56,7 +56,7 @@ typecast_array_cleanup(const char **str, Py_ssize_t *len)
|
|||
#define ASCAN_TOKEN 3
|
||||
#define ASCAN_QUOTED 4
|
||||
|
||||
static int
|
||||
RAISES_NEG static int
|
||||
typecast_array_tokenize(const char *str, Py_ssize_t strlength,
|
||||
Py_ssize_t *pos, char** token,
|
||||
Py_ssize_t *length, int *quotes)
|
||||
|
@ -202,7 +202,8 @@ typecast_array_scan(const char *str, Py_ssize_t strlength,
|
|||
if (obj == NULL) return -1;
|
||||
|
||||
PyList_Append(array, obj);
|
||||
Py_DECREF(obj);
|
||||
TO_STATE(obj);
|
||||
Py_CLEAR(obj);
|
||||
}
|
||||
|
||||
else if (state == ASCAN_BEGIN) {
|
||||
|
|
|
@ -155,6 +155,7 @@ typecast_BINARY_cast(const char *s, Py_ssize_t l, PyObject *curs)
|
|||
* an easy format.
|
||||
*/
|
||||
if (NULL == (buffer = psycopg_parse_hex(s, l, &len))) {
|
||||
FAKE_RAISE(); /* issue davidmalcolm/gcc-python-plugin#75 */
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
@ -170,6 +171,7 @@ typecast_BINARY_cast(const char *s, Py_ssize_t l, PyObject *curs)
|
|||
* story.
|
||||
*/
|
||||
if (NULL == (buffer = psycopg_parse_escape(s, l, &len))) {
|
||||
FAKE_RAISE(); /* issue davidmalcolm/gcc-python-plugin#75 */
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -131,12 +131,12 @@ xid_init(xidObject *self, PyObject *args, PyObject *kwargs)
|
|||
}
|
||||
}
|
||||
|
||||
if (!(self->format_id = PyInt_FromLong(format_id))) { return -1; }
|
||||
if (!(self->gtrid = Text_FromUTF8(gtrid))) { return -1; }
|
||||
if (!(self->bqual = Text_FromUTF8(bqual))) { return -1; }
|
||||
Py_INCREF(Py_None); self->prepared = Py_None;
|
||||
Py_INCREF(Py_None); self->owner = Py_None;
|
||||
Py_INCREF(Py_None); self->database = Py_None;
|
||||
if (!(self->format_id = TO_STATE(PyInt_FromLong(format_id)))) { return -1; }
|
||||
if (!(self->gtrid = TO_STATE(Text_FromUTF8(gtrid)))) { return -1; }
|
||||
if (!(self->bqual = TO_STATE(Text_FromUTF8(bqual)))) { return -1; }
|
||||
Py_INCREF(Py_None); self->prepared = TO_STATE(Py_None);
|
||||
Py_INCREF(Py_None); self->owner = TO_STATE(Py_None);
|
||||
Py_INCREF(Py_None); self->database = TO_STATE(Py_None);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user