summaryrefslogtreecommitdiff
path: root/py/modstruct.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-10-06 15:05:35 +0000
committerDamien George <damien.p.george@gmail.com>2014-10-06 15:05:35 +0000
commit9336ee320a85527942d9ca2ddb95221d90582da0 (patch)
tree6e91cda3d03cc9d0e64da443cacf93293e9d5f40 /py/modstruct.c
parentfcdb2398156bb208c2bf54dd184835038f2398f5 (diff)
py: Make mp_binary_set_val work on big endian machine.
Diffstat (limited to 'py/modstruct.c')
-rw-r--r--py/modstruct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/modstruct.c b/py/modstruct.c
index 8122a9668..8c0cafda0 100644
--- a/py/modstruct.c
+++ b/py/modstruct.c
@@ -160,7 +160,7 @@ STATIC mp_obj_t struct_unpack(mp_obj_t fmt_in, mp_obj_t data_in) {
}
MP_DEFINE_CONST_FUN_OBJ_2(struct_unpack_obj, struct_unpack);
-STATIC mp_obj_t struct_pack(uint n_args, mp_obj_t *args) {
+STATIC mp_obj_t struct_pack(mp_uint_t n_args, const mp_obj_t *args) {
// TODO: "The arguments must match the values required by the format exactly."
const char *fmt = mp_obj_str_get_str(args[0]);
char fmt_type = get_fmt_type(&fmt);
@@ -169,7 +169,7 @@ STATIC mp_obj_t struct_pack(uint n_args, mp_obj_t *args) {
mp_obj_t res = mp_obj_str_builder_start(&mp_type_bytes, size, &p);
memset(p, 0, size);
- for (uint i = 1; i < n_args; i++) {
+ for (mp_uint_t i = 1; i < n_args; i++) {
mp_uint_t sz = 1;
if (unichar_isdigit(*fmt)) {
sz = get_fmt_num(&fmt);