diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2012-03-01 00:57:52 +0000 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2012-03-01 02:53:28 +0000 |
commit | 5bfb6cdefed3754b2a15e1e3372630691392ca47 (patch) | |
tree | a5184076e1f38373395bf0206655fb4f9e0effb2 /psycopg/utils.c | |
parent | f2e4a8ed78973a0d14dbe0d463911436562683f3 (diff) | |
download | psycopg2-5bfb6cdefed3754b2a15e1e3372630691392ca47.tar.gz |
Use more compact macros to annotate functions for the static checker
Diffstat (limited to 'psycopg/utils.c')
-rw-r--r-- | psycopg/utils.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/psycopg/utils.c b/psycopg/utils.c index 9ae710d..57586c5 100644 --- a/psycopg/utils.c +++ b/psycopg/utils.c @@ -116,8 +116,7 @@ psycopg_escape_identifier_easy(const char *from, Py_ssize_t len) * Store the return in 'to' and return 0 in case of success, else return -1 * and raise an exception. */ -CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION -int +RAISES_NEG int psycopg_strdup(char **to, const char *from, Py_ssize_t len) { if (!len) { len = strlen(from); } @@ -139,8 +138,7 @@ psycopg_strdup(char **to, const char *from, Py_ssize_t len) * * It is safe to call the function on NULL. */ -CPYCHECKER_STEALS_REFERENCE_TO_ARG(1) -PyObject * +STEALS(1) PyObject * psycopg_ensure_bytes(PyObject *obj) { PyObject *rv = NULL; @@ -170,8 +168,7 @@ psycopg_ensure_bytes(PyObject *obj) * The function is ref neutral: steals a ref from obj and adds one to the * return value. It is safe to call it on NULL. */ -CPYCHECKER_STEALS_REFERENCE_TO_ARG(1) -PyObject * +STEALS(1) PyObject * psycopg_ensure_text(PyObject *obj) { #if PY_MAJOR_VERSION < 3 |