Skip to content

Commit

Permalink
all: Remove inclusion of internal py header files.
Browse files Browse the repository at this point in the history
Header files that are considered internal to the py core and should not
normally be included directly are:
    py/nlr.h - internal nlr configuration and declarations
    py/bc0.h - contains bytecode macro definitions
    py/runtime0.h - contains basic runtime enums

Instead, the top-level header files to include are one of:
    py/obj.h - includes runtime0.h and defines everything to use the
        mp_obj_t type
    py/runtime.h - includes mpstate.h and hence nlr.h, obj.h, runtime0.h,
        and defines everything to use the general runtime support functions

Additional, specific headers (eg py/objlist.h) can be included if needed.
  • Loading branch information
dpgeorge committed Oct 4, 2017
1 parent 6c82cfc commit a3dc1b1
Show file tree
Hide file tree
Showing 149 changed files with 3 additions and 226 deletions.
2 changes: 0 additions & 2 deletions drivers/cc3000/src/ccspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@

#include <string.h>

#include "py/nlr.h"
#include "py/obj.h"
#include "py/runtime.h"
#include "pin.h"
#include "led.h"
Expand Down
2 changes: 1 addition & 1 deletion extmod/machine_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* THE SOFTWARE.
*/

#include "py/runtime.h"
#include "extmod/machine_mem.h"
#include "py/nlr.h"

#if MICROPY_PY_MACHINE

Expand Down
2 changes: 0 additions & 2 deletions extmod/modbtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
#include <errno.h> // for declaration of global errno variable
#include <fcntl.h>

#include "py/nlr.h"
#include "py/runtime.h"
#include "py/runtime0.h"
#include "py/stream.h"

#if MICROPY_PY_BTREE
Expand Down
2 changes: 0 additions & 2 deletions extmod/modframebuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
#include <stdio.h>
#include <string.h>

#include "py/nlr.h"
#include "py/obj.h"
#include "py/runtime.h"

#if MICROPY_PY_FRAMEBUF
Expand Down
1 change: 0 additions & 1 deletion extmod/modlwip.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <string.h>
#include <stdio.h>

#include "py/nlr.h"
#include "py/objlist.h"
#include "py/runtime.h"
#include "py/stream.h"
Expand Down
1 change: 0 additions & 1 deletion extmod/modubinascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <assert.h>
#include <string.h>

#include "py/nlr.h"
#include "py/runtime.h"
#include "py/binary.h"
#include "extmod/modubinascii.h"
Expand Down
1 change: 0 additions & 1 deletion extmod/moductypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <string.h>
#include <stdint.h>

#include "py/nlr.h"
#include "py/runtime.h"
#include "py/objtuple.h"
#include "py/binary.h"
Expand Down
1 change: 0 additions & 1 deletion extmod/moduhashlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <assert.h>
#include <string.h>

#include "py/nlr.h"
#include "py/runtime.h"

#if MICROPY_PY_UHASHLIB
Expand Down
2 changes: 0 additions & 2 deletions extmod/moduheapq.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
* THE SOFTWARE.
*/

#include "py/nlr.h"
#include "py/objlist.h"
#include "py/runtime0.h"
#include "py/runtime.h"

#if MICROPY_PY_UHEAPQ
Expand Down
1 change: 0 additions & 1 deletion extmod/modujson.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

#include <stdio.h>

#include "py/nlr.h"
#include "py/objlist.h"
#include "py/objstringio.h"
#include "py/parsenum.h"
Expand Down
1 change: 0 additions & 1 deletion extmod/modurandom.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <assert.h>
#include <string.h>

//#include "py/nlr.h"
#include "py/runtime.h"

#if MICROPY_PY_URANDOM
Expand Down
1 change: 0 additions & 1 deletion extmod/modure.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <assert.h>
#include <string.h>

#include "py/nlr.h"
#include "py/runtime.h"
#include "py/binary.h"
#include "py/objstr.h"
Expand Down
1 change: 0 additions & 1 deletion extmod/modussl_axtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <stdio.h>
#include <string.h>

#include "py/nlr.h"
#include "py/runtime.h"
#include "py/stream.h"

Expand Down
2 changes: 0 additions & 2 deletions extmod/modussl_mbedtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@
#include <string.h>
#include <errno.h> // needed because mp_is_nonblocking_error uses system error codes

