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
7f5a541b
Commit
7f5a541b
authored
Sep 21, 2016
by
Pavol Rusnak
Committed by
Paul Sokolovsky
Sep 21, 2016
Browse files
extmod/modubinascii: Fix crc32() function on 32-bit platforms.
parent
b84e1231
Changes
1
Hide whitespace changes
Inline
Side-by-side
extmod/modubinascii.c
View file @
7f5a541b
...
...
@@ -208,9 +208,9 @@ MP_DEFINE_CONST_FUN_OBJ_1(mod_binascii_b2a_base64_obj, mod_binascii_b2a_base64);
mp_obj_t
mod_binascii_crc32
(
size_t
n_args
,
const
mp_obj_t
*
args
)
{
mp_buffer_info_t
bufinfo
;
mp_get_buffer_raise
(
args
[
0
],
&
bufinfo
,
MP_BUFFER_READ
);
uint32_t
crc
=
(
n_args
>
1
)
?
mp_obj_get_int
(
args
[
1
])
:
0
;
uint32_t
crc
=
(
n_args
>
1
)
?
mp_obj_get_int
_truncated
(
args
[
1
])
:
0
;
crc
=
uzlib_crc32
(
bufinfo
.
buf
,
bufinfo
.
len
,
crc
^
0xffffffff
);
return
MP_OBJ_NEW_SMALL_INT
(
crc
^
0xffffffff
);
return
mp_obj_new_int_from_uint
(
crc
^
0xffffffff
);
}
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
mod_binascii_crc32_obj
,
1
,
2
,
mod_binascii_crc32
);
#endif
...
...
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