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
5695e072
Commit
5695e072
authored
Apr 19, 2014
by
Paul Sokolovsky
Browse files
modstruct: Support 'q' & 'Q' type codes.
parent
752d2080
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/binary.c
View file @
5695e072
...
...
@@ -92,6 +92,8 @@ mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte **ptr) {
size
=
4
;
break
;
case
'l'
:
case
'L'
:
size
=
4
;
break
;
case
'q'
:
case
'Q'
:
size
=
8
;
break
;
}
break
;
case
'@'
:
{
...
...
@@ -112,6 +114,9 @@ mp_obj_t mp_binary_get_val(char struct_type, char val_type, byte **ptr) {
align
=
size
=
sizeof
(
int
);
break
;
case
'l'
:
case
'L'
:
align
=
size
=
sizeof
(
long
);
break
;
case
'q'
:
case
'Q'
:
// TODO: This is for x86
align
=
sizeof
(
int
);
size
=
sizeof
(
long
long
);
break
;
}
// Make pointer aligned
p
=
(
byte
*
)(((
machine_uint_t
)
p
+
align
-
1
)
&
~
(
align
-
1
));
...
...
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