Author: Armin Rigo <[email protected]>
Branch: sirtom67/float_complex
Changeset: r2941:de5953e587b8
Date: 2017-05-29 19:35 +0200
http://bitbucket.org/cffi/cffi/changeset/de5953e587b8/

Log:    Revert the changes to vengine_cpy: better to say that the long-
        deprecated verify mode doesn't support complex

diff --git a/cffi/vengine_cpy.py b/cffi/vengine_cpy.py
--- a/cffi/vengine_cpy.py
+++ b/cffi/vengine_cpy.py
@@ -806,7 +806,6 @@
 cffimod_header = r'''
 #include <Python.h>
 #include <stddef.h>
-#include <complex.h>
 
 /* this block of #ifs should be kept exactly identical between
    c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py */
@@ -874,29 +873,6 @@
 #define _cffi_to_c_double PyFloat_AsDouble
 #define _cffi_to_c_float PyFloat_AsDouble
 
-#define _cffi_from_c_float__Complex(x)  PyComplex_FromDoubles(crealf(x), 
cimagf(x))
-#define _cffi_from_c_double__Complex(x) PyComplex_FromDoubles(creal(x), 
cimag(x))
-
-/* inefficient - converts twice! */
-#define _cffi_to_c_float__Complex(op)                                    \
-    (  ((float)(PyComplex_AsCComplex(op).real))  +                       \
-     I*((float)(PyComplex_AsCComplex(op).imag))     )
-/* not safe!
-//#define _cffi_to_c_float__Complex(op)                                  \
-//    (  ((float)((PyComplexObject *)(op))->cval.real)  +                \
-//     I*((float)((PyComplexObject *)(op))->cval.imag)     )
-*/
-
-/* inefficient - converts twice! */
-#define _cffi_to_c_double__Complex(op)                                   \
-    (  (PyComplex_AsCComplex(op).real)  +                                \
-     I*(PyComplex_AsCComplex(op).imag)     )
-/* not safe!
-//#define _cffi_to_c_double__Complex(op)                                   \
-//    (  (((PyComplexObject *)(op))->cval.real)  +                         \
-//     I*(((PyComplexObject *)(op))->cval.imag)     )
-*/
-
 #define _cffi_from_c_int_const(x)                                        \
     (((x) > 0) ?                                                         \
         ((unsigned long long)(x) <= (unsigned long long)LONG_MAX) ?      \
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to