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 891947567b..03752ed938 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 6c22ea25de..4695bdc731 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 833d9c85ad..9eab01c4eb 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 66ea4ea446..8b4df93177 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 b9979af148..d49edd6ef3 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 841dd4aabb..3eb0d575b9 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 ea65183623..4649793134 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 a8a6265b8c..fbca3805b3 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 f9b9460837..17dc8f867c 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 8acee6c3ec..435e1b64d9 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 4dac5ffb09..49acc0bb1c 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 2e76420a21..bea1af4dbf 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 90b7b89e5d..65bfea0b35 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 f69c395e7e..5d1113fb30 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 76e90671be..666dbfa37c 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 89dc80b004..51bc915b22 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 b180ddf6b5..8e90849e93 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 4020401622..dcc13c52cc 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 2b9f531f96..3ff567f1d9 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 14f204b8be..ddd8abf71e 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 2f732085ff..5cd0b317a1 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 a82a7a0ebe..f136ce733d 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 e2ebc990b9..ef3b29b53f 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 ff6129c5bc..0d0d13b4e2 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 c1a293a531..bbb315189b 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 ae6cb9eb90..2e40264e8d 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 519d470b0a..1e7f7eff7f 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 ab300b91df..3f1e859fc6 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 2fdf30b23c..37414464de 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 af09c335f2..492c1678b5 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 3ead5a3031..105afe711e 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 36b0690501..b9801ab6a1 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 ce140655bd..4fddac9c3d 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 e631f8654a..ca1e3e919b 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 7ccb34f1c3..10bc20ecba 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 457ce165b7..2c3dfbd4d9 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 839e8216c1..83c2b6e07c 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 5543f126c3..c57f364e36 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 c8faa57009..88f835131d 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 ea6a1c937f..f8b7e4dabc 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)