Author: Armin Rigo <[email protected]>
Branch: sirtom67/float_complex
Changeset: r2945:c60f27f65b7b
Date: 2017-05-29 20:42 +0200
http://bitbucket.org/cffi/cffi/changeset/c60f27f65b7b/

Log:    MSVC fixes

diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -924,8 +924,8 @@
     do {                                                   \
         if (size == 2*sizeof(type)) {                      \
             type r = (type)source.real;                    \
+            type i = (type)source.imag;                    \
             memcpy(target, &r, sizeof(type));              \
-            type i = (type)source.imag;                    \
             memcpy(target+sizeof(type), &i, sizeof(type)); \
             return;                                        \
         }                                                  \
@@ -3729,6 +3729,7 @@
         /* cast to a float */
         double value;
         PyObject *io;
+        int res;
 
         if (CData_Check(ob)) {
             CDataObject *cdsrc = (CDataObject *)ob;
@@ -3744,7 +3745,7 @@
             Py_INCREF(io);
         }
 
-        int res = check_bytes_for_float_compatible(io, &value);
+        res = check_bytes_for_float_compatible(io, &value);
         if (res == -1)
             goto cannot_cast;
         if (res == 0) {
@@ -3780,6 +3781,8 @@
         /* cast to a complex */
         Py_complex value;
         PyObject *io;
+        int res;
+
         if (CData_Check(ob)) {
             CDataObject *cdsrc = (CDataObject *)ob;
 
@@ -3794,7 +3797,7 @@
             Py_INCREF(io);
         }
 
-        int res = check_bytes_for_float_compatible(io, &value.real);
+        res = check_bytes_for_float_compatible(io, &value.real);
         if (res == -1)
             goto cannot_cast;
         if (res == 1) {
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to