[pypy-commit] cffi verifier2: Fix the merge: I was getting confused about the numbers of testfuncs

arigo noreply at buildbot.pypy.org
Sat Aug 4 16:36:23 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: verifier2
Changeset: r770:825a7054d9dd
Date: 2012-08-04 16:28 +0200
http://bitbucket.org/cffi/cffi/changeset/825a7054d9dd/

Log:	Fix the merge: I was getting confused about the numbers of testfuncs

diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -4061,17 +4061,12 @@
     return result;
 }
 
-static short _testfunc18(struct _testfunc7_s *ptr)
-{
-    return ptr->a1 + ptr->a2;
-}
-
-static int _testfunc19(struct _testfunc17_s *ptr)
+static int _testfunc18(struct _testfunc17_s *ptr)
 {
     return ptr->a1 + (int)ptr->a2;
 }
 
-static long double _testfunc20(long double x)
+static long double _testfunc19(long double x)
 {
     int i;
     for (i=0; i<28; i++)
@@ -4079,6 +4074,11 @@
     return x;
 }
 
+static short _testfunc20(struct _testfunc7_s *ptr)
+{
+    return ptr->a1 + ptr->a2;
+}
+
 static PyObject *b__testfunc(PyObject *self, PyObject *args)
 {
     /* for testing only */
diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -801,7 +801,7 @@
     res = f(x[0])
     assert res == -4042 + ord('A')
 
-def test_call_function_18():
+def test_call_function_20():
     BChar = new_primitive_type("char")
     BShort = new_primitive_type("short")
     BStruct = new_struct_type("foo")
@@ -809,7 +809,7 @@
     complete_struct_or_union(BStruct, [('a1', BChar, -1),
                                        ('a2', BShort, -1)])
     BFunc18 = new_function_type((BStructPtr,), BShort, False)
-    f = cast(BFunc18, _testfunc(18))
+    f = cast(BFunc18, _testfunc(20))
     x = newp(BStructPtr, {'a1': 'A', 'a2': -4042})
     # test the exception that allows us to pass a 'struct foo' where the
     # function really expects a 'struct foo *'.


More information about the pypy-commit mailing list