<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/unix/modffi.c, branch v1.5.1</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.5.1</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=v1.5.1'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2015-11-20T15:51:37+00:00</updated>
<entry>
<title>unix/modffi: Mark 'O' type specifier as implemented.</title>
<updated>2015-11-20T15:51:37+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-11-20T15:51:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=acb743da649c464c3ec2d3ec34fdaa8f64f3a51f'/>
<id>urn:sha1:acb743da649c464c3ec2d3ec34fdaa8f64f3a51f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>unix/modffi.c: cast first to intptr_t when casting from/to pointer</title>
<updated>2015-09-23T01:54:31+00:00</updated>
<author>
<name>Vicente Olivert Riera</name>
<email>Vincent.Riera@imgtec.com</email>
</author>
<published>2015-09-20T08:00:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=587914169cc6ff7f0513bd14c42dcbb275bf77bd'/>
<id>urn:sha1:587914169cc6ff7f0513bd14c42dcbb275bf77bd</id>
<content type='text'>
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-&gt;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 &lt;Vincent.Riera@imgtec.com&gt;
</content>
</entry>
<entry>
<title>modffi: dlsym() doesn't set errno, so use ENOENT for OSError.</title>
<updated>2015-08-30T21:20:08+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-08-30T21:17:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=696eee947539d6394a8f14efd84e20934c1e39bb'/>
<id>urn:sha1:696eee947539d6394a8f14efd84e20934c1e39bb</id>
<content type='text'>
This may be a bit confusing, as ENOENT is often rendered as "No such
file or directory", but any other code would be only more confusing.
</content>
</entry>
<entry>
<title>unix/modffi.c: get_buffer is allowed to return NULL if len=0.</title>
<updated>2015-05-01T20:34:08+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-05-01T20:34:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a9afcb159acacd0d605dd54fc69709650bd336b8'/>
<id>urn:sha1:a9afcb159acacd0d605dd54fc69709650bd336b8</id>
<content type='text'>
This is consistent with the logic in mp_get_buffer, and the code here is
an inlined version of that function.
</content>
</entry>
<entry>
<title>unix/modffi: Support passing float/double args.</title>
<updated>2015-04-28T18:40:34+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-04-28T18:40:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6bbbb1ab41a5319b0558b2f0131b3f746f0cb5b9'/>
<id>urn:sha1:6bbbb1ab41a5319b0558b2f0131b3f746f0cb5b9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Overhaul and simplify printf/pfenv mechanism.</title>
<updated>2015-04-16T14:30:16+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-04-09T22:56:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7f9d1d6ab923096582622b700bedb6a571518eac'/>
<id>urn:sha1:7f9d1d6ab923096582622b700bedb6a571518eac</id>
<content type='text'>
Previous to this patch the printing mechanism was a bit of a tangled
mess.  This patch attempts to consolidate printing into one interface.

All (non-debug) printing now uses the mp_print* family of functions,
mainly mp_printf.  All these functions take an mp_print_t structure as
their first argument, and this structure defines the printing backend
through the "print_strn" function of said structure.

Printing from the uPy core can reach the platform-defined print code via
two paths: either through mp_sys_stdout_obj (defined pert port) in
conjunction with mp_stream_write; or through the mp_plat_print structure
which uses the MP_PLAT_PRINT_STRN macro to define how string are printed
on the platform.  The former is only used when MICROPY_PY_IO is defined.

With this new scheme printing is generally more efficient (less layers
to go through, less arguments to pass), and, given an mp_print_t*
structure, one can call mp_print_str for efficiency instead of
mp_printf("%s", ...).  Code size is also reduced by around 200 bytes on
Thumb2 archs.
</content>
</entry>
<entry>
<title>modffi: Implement 'O' type handling for func arguments.</title>
<updated>2015-02-25T21:38:22+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-02-25T21:37:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=bbaf68f2cb913ba330dc57263a5ac9088ab0062b'/>
<id>urn:sha1:bbaf68f2cb913ba330dc57263a5ac9088ab0062b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>modffi: Add toplevel func() function to create a function by pointer.</title>
<updated>2015-02-10T23:21:03+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-02-10T23:20:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=99bcaa2fb6b45a378278a956e7f830cee170804e'/>
<id>urn:sha1:99bcaa2fb6b45a378278a956e7f830cee170804e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>modffi: Add .addr() method to just get symbol address.</title>
<updated>2015-02-05T22:19:43+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-02-05T22:18:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=8775caf9f1c97ecc64f22e355b670ba74d5bd098'/>
<id>urn:sha1:8775caf9f1c97ecc64f22e355b670ba74d5bd098</id>
<content type='text'>
</content>
</entry>
<entry>
<title>modffi: 's' (string) return type: handle NULL properly (return None).</title>
<updated>2015-01-24T23:36:14+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2015-01-24T22:42:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=31c1f1300e2f166061cb0a491fab30ac37018a94'/>
<id>urn:sha1:31c1f1300e2f166061cb0a491fab30ac37018a94</id>
<content type='text'>
</content>
</entry>
</feed>
