From 759138caee65a58ecf1f02ca7c57bc9ba3d3c5f5 Mon Sep 17 00:00:00 2001 From: stijn Date: Mon, 1 Sep 2014 10:16:07 +0200 Subject: [PATCH 1/2] msvc: Exclude modtermios, include extmod and fix compilation error --- extmod/modzlibd.c | 2 +- windows/mpconfigport.h | 2 ++ windows/msvc/sources.props | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/extmod/modzlibd.c b/extmod/modzlibd.c index dbf992f919..696b7c8ecf 100644 --- a/extmod/modzlibd.c +++ b/extmod/modzlibd.c @@ -64,7 +64,7 @@ STATIC mp_obj_t mod_zlibd_decompress(uint n_args, mp_obj_t *args) { size_t in_buf_sz = bufinfo.len - in_buf_ofs; DEBUG_printf("tinfl in: in_ofs=%d in_sz=%d dst_ofs=%d, dst_sz=%d\n", in_buf_ofs, in_buf_sz, dst_buf_ofs, dst_buf_sz); tinfl_status st = tinfl_decompress(decomp, - bufinfo.buf + in_buf_ofs, &in_buf_sz, + (mz_uint8*) bufinfo.buf + in_buf_ofs, &in_buf_sz, out, out + dst_buf_ofs, &dst_buf_sz, TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF | TINFL_FLAG_PARSE_ZLIB_HEADER); DEBUG_printf("tinfl out: st=%d, in_sz=%d, out_sz=%d\n", st, in_buf_sz, dst_buf_sz); diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h index c5def75923..852ca3f5fb 100644 --- a/windows/mpconfigport.h +++ b/windows/mpconfigport.h @@ -54,6 +54,8 @@ #define MICROPY_PY_CMATH (1) #define MICROPY_PY_IO_FILEIO (1) #define MICROPY_PY_GC_COLLECT_RETVAL (1) +#define MICROPY_PY_UCTYPES (1) +#define MICROPY_PY_ZLIBD (1) #define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED) #ifdef _MSC_VER #define MICROPY_GCREGS_SETJMP (1) diff --git a/windows/msvc/sources.props b/windows/msvc/sources.props index 6fd3306b92..b48277ff29 100644 --- a/windows/msvc/sources.props +++ b/windows/msvc/sources.props @@ -5,7 +5,8 @@ - + + From e875e3882d9c567a8b2dc88e9f13e1057fc39e9f Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 2 Sep 2014 11:38:45 +0100 Subject: [PATCH 2/2] extmod: Fix type-punned-ptr error. --- extmod/moductypes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extmod/moductypes.c b/extmod/moductypes.c index 0f28a34688..73a8db7cc0 100644 --- a/extmod/moductypes.c +++ b/extmod/moductypes.c @@ -261,10 +261,10 @@ STATIC inline mp_obj_t get_unaligned(uint val_type, void *p, int big_endian) { } } -STATIC inline void set_unaligned(uint val_type, void *p, int big_endian, mp_obj_t val) { +STATIC inline void set_unaligned(uint val_type, byte *p, int big_endian, mp_obj_t val) { char struct_type = big_endian ? '>' : '<'; static const char type2char[8] = "BbHhIiQq"; - mp_binary_set_val(struct_type, type2char[val_type], val, (byte**)&p); + mp_binary_set_val(struct_type, type2char[val_type], val, &p); } static inline mp_uint_t get_aligned_basic(uint val_type, void *p) {