#include "py/nlr.h"
#include "py/runtime.h"
#include "py/stream.h"
#include "py/obj.h"

// mbedtls_time_t
#include "mbedtls/platform.h"
Expand Down
2 changes: 0 additions & 2 deletions extmod/modutimeq.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@

#include <string.h>

#include "py/nlr.h"
#include "py/objlist.h"
#include "py/runtime0.h"
#include "py/runtime.h"
#include "py/smallint.h"

Expand Down
1 change: 0 additions & 1 deletion extmod/moduzlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <stdio.h>
#include <string.h>

#include "py/nlr.h"
#include "py/runtime.h"
#include "py/stream.h"
#include "py/mperrno.h"
Expand Down
2 changes: 0 additions & 2 deletions extmod/modwebrepl.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
#include <stdint.h>
#include <string.h>

#include "py/nlr.h"
#include "py/obj.h"
#include "py/runtime.h"
#include "py/stream.h"
#include "py/builtin.h"
Expand Down
2 changes: 0 additions & 2 deletions extmod/modwebsocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
#include <stdint.h>
#include <string.h>

#include "py/nlr.h"
#include "py/obj.h"
#include "py/runtime.h"
#include "py/stream.h"
#include "extmod/modwebsocket.h"
Expand Down
1 change: 0 additions & 1 deletion extmod/uos_dupterm.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <string.h>
#include "py/mpconfig.h"

#include "py/nlr.h"
#include "py/runtime.h"
#include "py/objtuple.h"
#include "py/objarray.h"
Expand Down
1 change: 0 additions & 1 deletion extmod/vfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <stdint.h>
#include <string.h>

#include "py/runtime0.h"
#include "py/runtime.h"
#include "py/objstr.h"
#include "py/mperrno.h"
Expand Down
1 change: 0 additions & 1 deletion extmod/vfs_fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#endif

#include <string.h>
#include "py/nlr.h"
#include "py/runtime.h"
#include "py/mperrno.h"
#include "lib/oofatfs/ff.h"
Expand Down
1 change: 0 additions & 1 deletion extmod/vfs_fat_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

#include <stdio.h>

#include "py/nlr.h"
#include "py/runtime.h"
#include "py/stream.h"
#include "py/mperrno.h"
Expand Down
1 change: 0 additions & 1 deletion extmod/vfs_fat_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#if MICROPY_VFS_FAT

#include <string.h>
#include "py/nlr.h"
#include "py/runtime.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs_fat.h"
Expand Down
2 changes: 0 additions & 2 deletions lib/netutils/netutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
#include <stdio.h>
#include <string.h>

#include "py/obj.h"
#include "py/nlr.h"
#include "py/runtime.h"
#include "lib/netutils/netutils.h"

Expand Down
1 change: 0 additions & 1 deletion lib/utils/pyexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <stdint.h>
#include <string.h>

#include "py/nlr.h"
#include "py/compile.h"
#include "py/runtime.h"
#include "py/repl.h"
Expand Down
1 change: 0 additions & 1 deletion mpy-cross/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <stdlib.h>
#include <unistd.h>

#include "py/mpstate.h"
#include "py/compile.h"
#include "py/persistentcode.h"
#include "py/runtime.h"
Expand Down
1 change: 0 additions & 1 deletion ports/bare-arm/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <stdio.h>
#include <string.h>

#include "py/nlr.h"
#include "py/compile.h"
#include "py/runtime.h"
#include "py/repl.h"
Expand Down
3 changes: 1 addition & 2 deletions ports/cc3200/ftp/ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
#include <stdint.h>
#include <stdio.h>

#include "py/mpstate.h"
#include "py/obj.h"
#include "py/runtime.h"
#include "lib/timeutils/timeutils.h"
#include "lib/oofatfs/ff.h"
#include "extmod/vfs.h"
Expand Down
1 change: 0 additions & 1 deletion ports/cc3200/hal/cc3200_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <string.h>


#include "py/mpstate.h"
#include "py/mphal.h"
#include "py/runtime.h"
#include "py/objstr.h"
Expand Down
1 change: 0 additions & 1 deletion ports/cc3200/misc/mpexception.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <stdint.h>
#include <string.h>

#include "py/mpstate.h"
#include "mpexception.h"


Expand Down
1 change: 0 additions & 1 deletion ports/cc3200/mods/modmachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include <stdint.h>

