Skip to content

Commit f3de62e

Browse files
committed
binary: machine_uint_t vs uint dichotomy starts doing real damage.
1 parent 8e01291 commit f3de62e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

py/binary.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte **ptr) {
155155
int size = mp_binary_get_size(struct_type, val_type, &align);
156156
if (struct_type == '@') {
157157
// Make pointer aligned
158-
p = (byte*)(((machine_uint_t)p + align - 1) & ~(align - 1));
158+
p = (byte*)(((machine_uint_t)p + align - 1) & ~((machine_uint_t)align - 1));
159159
#if MP_ENDIANNESS_LITTLE
160160
struct_type = '<';
161161
#else
@@ -184,7 +184,7 @@ void mp_binary_set_val(char struct_type, char val_type, mp_obj_t val_in, byte **
184184
int size = mp_binary_get_size(struct_type, val_type, &align);
185185
if (struct_type == '@') {
186186
// Make pointer aligned
187-
p = (byte*)(((machine_uint_t)p + align - 1) & ~(align - 1));
187+
p = (byte*)(((machine_uint_t)p + align - 1) & ~((machine_uint_t)align - 1));
188188
#if MP_ENDIANNESS_LITTLE
189189
struct_type = '<';
190190
#else

0 commit comments

Comments
 (0)