diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-06-26 00:41:08 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-06-26 00:41:08 +0300 |
commit | f3de62e6c248a4ac6db9e68ed9534e0ec1093a2e (patch) | |
tree | 03533cf44b744b24379a2afc2dde010bc78aff34 /py | |
parent | 8e01291c18c8221ee7d8e457afc8c7a4fc94ef3f (diff) | |
download | micropython-f3de62e6c248a4ac6db9e68ed9534e0ec1093a2e.tar.gz micropython-f3de62e6c248a4ac6db9e68ed9534e0ec1093a2e.zip |
binary: machine_uint_t vs uint dichotomy starts doing real damage.
Diffstat (limited to 'py')
-rw-r--r-- | py/binary.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/binary.c b/py/binary.c index bc06f9b6f5..d755bc86e0 100644 --- a/py/binary.c +++ b/py/binary.c @@ -155,7 +155,7 @@ mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte **ptr) { int size = mp_binary_get_size(struct_type, val_type, &align); if (struct_type == '@') { // Make pointer aligned - p = (byte*)(((machine_uint_t)p + align - 1) & ~(align - 1)); + p = (byte*)(((machine_uint_t)p + align - 1) & ~((machine_uint_t)align - 1)); #if MP_ENDIANNESS_LITTLE struct_type = '<'; #else @@ -184,7 +184,7 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte ** int size = mp_binary_get_size(struct_type, val_type, &align); if (struct_type == '@') { // Make pointer aligned - p = (byte*)(((machine_uint_t)p + align - 1) & ~(align - 1)); + p = (byte*)(((machine_uint_t)p + align - 1) & ~((machine_uint_t)align - 1)); #if MP_ENDIANNESS_LITTLE struct_type = '<'; #else |