aboutsummaryrefslogtreecommitdiff
path: root/extmod/moductypes.c
diff options
context:
space:
mode:
authorPaul Sokolovsky2015-12-04 00:58:46 +0200
committerPaul Sokolovsky2015-12-04 00:59:08 +0200
commitadd6f4556ed743e150db3a52f2dcab221ff731f1 (patch)
tree500bc73b011cd0fff8c9be66708ecde478c2cb73 /extmod/moductypes.c
parent7a99639cffb4397fa964268433d23b9ef0707892 (diff)
extmod/moductypes: set_aligned(): Handle INT64/UINT64.
Diffstat (limited to 'extmod/moductypes.c')
-rw-r--r--extmod/moductypes.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/extmod/moductypes.c b/extmod/moductypes.c
index 559339a7a..445808d3d 100644
--- a/extmod/moductypes.c
+++ b/extmod/moductypes.c
@@ -359,6 +359,15 @@ STATIC void set_aligned(uint val_type, void *p, mp_int_t index, mp_obj_t val) {
((uint32_t*)p)[index] = (uint32_t)v; return;
case INT32:
((int32_t*)p)[index] = (int32_t)v; return;
+ case INT64:
+ case UINT64:
+ if (sizeof(mp_int_t) == 8) {
+ ((uint64_t*)p)[index] = (uint64_t)v;
+ } else {
+ // TODO: Doesn't offer atomic store semantics, but should at least try
+ set_unaligned(val_type, p, MP_ENDIANNESS_BIG, val);
+ }
+ return;
default:
assert(0);
}