Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit a3dc1b1

Browse files
committed
all: Remove inclusion of internal py header files.
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.
1 parent 6c82cfc commit a3dc1b1

File tree

149 files changed

+3
-226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+3
-226
lines changed

drivers/cc3000/src/ccspi.c

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434

3535
#include <string.h>
3636

37-
#include "py/nlr.h"
38-
#include "py/obj.h"
3937
#include "py/runtime.h"
4038
#include "pin.h"
4139
#include "led.h"

extmod/machine_mem.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
* THE SOFTWARE.
2525
*/
2626

27+
#include "py/runtime.h"
2728
#include "extmod/machine_mem.h"
28-
#include "py/nlr.h"
2929

3030
#if MICROPY_PY_MACHINE
3131

extmod/modbtree.c

-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
#include <errno.h> // for declaration of global errno variable
3030
#include <fcntl.h>
3131

32-
#include "py/nlr.h"
3332
#include "py/runtime.h"
34-
#include "py/runtime0.h"
3533
#include "py/stream.h"
3634

3735
#if MICROPY_PY_BTREE

extmod/modframebuf.c

-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
#include <stdio.h>
2828
#include <string.h>
2929

30-
#include "py/nlr.h"
31-
#include "py/obj.h"
3230
#include "py/runtime.h"
3331

3432
#if MICROPY_PY_FRAMEBUF

extmod/modlwip.c

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <string.h>
3030
#include <stdio.h>
3131

32-
#include "py/nlr.h"
3332
#include "py/objlist.h"
3433
#include "py/runtime.h"
3534
#include "py/stream.h"

extmod/modubinascii.c

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <assert.h>
2929
#include <string.h>
3030

31-
#include "py/nlr.h"
3231
#include "py/runtime.h"
3332
#include "py/binary.h"
3433
#include "extmod/modubinascii.h"

extmod/moductypes.c

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <string.h>
2929
#include <stdint.h>
3030

31-
#include "py/nlr.h"
3231
#include "py/runtime.h"
3332
#include "py/objtuple.h"
3433
#include "py/binary.h"

extmod/moduhashlib.c

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <assert.h>
2828
#include <string.h>
2929

30-
#include "py/nlr.h"
3130
#include "py/runtime.h"
3231

3332
#if MICROPY_PY_UHASHLIB

extmod/moduheapq.c

-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#include "py/nlr.h"
2827
#include "py/objlist.h"
29-
#include "py/runtime0.h"
3028
#include "py/runtime.h"
3129

3230
#if MICROPY_PY_UHEAPQ

extmod/modujson.c

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
#include <stdio.h>
2828

29-
#include "py/nlr.h"
3029
#include "py/objlist.h"
3130
#include "py/objstringio.h"
3231
#include "py/parsenum.h"

extmod/modurandom.c

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <assert.h>
2828
#include <string.h>
2929

30-
//#include "py/nlr.h"
3130
#include "py/runtime.h"
3231

3332
#if MICROPY_PY_URANDOM

extmod/modure.c

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <assert.h>
2929
#include <string.h>
3030

31-
#include "py/nlr.h"
3231
#include "py/runtime.h"
3332
#include "py/binary.h"
3433
#include "py/objstr.h"

extmod/modussl_axtls.c

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <stdio.h>
2828
#include <string.h>
2929

30-
#include "py/nlr.h"
3130
#include "py/runtime.h"
3231
#include "py/stream.h"
3332

extmod/modussl_mbedtls.c

-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@
3131
#include <string.h>
3232
#include <errno.h> // needed because mp_is_nonblocking_error uses system error codes
3333

34-
#include "py/nlr.h"
3534
#include "py/runtime.h"
3635
#include "py/stream.h"
37-
#include "py/obj.h"
3836

3937
// mbedtls_time_t
4038
#include "mbedtls/platform.h"

extmod/modutimeq.c

-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727

2828
#include <string.h>
2929

30-
#include "py/nlr.h"
3130
#include "py/objlist.h"
32-
#include "py/runtime0.h"
3331
#include "py/runtime.h"
3432
#include "py/smallint.h"
3533

extmod/moduzlib.c

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <stdio.h>
2828
#include <string.h>
2929

