circuitpython/unix
Vicente Olivert Riera 587914169c unix/modffi.c: cast first to intptr_t when casting from/to pointer
This fixes errors like these ones:

modffi.c: In function 'return_ffi_value':
modffi.c:143:29: error: cast to pointer from integer of different size
[-Werror=int-to-pointer-cast]
             const char *s = (const char *)val;
                             ^
modffi.c:162:20: error: cast to pointer from integer of different size
[-Werror=int-to-pointer-cast]
             return (mp_obj_t)val;
                    ^
modffi.c: In function 'ffifunc_call':
modffi.c:358:25: error: cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
             values[i] = (ffi_arg)a;
                         ^
modffi.c:373:25: error: cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
             values[i] = (ffi_arg)s;
                         ^
modffi.c:381:25: error: cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
             values[i] = (ffi_arg)bufinfo.buf;
                         ^
modffi.c:384:25: error: cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
             values[i] = (ffi_arg)p->func;
                         ^

These errors can be highlighted when building micropython from MIPS64
n32 because ffi_arg is 64-bit wide and the pointers on MIPS64 n32 are
32-bit wide, so it's trying to case an integer to a pointer (or
vice-versa) of a different size. We should cast first the pointer (or the
integer) to a pointer sized integer (intptr_t) to fix that problem.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
2015-09-22 18:54:31 -07:00
..
.gitignore unix: Update .gitignore; now ignores coverage build. 2015-06-03 17:47:31 +01:00
Makefile unix/modjni: "jni" module to interface to JNI-compliant JavaVM. 2015-09-11 21:38:57 +03:00
alloc.c unix: Add target to build "minimal" uPy interpreter. 2015-01-16 18:03:01 +00:00
coverage.c tests: Add tests to improve coverage of objstr.c. 2015-09-03 23:06:18 +01:00
file.c py: Add stream_tell method, and use for unix and stmhal file tell. 2015-08-13 22:56:32 +01:00
gccollect.c unix: Add target to build "minimal" uPy interpreter. 2015-01-16 18:03:01 +00:00
input.c unix: Print an extra newline to the output on ctrl-D 2015-05-30 13:38:17 +03:00
input.h unix: Support readline history saving to file, improves interactive usage. 2015-03-13 21:46:19 +00:00
main.c unix: Use MICROPY_HAL_H macro for header inclusion. 2015-09-19 14:03:57 +01:00
modffi.c unix/modffi.c: cast first to intptr_t when casting from/to pointer 2015-09-22 18:54:31 -07:00
modjni.c unix/modjni: Move type analysis logic to new_jobject(), for reuse. 2015-09-22 17:02:17 -07:00
modos.c unix: Prefix includes with py/; remove need for -I../py. 2015-01-01 20:40:19 +00:00
modsocket.c unix: modsocket: Implement inet_pton() in preference of inet_aton(). 2015-07-15 00:06:03 +03:00
modtermios.c unix: Prefix includes with py/; remove need for -I../py. 2015-01-01 20:40:19 +00:00
modtime.c py, unix, lib: Allow to compile with -Wold-style-definition. 2015-01-12 22:34:38 +00:00
mpconfigport.h py/objslice: Make slice attributes (start/stop/step) readable. 2015-09-15 21:59:20 +01:00
mpconfigport.mk unix/modjni: "jni" module to interface to JNI-compliant JavaVM. 2015-09-11 21:38:57 +03:00
mpconfigport_fast.h unix: Include upip as fronzen modules inside the standard interpreter. 2015-06-02 01:32:07 +03:00
mpconfigport_minimal.h py: Add MICROPY_PY_BUILTINS_FILTER, disable for minimal ports. 2015-08-20 01:05:11 +03:00
qstrdefsport.h unix/modjni: Add env() module function. 2015-09-16 01:10:09 +03:00
unix_mphal.c unix: Use MICROPY_HAL_H macro for header inclusion. 2015-09-19 14:03:57 +01:00
unix_mphal.h unix: Add option to use uPy readline, and enable by default. 2015-05-27 15:59:43 +01:00