From 59c675a64c1d9757d50ad4627da67a6f996a99fb Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 21 Jun 2014 22:43:22 +0300 Subject: [PATCH] py: Include mpconfig.h before all other includes. It defines types used by all other headers. Fixes #691. --- py/asmthumb.c | 2 +- py/asmx64.c | 2 +- py/binary.c | 2 +- py/builtintables.c | 2 +- py/compile.c | 2 +- py/emitbc.c | 2 +- py/emitcommon.c | 2 +- py/emitcpy.c | 2 +- py/emitglue.c | 2 +- py/emitinlinethumb.c | 2 +- py/emitnative.c | 2 +- py/emitpass1.c | 2 +- py/gc.c | 1 - py/lexer.c | 2 +- py/lexerstr.c | 2 +- py/lexerunix.c | 2 +- py/malloc.c | 2 +- py/map.c | 2 +- py/modarray.c | 2 +- py/modcmath.c | 2 +- py/modcollections.c | 2 +- py/modgc.c | 2 +- py/modio.c | 2 +- py/modmath.c | 2 +- py/modmicropython.c | 2 +- py/modstruct.c | 2 +- py/modsys.c | 2 +- py/mpz.c | 2 +- py/objenumerate.c | 2 +- py/parse.c | 2 +- py/parsehelper.c | 2 +- py/parsenum.c | 2 +- py/parsenumbase.c | 2 +- py/pfenv.c | 2 +- py/qstr.c | 2 +- py/repl.c | 2 +- py/scope.c | 2 +- py/smallint.c | 2 +- py/unicode.c | 2 +- py/vstr.c | 2 +- 40 files changed, 39 insertions(+), 40 deletions(-) diff --git a/py/asmthumb.c b/py/asmthumb.c index 891947567b33..03752ed93813 100644 --- a/py/asmthumb.c +++ b/py/asmthumb.c @@ -28,8 +28,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "asmthumb.h" // wrapper around everything in this file diff --git a/py/asmx64.c b/py/asmx64.c index 6c22ea25de57..4695bdc731fd 100644 --- a/py/asmx64.c +++ b/py/asmx64.c @@ -29,8 +29,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" // wrapper around everything in this file #if MICROPY_EMIT_X64 diff --git a/py/binary.c b/py/binary.c index 833d9c85ad2e..9eab01c4ebac 100644 --- a/py/binary.c +++ b/py/binary.c @@ -29,8 +29,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "binary.h" diff --git a/py/builtintables.c b/py/builtintables.c index 66ea4ea446c1..8b4df9317706 100644 --- a/py/builtintables.c +++ b/py/builtintables.c @@ -26,8 +26,8 @@ #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "builtin.h" diff --git a/py/compile.c b/py/compile.c index b9979af14854..d49edd6ef3d4 100644 --- a/py/compile.c +++ b/py/compile.c @@ -31,8 +31,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "lexer.h" #include "parse.h" diff --git a/py/emitbc.c b/py/emitbc.c index 841dd4aabb57..3eb0d575b959 100644 --- a/py/emitbc.c +++ b/py/emitbc.c @@ -30,8 +30,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "lexer.h" #include "parse.h" diff --git a/py/emitcommon.c b/py/emitcommon.c index ea651836235b..4649793134d4 100644 --- a/py/emitcommon.c +++ b/py/emitcommon.c @@ -28,8 +28,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "lexer.h" #include "parse.h" diff --git a/py/emitcpy.c b/py/emitcpy.c index a8a6265b8cfe..fbca3805b33d 100644 --- a/py/emitcpy.c +++ b/py/emitcpy.c @@ -30,8 +30,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "lexer.h" #include "parse.h" diff --git a/py/emitglue.c b/py/emitglue.c index f9b9460837c4..17dc8f867c13 100644 --- a/py/emitglue.c +++ b/py/emitglue.c @@ -30,8 +30,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "runtime0.h" diff --git a/py/emitinlinethumb.c b/py/emitinlinethumb.c index 8acee6c3ec7a..435e1b64d9c0 100644 --- a/py/emitinlinethumb.c +++ b/py/emitinlinethumb.c @@ -30,8 +30,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "lexer.h" #include "parse.h" diff --git a/py/emitnative.c b/py/emitnative.c index 4dac5ffb091b..49acc0bb1c90 100644 --- a/py/emitnative.c +++ b/py/emitnative.c @@ -48,8 +48,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "lexer.h" #include "parse.h" diff --git a/py/emitpass1.c b/py/emitpass1.c index 2e76420a212a..bea1af4dbf76 100644 --- a/py/emitpass1.c +++ b/py/emitpass1.c @@ -28,8 +28,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "lexer.h" #include "parse.h" diff --git a/py/gc.c b/py/gc.c index 90b7b89e5d95..65bfea0b35a3 100644 --- a/py/gc.c +++ b/py/gc.c @@ -33,7 +33,6 @@ #include "misc.h" #include "gc.h" -#include "misc.h" #include "qstr.h" #include "obj.h" #include "runtime.h" diff --git a/py/lexer.c b/py/lexer.c index f69c395e7e45..5d1113fb300f 100644 --- a/py/lexer.c +++ b/py/lexer.c @@ -32,8 +32,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "lexer.h" diff --git a/py/lexerstr.c b/py/lexerstr.c index 76e90671bea0..666dbfa37c34 100644 --- a/py/lexerstr.c +++ b/py/lexerstr.c @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "lexer.h" diff --git a/py/lexerunix.c b/py/lexerunix.c index 89dc80b004a1..51bc915b228f 100644 --- a/py/lexerunix.c +++ b/py/lexerunix.c @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #if MICROPY_HELPER_LEXER_UNIX diff --git a/py/malloc.c b/py/malloc.c index b180ddf6b596..8e90849e93dd 100644 --- a/py/malloc.c +++ b/py/malloc.c @@ -28,8 +28,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #if 0 // print debugging info #define DEBUG_printf DEBUG_printf diff --git a/py/map.c b/py/map.c index 40204016220f..dcc13c52cc63 100644 --- a/py/map.c +++ b/py/map.c @@ -27,8 +27,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "runtime0.h" diff --git a/py/modarray.c b/py/modarray.c index 2b9f531f963e..3ff567f1d949 100644 --- a/py/modarray.c +++ b/py/modarray.c @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "builtin.h" diff --git a/py/modcmath.c b/py/modcmath.c index 14f204b8be9c..ddd8abf71ed5 100644 --- a/py/modcmath.c +++ b/py/modcmath.c @@ -26,8 +26,8 @@ #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "builtin.h" diff --git a/py/modcollections.c b/py/modcollections.c index 2f732085ff19..5cd0b317a12e 100644 --- a/py/modcollections.c +++ b/py/modcollections.c @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "builtin.h" diff --git a/py/modgc.c b/py/modgc.c index a82a7a0ebef1..f136ce733df3 100644 --- a/py/modgc.c +++ b/py/modgc.c @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "builtin.h" diff --git a/py/modio.c b/py/modio.c index e2ebc990b9b5..ef3b29b53ffe 100644 --- a/py/modio.c +++ b/py/modio.c @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "builtin.h" diff --git a/py/modmath.c b/py/modmath.c index ff6129c5bc81..0d0d13b4e2e1 100644 --- a/py/modmath.c +++ b/py/modmath.c @@ -26,8 +26,8 @@ #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "builtin.h" diff --git a/py/modmicropython.c b/py/modmicropython.c index c1a293a531e2..bbb315189b14 100644 --- a/py/modmicropython.c +++ b/py/modmicropython.c @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "builtin.h" diff --git a/py/modstruct.c b/py/modstruct.c index ae6cb9eb901e..2e40264e8df5 100644 --- a/py/modstruct.c +++ b/py/modstruct.c @@ -27,8 +27,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "builtin.h" diff --git a/py/modsys.c b/py/modsys.c index 519d470b0a00..1e7f7eff7f97 100644 --- a/py/modsys.c +++ b/py/modsys.c @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "builtin.h" diff --git a/py/mpz.c b/py/mpz.c index ab300b91dfc1..3f1e859fc6ba 100644 --- a/py/mpz.c +++ b/py/mpz.c @@ -30,8 +30,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "mpz.h" #if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_MPZ diff --git a/py/objenumerate.c b/py/objenumerate.c index 2fdf30b23cfe..37414464de2d 100644 --- a/py/objenumerate.c +++ b/py/objenumerate.c @@ -27,8 +27,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "runtime.h" diff --git a/py/parse.c b/py/parse.c index af09c335f253..492c1678b5cd 100644 --- a/py/parse.c +++ b/py/parse.c @@ -30,8 +30,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "lexer.h" #include "parsenumbase.h" diff --git a/py/parsehelper.c b/py/parsehelper.c index 3ead5a3031c8..105afe711edd 100644 --- a/py/parsehelper.c +++ b/py/parsehelper.c @@ -29,8 +29,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "lexer.h" #include "parse.h" diff --git a/py/parsenum.c b/py/parsenum.c index 36b069050173..b9801ab6a1ca 100644 --- a/py/parsenum.c +++ b/py/parsenum.c @@ -27,8 +27,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "nlr.h" #include "obj.h" diff --git a/py/parsenumbase.c b/py/parsenumbase.c index ce140655bd91..4fddac9c3d61 100644 --- a/py/parsenumbase.c +++ b/py/parsenumbase.c @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "parsenumbase.h" // find real radix base, and strip preceding '0x', '0o' and '0b' diff --git a/py/pfenv.c b/py/pfenv.c index e631f8654a30..ca1e3e919bc3 100644 --- a/py/pfenv.c +++ b/py/pfenv.c @@ -27,8 +27,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "mpz.h" diff --git a/py/qstr.c b/py/qstr.c index 7ccb34f1c3e4..10bc20ecba25 100644 --- a/py/qstr.c +++ b/py/qstr.c @@ -27,8 +27,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" // NOTE: we are using linear arrays to store and search for qstr's (unique strings, interned strings) diff --git a/py/repl.c b/py/repl.c index 457ce165b7a3..2c3dfbd4d996 100644 --- a/py/repl.c +++ b/py/repl.c @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "repl.h" #if MICROPY_HELPER_REPL diff --git a/py/scope.c b/py/scope.c index 839e8216c107..83c2b6e07c13 100644 --- a/py/scope.c +++ b/py/scope.c @@ -29,8 +29,8 @@ #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "parse.h" diff --git a/py/smallint.c b/py/smallint.c index 5543f126c354..c57f364e36d5 100644 --- a/py/smallint.c +++ b/py/smallint.c @@ -24,8 +24,8 @@ * THE SOFTWARE. */ -#include "misc.h" #include "mpconfig.h" +#include "misc.h" #include "qstr.h" #include "obj.h" #include "smallint.h" diff --git a/py/unicode.c b/py/unicode.c index c8faa57009bf..88f835131d77 100644 --- a/py/unicode.c +++ b/py/unicode.c @@ -26,8 +26,8 @@ #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" // attribute flags #define FL_PRINT (0x01) diff --git a/py/vstr.c b/py/vstr.c index ea6a1c937f9e..f8b7e4dabcfd 100644 --- a/py/vstr.c +++ b/py/vstr.c @@ -29,8 +29,8 @@ #include #include #include -#include "misc.h" #include "mpconfig.h" +#include "misc.h" // returned value is always at least 1 greater than argument #define ROUND_ALLOC(a) (((a) & ((~0) - 7)) + 8)