[pypy-commit] cffi fix/unaligned-access: Fix precision loss warning when casting integer types.

vbernat noreply at buildbot.pypy.org
Sun Aug 24 19:53:05 CEST 2014


Author: Vincent Bernat <bernat at luffy.cx>
Branch: fix/unaligned-access
Changeset: r1558:5acc6f8d77a1
Date: 2014-08-24 10:30 +0200
http://bitbucket.org/cffi/cffi/changeset/5acc6f8d77a1/

Log:	Fix precision loss warning when casting integer types.

diff --git a/c/_cffi_backend.c b/c/_cffi_backend.c
--- a/c/_cffi_backend.c
+++ b/c/_cffi_backend.c
@@ -776,7 +776,7 @@
 #define _write_raw_data(type)                           \
     do {                                                \
         if (size == sizeof(type)) {                     \
-            type r = source;                            \
+            type r = (type)source;                      \
             memcpy(target, &r, sizeof(type));           \
             return;                                     \
         }                                               \


More information about the pypy-commit mailing list