[pypy-commit] cffi cffi-1.0: Fix for 3.4.1 (this version forces -Werror=declaration-after-statement)
arigo
noreply at buildbot.pypy.org
Tue May 12 10:23:43 CEST 2015
Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r1981:9ea7c5347d6b
Date: 2015-05-12 10:24 +0200
http://bitbucket.org/cffi/cffi/changeset/9ea7c5347d6b/
Log: Fix for 3.4.1 (this version forces -Werror=declaration-after-
statement)
diff --git a/_cffi1/ffi_obj.c b/_cffi1/ffi_obj.c
--- a/_cffi1/ffi_obj.c
+++ b/_cffi1/ffi_obj.c
@@ -467,6 +467,9 @@
CTypeDescrObject *ct;
size_t replace_with_len;
static char *keywords[] = {"cdecl", "replace_with", NULL};
+#if PY_MAJOR_VERSION >= 3
+ PyObject *u;
+#endif
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|s:getctype", keywords,
&c_decl, &replace_with))
@@ -502,9 +505,9 @@
#if PY_MAJOR_VERSION >= 3
/* bytes -> unicode string */
- PyObject *u = PyUnicode_DecodeLatin1(PyBytes_AS_STRING(res),
- PyBytes_GET_SIZE(res),
- NULL);
+ u = PyUnicode_DecodeLatin1(PyBytes_AS_STRING(res),
+ PyBytes_GET_SIZE(res),
+ NULL);
Py_DECREF(res);
res = u;
#endif
More information about the pypy-commit
mailing list