30-
#include "py/nlr.h"
3130
#include "py/runtime.h"
3231
#include "py/stream.h"
3332
#include "py/mperrno.h"

extmod/modwebrepl.c

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include <stdint.h>
2929
#include <string.h>
3030

31-
#include "py/nlr.h"
32-
#include "py/obj.h"
3331
#include "py/runtime.h"
3432
#include "py/stream.h"
3533
#include "py/builtin.h"

extmod/modwebsocket.c

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include <stdint.h>
2929
#include <string.h>
3030

31-
#include "py/nlr.h"
32-
#include "py/obj.h"
3331
#include "py/runtime.h"
3432
#include "py/stream.h"
3533
#include "extmod/modwebsocket.h"

extmod/uos_dupterm.c

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <string.h>
2828
#include "py/mpconfig.h"
2929

30-
#include "py/nlr.h"
3130
#include "py/runtime.h"
3231
#include "py/objtuple.h"
3332
#include "py/objarray.h"

extmod/vfs.c

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <stdint.h>
2828
#include <string.h>
2929

30-
#include "py/runtime0.h"
3130
#include "py/runtime.h"
3231
#include "py/objstr.h"
3332
#include "py/mperrno.h"

extmod/vfs_fat.c

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#endif
3434

3535
#include <string.h>
36-
#include "py/nlr.h"
3736
#include "py/runtime.h"
3837
#include "py/mperrno.h"
3938
#include "lib/oofatfs/ff.h"

extmod/vfs_fat_file.c

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
#include <stdio.h>
3131

32-
#include "py/nlr.h"
3332
#include "py/runtime.h"
3433
#include "py/stream.h"
3534
#include "py/mperrno.h"

extmod/vfs_fat_misc.c

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#if MICROPY_VFS_FAT
2929

3030
#include <string.h>
31-
#include "py/nlr.h"
3231
#include "py/runtime.h"
3332
#include "lib/oofatfs/ff.h"
3433
#include "extmod/vfs_fat.h"

lib/netutils/netutils.c

-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
#include <stdio.h>
3030
#include <string.h>
3131

32-
#include "py/obj.h"
33-
#include "py/nlr.h"
3432
#include "py/runtime.h"
3533
#include "lib/netutils/netutils.h"
3634

lib/utils/pyexec.c

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <stdint.h>
3030
#include <string.h>
3131

32-
#include "py/nlr.h"
3332
#include "py/compile.h"
3433
#include "py/runtime.h"
3534
#include "py/repl.h"

mpy-cross/main.c

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <stdlib.h>
3030
#include <unistd.h>
3131

32-
#include "py/mpstate.h"
3332
#include "py/compile.h"
3433
#include "py/persistentcode.h"
3534
#include "py/runtime.h"

ports/bare-arm/main.c

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include <stdio.h>
33
#include <string.h>
44

5-
#include "py/nlr.h"
65
#include "py/compile.h"
76
#include "py/runtime.h"
87
#include "py/repl.h"

ports/cc3200/ftp/ftp.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
#include <stdint.h>
2828
#include <stdio.h>
2929

30-
#include "py/mpstate.h"
31-
#include "py/obj.h"
30+
#include "py/runtime.h"
3231
#include "lib/timeutils/timeutils.h"
3332
#include "lib/oofatfs/ff.h"
3433
#include "extmod/vfs.h"

ports/cc3200/hal/cc3200_hal.c

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include <string.h>
3434

3535

36-
#include "py/mpstate.h"
3736
#include "py/mphal.h"
3837
#include "py/runtime.h"
3938
#include "py/objstr.h"

ports/cc3200/misc/mpexception.c

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <stdint.h>
2929
#include <string.h>
3030

31-
#include "py/mpstate.h"
3231
#include "mpexception.h"
3332

3433

ports/cc3200/mods/modmachine.c

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
#include <stdint.h>
2929

30-
#include "py/mpstate.h"
3130
#include "py/runtime.h"
3231
#include "py/mphal.h"
3332
#include "irq.h"

ports/cc3200/mods/modnetwork.c

-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
* THE SOFTWARE.
2626
*/
2727

