From 5695e07256413fab8b280a939c264b06f7f5793f Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 19 Apr 2014 00:21:22 +0300 Subject: [PATCH] modstruct: Support 'q' & 'Q' type codes. --- py/binary.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/py/binary.c b/py/binary.c index d3dd009546..0c9db9bd80 100644 --- a/py/binary.c +++ b/py/binary.c @@ -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));