#include "py/mpstate.h"
#include "py/runtime.h"
#include "py/mphal.h"
#include "irq.h"
Expand Down
3 changes: 0 additions & 3 deletions ports/cc3200/mods/modnetwork.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
* THE SOFTWARE.
*/

#include "py/mpstate.h"
#include "py/obj.h"
#include "py/nlr.h"
#include "py/runtime.h"
#include "py/mperrno.h"
#include "py/mphal.h"
Expand Down
2 changes: 0 additions & 2 deletions ports/cc3200/mods/modubinascii.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
* THE SOFTWARE.
*/

#include "py/mpconfig.h"
#include "py/nlr.h"
#include "py/runtime.h"
#include "py/binary.h"
#include "extmod/modubinascii.h"
Expand Down
1 change: 0 additions & 1 deletion ports/cc3200/mods/moduhashlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

#include "py/mpconfig.h"
#include MICROPY_HAL_H
#include "py/nlr.h"
#include "py/runtime.h"
#include "inc/hw_types.h"
#include "inc/hw_ints.h"
Expand Down
2 changes: 0 additions & 2 deletions ports/cc3200/mods/moduos.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
#include <stdint.h>
#include <string.h>

#include "py/mpstate.h"
#include "py/nlr.h"
#include "py/objtuple.h"
#include "py/objstr.h"
#include "py/runtime.h"
Expand Down
2 changes: 0 additions & 2 deletions ports/cc3200/mods/pybadc.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
#include <stdio.h>
#include <string.h>

#include "py/mpconfig.h"
#include "py/nlr.h"
#include "py/runtime.h"
#include "py/binary.h"
#include "py/gc.h"
Expand Down
1 change: 0 additions & 1 deletion ports/cc3200/mods/pybi2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <stdio.h>
#include <string.h>

#include "py/mpstate.h"
#include "py/runtime.h"
#include "py/mperrno.h"
#include "py/mphal.h"
Expand Down
3 changes: 0 additions & 3 deletions ports/cc3200/mods/pybpin.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@
#include <stdint.h>
#include <string.h>

#include "py/mpconfig.h"
#include "py/obj.h"
#include "py/runtime.h"
#include "py/gc.h"
#include "py/mpstate.h"
#include "inc/hw_types.h"
#include "inc/hw_gpio.h"
#include "inc/hw_ints.h"
Expand Down
1 change: 0 additions & 1 deletion ports/cc3200/mods/pybsleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <stdint.h>
#include <string.h>

#include "py/mpstate.h"
#include "py/runtime.h"
#include "py/mphal.h"
#include "inc/hw_types.h"
Expand Down
1 change: 0 additions & 1 deletion ports/cc3200/mods/pybspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include <stdint.h>
#include <string.h>

#include "py/mpstate.h"
#include "py/runtime.h"
#include "py/mperrno.h"
#include "bufhelper.h"
Expand Down
3 changes: 0 additions & 3 deletions ports/cc3200/mods/pybtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
#include <stdio.h>
#include <string.h>

#include "py/mpconfig.h"
#include "py/obj.h"
#include "py/nlr.h"
#include "py/runtime.h"
#include "py/gc.h"
#include "py/mperrno.h"
Expand Down
3 changes: 0 additions & 3 deletions ports/cc3200/mods/pybuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
#include <stdio.h>
#include <string.h>

#include "py/mpconfig.h"
#include "py/obj.h"
#include "py/runtime.h"
#include "py/objlist.h"
#include "py/stream.h"
Expand All @@ -48,7 +46,6 @@
#include "mpirq.h"
#include "pybsleep.h"
#include "mpexception.h"
#include "py/mpstate.h"
#include "osi.h"
#include "utils.h"
#include "pin.h"
Expand Down
2 changes: 0 additions & 2 deletions ports/cc3200/mpthreadport.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

#include <stdio.h>

#include "py/mpconfig.h"
#include "py/mpstate.h"
#include "py/runtime.h"
#include "py/gc.h"
#include "py/mpthread.h"
Expand Down
2 changes: 0 additions & 2 deletions ports/cc3200/util/gccollect.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
#include <stdio.h>
#include <stdint.h>

#include "py/mpconfig.h"
#include "py/mpstate.h"
#include "py/gc.h"
#include "py/mpthread.h"
#include "gccollect.h"
Expand Down
Loading

0 comments on commit a3dc1b1

Please sign in to comment.