28-
#include "py/mpstate.h"
29-
#include "py/obj.h"
30-
#include "py/nlr.h"
3128
#include "py/runtime.h"
3229
#include "py/mperrno.h"
3330
#include "py/mphal.h"

ports/cc3200/mods/modubinascii.c

-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
* THE SOFTWARE.
2626
*/
2727

28-
#include "py/mpconfig.h"
29-
#include "py/nlr.h"
3028
#include "py/runtime.h"
3129
#include "py/binary.h"
3230
#include "extmod/modubinascii.h"

ports/cc3200/mods/moduhashlib.c

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030

3131
#include "py/mpconfig.h"
3232
#include MICROPY_HAL_H
33-
#include "py/nlr.h"
3433
#include "py/runtime.h"
3534
#include "inc/hw_types.h"
3635
#include "inc/hw_ints.h"

ports/cc3200/mods/moduos.c

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include <stdint.h>
2929
#include <string.h>
3030

31-
#include "py/mpstate.h"
32-
#include "py/nlr.h"
3331
#include "py/objtuple.h"
3432
#include "py/objstr.h"
3533
#include "py/runtime.h"

ports/cc3200/mods/pybadc.c

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include <stdio.h>
2929
#include <string.h>
3030

31-
#include "py/mpconfig.h"
32-
#include "py/nlr.h"
3331
#include "py/runtime.h"
3432
#include "py/binary.h"
3533
#include "py/gc.h"

ports/cc3200/mods/pybi2c.c

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <stdio.h>
2929
#include <string.h>
3030

31-
#include "py/mpstate.h"
3231
#include "py/runtime.h"
3332
#include "py/mperrno.h"
3433
#include "py/mphal.h"

ports/cc3200/mods/pybpin.c

-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@
2929
#include <stdint.h>
3030
#include <string.h>
3131

32-
#include "py/mpconfig.h"
33-
#include "py/obj.h"
3432
#include "py/runtime.h"
3533
#include "py/gc.h"
36-
#include "py/mpstate.h"
3734
#include "inc/hw_types.h"
3835
#include "inc/hw_gpio.h"
3936
#include "inc/hw_ints.h"

ports/cc3200/mods/pybsleep.c

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <stdint.h>
2828
#include <string.h>
2929

30-
#include "py/mpstate.h"
3130
#include "py/runtime.h"
3231
#include "py/mphal.h"
3332
#include "inc/hw_types.h"

ports/cc3200/mods/pybspi.c

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <stdint.h>
2929
#include <string.h>
3030

31-
#include "py/mpstate.h"
3231
#include "py/runtime.h"
3332
#include "py/mperrno.h"
3433
#include "bufhelper.h"

ports/cc3200/mods/pybtimer.c

-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929
#include <stdio.h>
3030
#include <string.h>
3131

32-
#include "py/mpconfig.h"
33-
#include "py/obj.h"
34-
#include "py/nlr.h"
3532
#include "py/runtime.h"
3633
#include "py/gc.h"
3734
#include "py/mperrno.h"

ports/cc3200/mods/pybuart.c

-3
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
#include <stdio.h>
3030
#include <string.h>
3131

32-
#include "py/mpconfig.h"
33-
#include "py/obj.h"
3432
#include "py/runtime.h"
3533
#include "py/objlist.h"
3634
#include "py/stream.h"
@@ -48,7 +46,6 @@
4846
#include "mpirq.h"
4947
#include "pybsleep.h"
5048
#include "mpexception.h"
51-
#include "py/mpstate.h"
5249
#include "osi.h"
5350
#include "utils.h"
5451
#include "pin.h"

ports/cc3200/mpthreadport.c

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626

2727
#include <stdio.h>
2828

29-
#include "py/mpconfig.h"
30-
#include "py/mpstate.h"
3129
#include "py/runtime.h"
3230
#include "py/gc.h"
3331
#include "py/mpthread.h"

ports/cc3200/util/gccollect.c

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include <stdio.h>
2929
#include <stdint.h>
3030

31-
#include "py/mpconfig.h"
32-
#include "py/mpstate.h"
3331
#include "py/gc.h"
3432
#include "py/mpthread.h"
3533
#include "gccollect.h"

0 commit comments

Comments
 (0)