Skip to content

Commit

Permalink
py: Include mpconfig.h before all other includes.
Browse files Browse the repository at this point in the history
It defines types used by all other headers.

Fixes micropython#691.
  • Loading branch information
pfalcon committed Jun 21, 2014
1 parent 4c4b9d1 commit 59c675a
Show file tree
Hide file tree
Showing 40 changed files with 39 additions and 40 deletions.
2 changes: 1 addition & 1 deletion py/asmthumb.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include <assert.h>
#include <string.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "asmthumb.h"

// wrapper around everything in this file
Expand Down
2 changes: 1 addition & 1 deletion py/asmx64.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#include <assert.h>
#include <string.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"

// wrapper around everything in this file
#if MICROPY_EMIT_X64
Expand Down
2 changes: 1 addition & 1 deletion py/binary.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#include <string.h>
#include <assert.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "binary.h"
Expand Down
2 changes: 1 addition & 1 deletion py/builtintables.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

#include <stdlib.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "builtin.h"
Expand Down
2 changes: 1 addition & 1 deletion py/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include <assert.h>
#include <math.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "lexer.h"
#include "parse.h"
Expand Down
2 changes: 1 addition & 1 deletion py/emitbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include <string.h>
#include <assert.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "lexer.h"
#include "parse.h"
Expand Down
2 changes: 1 addition & 1 deletion py/emitcommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include <stdint.h>
#include <assert.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "lexer.h"
#include "parse.h"
Expand Down
2 changes: 1 addition & 1 deletion py/emitcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include <string.h>
#include <assert.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "lexer.h"
#include "parse.h"
Expand Down
2 changes: 1 addition & 1 deletion py/emitglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include <string.h>
#include <assert.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "runtime0.h"
Expand Down
2 changes: 1 addition & 1 deletion py/emitinlinethumb.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include <stdarg.h>
#include <assert.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "lexer.h"
#include "parse.h"
Expand Down
2 changes: 1 addition & 1 deletion py/emitnative.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
#include <string.h>
#include <assert.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "lexer.h"
#include "parse.h"
Expand Down
2 changes: 1 addition & 1 deletion py/emitpass1.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include <stdint.h>
#include <assert.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "lexer.h"
#include "parse.h"
Expand Down
1 change: 0 additions & 1 deletion py/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "misc.h"
#include "gc.h"

#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
Expand Down
2 changes: 1 addition & 1 deletion py/lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
#include <stdio.h>
#include <assert.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "lexer.h"

Expand Down
2 changes: 1 addition & 1 deletion py/lexerstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* THE SOFTWARE.
*/

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "lexer.h"

Expand Down
2 changes: 1 addition & 1 deletion py/lexerunix.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* THE SOFTWARE.
*/

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"

#if MICROPY_HELPER_LEXER_UNIX

Expand Down
2 changes: 1 addition & 1 deletion py/malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include <stdlib.h>
#include <string.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"

#if 0 // print debugging info
#define DEBUG_printf DEBUG_printf
Expand Down
2 changes: 1 addition & 1 deletion py/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include <stdlib.h>
#include <assert.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "runtime0.h"
Expand Down
2 changes: 1 addition & 1 deletion py/modarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* THE SOFTWARE.
*/

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "builtin.h"
Expand Down
2 changes: 1 addition & 1 deletion py/modcmath.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

#include <math.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "builtin.h"
Expand Down
2 changes: 1 addition & 1 deletion py/modcollections.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* THE SOFTWARE.
*/

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "builtin.h"
Expand Down
2 changes: 1 addition & 1 deletion py/modgc.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* THE SOFTWARE.
*/

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "builtin.h"
Expand Down
2 changes: 1 addition & 1 deletion py/modio.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* THE SOFTWARE.
*/

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "builtin.h"
Expand Down
2 changes: 1 addition & 1 deletion py/modmath.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

#include <math.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "builtin.h"
Expand Down
2 changes: 1 addition & 1 deletion py/modmicropython.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* THE SOFTWARE.
*/

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "builtin.h"
Expand Down
2 changes: 1 addition & 1 deletion py/modstruct.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

#include <assert.h>
#include <string.h>
#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "builtin.h"
Expand Down
2 changes: 1 addition & 1 deletion py/modsys.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* THE SOFTWARE.
*/

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "builtin.h"
Expand Down
2 changes: 1 addition & 1 deletion py/mpz.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include <string.h>
#include <assert.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "mpz.h"

#if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_MPZ
Expand Down
2 changes: 1 addition & 1 deletion py/objenumerate.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include <stdlib.h>
#include <assert.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
Expand Down
2 changes: 1 addition & 1 deletion py/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include <assert.h>
#include <string.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "lexer.h"
#include "parsenumbase.h"
Expand Down
2 changes: 1 addition & 1 deletion py/parsehelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#include <stdint.h>
#include <stdio.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "lexer.h"
#include "parse.h"
Expand Down
2 changes: 1 addition & 1 deletion py/parsenum.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include <stdbool.h>
#include <stdlib.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "nlr.h"
#include "obj.h"
Expand Down
2 changes: 1 addition & 1 deletion py/parsenumbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion py/pfenv.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include <stdint.h>
#include <string.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "mpz.h"
Expand Down
2 changes: 1 addition & 1 deletion py/qstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include <assert.h>
#include <string.h>

#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)
Expand Down
2 changes: 1 addition & 1 deletion py/repl.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* THE SOFTWARE.
*/

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "repl.h"

#if MICROPY_HELPER_REPL
Expand Down
2 changes: 1 addition & 1 deletion py/scope.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#include <stdio.h>
#include <assert.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "parse.h"
Expand Down
2 changes: 1 addition & 1 deletion py/smallint.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* THE SOFTWARE.
*/

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "smallint.h"
Expand Down
2 changes: 1 addition & 1 deletion py/unicode.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

#include <stdint.h>

#include "misc.h"
#include "mpconfig.h"
#include "misc.h"

// attribute flags
#define FL_PRINT (0x01)
Expand Down
2 changes: 1 addition & 1 deletion py/vstr.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#include <stdarg.h>
#include <string.h>
#include <assert.h>
#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)
Expand Down

0 comments on commit 59c675a

Please sign in to comment.