Damien George
be6d8be91e
py: Rename mp_obj_int_get to mp_obj_int_get_truncated; fix struct.pack.
...
mp_obj_int_get_truncated is used as a "fast path" int accessor that
doesn't check for overflow and returns the int truncated to the machine
word size, ie mp_int_t.
Use mp_obj_int_get_truncated to fix struct.pack when packing maximum word
sized values.
Addresses issues #779 and #998 .
2014-12-05 23:13:52 +00:00
Damien George
c9f8f653ad
py: Add support for float/double arrays in array module.
...
Addresses issue #981 .
2014-11-21 18:16:25 +00:00
Damien George
9336ee320a
py: Make mp_binary_set_val work on big endian machine.
2014-10-06 15:05:35 +00:00
Damien George
42f3de924b
py: Convert [u]int to mp_[u]int_t where appropriate.
...
Addressing issue #50 .
2014-10-03 17:44:14 +00:00
Damien George
953074315e
py: Enable struct/binary-helper to parse q and Q sized ints.
...
Addresses issue #848 .
2014-09-10 22:10:33 +01:00
Paul Sokolovsky
78fde4819c
modstruct: Implement 'O', 'P', 's' types for packed structs.
...
This is required to deal with, well, packed C structs containing pointers.
2014-09-06 20:22:06 +03:00
Damien George
4abff7500f
py: Change uint to mp_uint_t in runtime.h, stackctrl.h, binary.h.
...
Part of code cleanup, working towards resolving issue #50 .
2014-08-30 14:59:21 +01:00
Paul Sokolovsky
ecca53bd34
py: binary.c: Properly implement alignment for native unpacked structs.
2014-08-10 23:21:08 +03:00
Paul Sokolovsky
5fa5ca40e6
binary: Factor out mp_binary_set_int().
2014-07-05 23:54:03 +03:00
Damien George
40f3c02682
Rename machine_(u)int_t to mp_(u)int_t.
...
See discussion in issue #50 .
2014-07-03 13:25:24 +01:00
Paul Sokolovsky
f3de62e6c2
binary: machine_uint_t vs uint dichotomy starts doing real damage.
2014-06-26 00:41:08 +03:00
Paul Sokolovsky
7a2f166949
modstruct: Fix alignment handling issues.
...
Also, factor out mp_binary_get_int() function.
2014-06-25 23:34:44 +03:00
Paul Sokolovsky
59c675a64c
py: Include mpconfig.h before all other includes.
...
It defines types used by all other headers.
Fixes #691 .
2014-06-21 22:43:22 +03:00
Paul Sokolovsky
62798831be
modstruct: Add one more extension to typecodes - 'S', a pointer to C string.
...
Also, add comment with description of extension to CPython's typecodes.
2014-06-02 16:35:56 +03:00
Damien George
fb510b3bf9
Rename bultins config variables to MICROPY_PY_BUILTINS_*.
...
This renames:
MICROPY_PY_FROZENSET -> MICROPY_PY_BUILTINS_FROZENSET
MICROPY_PY_PROPERTY -> MICROPY_PY_BUILTINS_PROPERTY
MICROPY_PY_SLICE -> MICROPY_PY_BUILTINS_SLICE
MICROPY_ENABLE_FLOAT -> MICROPY_PY_BUILTINS_FLOAT
See issue #35 for discussion.
2014-06-01 13:32:54 +01:00
Damien George
04b9147e15
Add license header to (almost) all files.
...
Blanket wide to all .c and .h files. Some files originating from ST are
difficult to deal with (license wise) so it was left out of those.
Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
2014-05-03 23:27:38 +01:00
Paul Sokolovsky
0f836ef893
modstruct: Add 'O' typecode for passing mp_obj_t.
...
Useful as callback data, etc.
2014-04-20 13:08:33 +03:00
Paul Sokolovsky
4e4fa94c4c
modstruct: Use proper int accessor which checks input value type.
2014-04-20 13:08:33 +03:00
Paul Sokolovsky
6204460461
modstruct: Initial implementation of struct.pack().
2014-04-19 03:22:08 +03:00
Paul Sokolovsky
1355cf42f2
modstruct: Fix .calcsize() to account for struct type/alignment.
2014-04-19 03:21:06 +03:00
Paul Sokolovsky
5695e07256
modstruct: Support 'q' & 'Q' type codes.
2014-04-19 03:18:14 +03:00
Damien George
71e9bfa20d
py: Add mp_binary_set_val_array_from_int, to store an int directly.
2014-04-18 23:28:12 +01:00
Paul Sokolovsky
0c43cf9154
modstruct: Basic implementation of native struct alignment and types.
2014-04-11 03:59:16 +03:00
Paul Sokolovsky
ef9124f5ff
binary: Rename array accessors for clarity.
2014-04-11 03:58:49 +03:00
Paul Sokolovsky
6582d64d01
modstruct: Refactor to support both LE and BE packed structs.
2014-04-11 03:58:49 +03:00