summaryrefslogtreecommitdiffstatshomepage
path: root/py/binary.c
Commit message (Collapse)AuthorAge
* py/binary: mp_binary_get_size: Raise error on unsupported typecodes.Paul Sokolovsky2017-01-17
| | | | | Previouly, we had errors checked in callers, which led to duplicate code or missing checks in some places.
* py/binary: Do zero extension when storing a value larger than word size.Damien George2016-12-12
|
* py: Wrap all obj-ptr conversions in MP_OBJ_TO_PTR/MP_OBJ_FROM_PTR.Damien George2015-11-29
| | | | | | | | | This allows the mp_obj_t type to be configured to something other than a pointer-sized primitive type. This patch also includes additional changes to allow the code to compile when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of mp_uint_t, and various casts.
* py/binary: Make use of MP_ALIGN.Damien George2015-11-27
|
* py/objarray: Allow to create array of void pointers, as extension to CPython.Paul Sokolovsky2015-10-12
| | | | | Using 'P' format specifier (matches struct module). This is another shortcut for FFI, just as previously introduced "array of objects" ('O').
* py/binary: Add support for array('q') and array('Q').Damien George2015-09-01
|
* py/binary: Make return type of mp_binary_get_size size_t instead of int.Kaspar Schleiser2015-05-17
| | | | Fixes sign-compare warning.
* py: Fix handling of negative numbers in struct.pack of q/Q.Damien George2015-04-25
|
* py: Support conversion of bignum to bytes.Damien George2015-04-25
| | | | | | | This gets int.to_bytes working for bignum, and also struct.pack with 'q' and 'Q' args on 32-bit machines. Addresses issue #1155.
* objarray: Support array('O'), array of objects, as extension to CPython.Paul Sokolovsky2015-03-05
| | | | Might be useful at least for memoryview hacks.
* py: Add support for floats in mp_binary_{get,set}_val()David Steinberg2015-01-27
| | | | - This then provides support for floats in the struct package
* binary: Rework array accessors. They work with native, not stdint types.Paul Sokolovsky2015-01-24
|
* py, unix: Allow to compile with -Wsign-compare.Damien George2015-01-16
| | | | See issue #699.
* py: Move to guarded includes, everywhere in py/ core.Damien George2015-01-01
| | | | Addresses issue #1022.
* py: Rename mp_obj_int_get to mp_obj_int_get_truncated; fix struct.pack.Damien George2014-12-05
| | | | | | | | | | | 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.
* py: Add support for float/double arrays in array module.Damien George2014-11-21
| | | | Addresses issue #981.
* py: Make mp_binary_set_val work on big endian machine.Damien George2014-10-06
|
* py: Convert [u]int to mp_[u]int_t where appropriate.Damien George2014-10-03
| | | | Addressing issue #50.
* py: Enable struct/binary-helper to parse q and Q sized ints.Damien George2014-09-10
| | | | Addresses issue #848.
* modstruct: Implement 'O', 'P', 's' types for packed structs.Paul Sokolovsky2014-09-06
| | | | This is required to deal with, well, packed C structs containing pointers.
* py: Change uint to mp_uint_t in runtime.h, stackctrl.h, binary.h.Damien George2014-08-30
| | | | Part of code cleanup, working towards resolving issue #50.
* py: binary.c: Properly implement alignment for native unpacked structs.Paul Sokolovsky2014-08-10
|
* binary: Factor out mp_binary_set_int().Paul Sokolovsky2014-07-05
|
* Rename machine_(u)int_t to mp_(u)int_t.Damien George2014-07-03
| | | | See discussion in issue #50.
* binary: machine_uint_t vs uint dichotomy starts doing real damage.Paul Sokolovsky2014-06-26
|
* modstruct: Fix alignment handling issues.Paul Sokolovsky2014-06-25
| | | | Also, factor out mp_binary_get_int() function.
* py: Include mpconfig.h before all other includes.Paul Sokolovsky2014-06-21
| | | | | | It defines types used by all other headers. Fixes #691.
* modstruct: Add one more extension to typecodes - 'S', a pointer to C string.Paul Sokolovsky2014-06-02
| | | | Also, add comment with description of extension to CPython's typecodes.
* Rename bultins config variables to MICROPY_PY_BUILTINS_*.Damien George2014-06-01
| | | | | | | | | | 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.
* Add license header to (almost) all files.Damien George2014-05-03
| | | | | | | 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/.
* modstruct: Add 'O' typecode for passing mp_obj_t.Paul Sokolovsky2014-04-20
| | | | Useful as callback data, etc.
* modstruct: Use proper int accessor which checks input value type.Paul Sokolovsky2014-04-20
|
* modstruct: Initial implementation of struct.pack().Paul Sokolovsky2014-04-19
|
* modstruct: Fix .calcsize() to account for struct type/alignment.Paul Sokolovsky2014-04-19
|
* modstruct: Support 'q' & 'Q' type codes.Paul Sokolovsky2014-04-19
|
* py: Add mp_binary_set_val_array_from_int, to store an int directly.Damien George2014-04-18
|
* modstruct: Basic implementation of native struct alignment and types.Paul Sokolovsky2014-04-11
|
* binary: Rename array accessors for clarity.Paul Sokolovsky2014-04-11
|
* modstruct: Refactor to support both LE and BE packed structs.Paul Sokolovsky2014-04-11
|
* py: Start implementing "struct" module.Paul Sokolovsky2014-04-10
| | | | | | | | | Only calcsize() and unpack() functions provided so far, for little-endian byte order. Format strings don't support repition spec (like "2b3i"). Unfortunately, dealing with all the various binary type sizes and alignments will lead to quite a bloated "binary" helper functions - if optimizing for speed. Need to think if using dynamic parametrized algos makes more sense.
* py: Clean up includes.xbe2014-03-17
| | | | Remove unnecessary includes. Add includes that improve portability.
* Add arbitrary precision integer support.Damien George2014-02-22
| | | | | Some functionality is still missing (eg and, or, bit shift), and some things are buggy (eg subtract).
* py: Revent some long int configuration.Damien George2014-02-15
|
* Small change to configuration of long int.Damien George2014-02-15
|
* mp_binary_get_val(): Fix value type.Paul Sokolovsky2014-02-15
|
* objarray: Refactor to use array accessors from binary.c .Paul Sokolovsky2014-02-14
|
* ffi: Implement ffivar.get()/set() methods.Paul Sokolovsky2014-02-14
Done by introducing another factored out helper API in binary.c. This API can be reused also by array and struct modules.