Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
f3de62e6
Commit
f3de62e6
authored
Jun 26, 2014
by
Paul Sokolovsky
Browse files
binary: machine_uint_t vs uint dichotomy starts doing real damage.
parent
8e01291c
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/binary.c
View file @
f3de62e6
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment