[pypy-commit] cffi cffi-1.0: Silence warnings

arigo noreply at buildbot.pypy.org
Sat May 2 11:40:40 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r1902:7252fa21404c
Date: 2015-05-02 11:41 +0200
http://bitbucket.org/cffi/cffi/changeset/7252fa21404c/

Log:	Silence warnings

diff --git a/_cffi1/cffi1_module.c b/_cffi1/cffi1_module.c
--- a/_cffi1/cffi1_module.c
+++ b/_cffi1/cffi1_module.c
@@ -16,6 +16,8 @@
 
 static int init_ffi_lib(PyObject *m)
 {
+    PyObject *x;
+
     if (!PyType_Ready(&FFI_Type) < 0)
         return -1;
     if (!PyType_Ready(&Lib_Type) < 0)
@@ -35,11 +37,13 @@
                              (PyObject *)&CData_Type) < 0)
         return -1;
 
-    Py_INCREF(&FFI_Type);
-    if (PyModule_AddObject(m, "FFI", (PyObject *)&FFI_Type) < 0)
+    x = (PyObject *)&FFI_Type;
+    Py_INCREF(x);
+    if (PyModule_AddObject(m, "FFI", x) < 0)
         return -1;
-    Py_INCREF(&Lib_Type);
-    if (PyModule_AddObject(m, "Lib", (PyObject *)&Lib_Type) < 0)
+    x = (PyObject *)&Lib_Type;
+    Py_INCREF(x);
+    if (PyModule_AddObject(m, "Lib", x) < 0)
         return -1;
 
     return 0;


More information about the pypy-commit mailing list