micropython/py
Angus Gratton decf8e6a8b all: Remove the "STATIC" macro and just use "static" instead.
The STATIC macro was introduced a very long time ago in commit
d5df6cd44a.  The original reason for this was
to have the option to define it to nothing so that all static functions
become global functions and therefore visible to certain debug tools, so
one could do function size comparison and other things.

This STATIC feature is rarely (if ever) used.  And with the use of LTO and
heavy inline optimisation, analysing the size of individual functions when
they are not static is not a good representation of the size of code when
fully optimised.

So the macro does not have much use and it's simpler to just remove it.
Then you know exactly what it's doing.  For example, newcomers don't have
to learn what the STATIC macro is and why it exists.  Reading the code is
also less "loud" with a lowercase static.

One other minor point in favour of removing it, is that it stops bugs with
`STATIC inline`, which should always be `static inline`.

Methodology for this commit was:

1) git ls-files | egrep '\.[ch]$' | \
   xargs sed -Ei "s/(^| )STATIC($| )/\1static\2/"

2) Do some manual cleanup in the diff by searching for the word STATIC in
   comments and changing those back.

3) "git-grep STATIC docs/", manually fixed those cases.

4) "rg -t python STATIC", manually fixed codegen lines that used STATIC.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-03-07 14:20:42 +11:00
..
argcheck.c
asmarm.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
asmarm.h py/asm{arm,thumb,x64,x86,xtensa}: Remove unused macros. 2023-10-27 15:41:02 +11:00
asmbase.c
asmbase.h
asmthumb.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
asmthumb.h py/asm{arm,thumb,x64,x86,xtensa}: Remove unused macros. 2023-10-27 15:41:02 +11:00
asmx64.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
asmx64.h py/asm{arm,thumb,x64,x86,xtensa}: Remove unused macros. 2023-10-27 15:41:02 +11:00
asmx86.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
asmx86.h py/asm{arm,thumb,x64,x86,xtensa}: Remove unused macros. 2023-10-27 15:41:02 +11:00
asmxtensa.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
asmxtensa.h py/asm{arm,thumb,x64,x86,xtensa}: Remove unused macros. 2023-10-27 15:41:02 +11:00
bc.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
bc.h py/emitglue: Include fun_data_len in mp_raw_code_t only when saving. 2024-02-16 14:17:01 +11:00
bc0.h
binary.c
binary.h
builtin.h py/makemoduledefs.py: Automatically declare delegation attr functions. 2023-06-14 19:03:46 +10:00
builtinevex.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
builtinhelp.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
builtinimport.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
compile.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
compile.h
dynruntime.h py/emitglue: Introduce mp_proto_fun_t as a more general mp_raw_code_t. 2024-02-16 14:17:01 +11:00
dynruntime.mk
emit.h
emitbc.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
emitcommon.c
emitglue.c py/emitglue: Make mp_emit_glue_assign_native's fun_data arg a const ptr. 2024-02-22 11:27:33 +11:00
emitglue.h py/emitglue: Add explicit cast of proto_fun to uint8_t pointer. 2024-03-04 10:27:07 +11:00
emitinlinethumb.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
emitinlinextensa.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
emitnarm.c
emitnative.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
emitnthumb.c
emitnx64.c
emitnx86.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
emitnxtensa.c
emitnxtensawin.c
formatfloat.c all: Fix various spelling mistakes found by codespell 2.2.6. 2023-10-03 11:24:50 +11:00
formatfloat.h
frozenmod.c
frozenmod.h
gc.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
gc.h py/gc: Add "max new split" value in result of gc.mem_free(). 2023-09-15 12:19:13 +10:00
grammar.h
lexer.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
lexer.h py/builtinevex: Handle invalid filenames for execfile. 2023-10-12 15:17:59 +11:00
make_root_pointers.py
makecompresseddata.py
makemoduledefs.py py/makemoduledefs.py: Automatically declare delegation attr functions. 2023-06-14 19:03:46 +10:00
makeqstrdata.py py/qstr: Add support for MICROPY_QSTR_BYTES_IN_HASH=0. 2024-01-25 16:38:17 +11:00
makeqstrdefs.py py/makeqstrdefs.py: Stop generating temporary intermediate file. 2023-12-14 22:55:08 -08:00
makeversionhdr.py py/makeversionhdr.py: Reinstate MICROPY_GIT_HASH in mpversion.h. 2024-02-19 23:36:25 +11:00
malloc.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
map.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
misc.h py/misc: Remove m_new_obj[_var]_with_finaliser macros. 2024-02-20 10:33:09 +11:00
mkenv.mk windows: Use the MicroPython logo as application icon. 2023-11-07 17:22:52 +11:00
mkrules.cmake py/mkrules.mk: List hash files as byproducts. 2023-12-15 15:48:07 +11:00
mkrules.mk ports: Fix handling of paths containing spaces in Makefiles. 2024-01-24 10:43:18 +11:00
modarray.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modbuiltins.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modcmath.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modcollections.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
moderrno.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modgc.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modio.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modmath.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modmicropython.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modstruct.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modsys.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
modthread.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
mpconfig.h all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
mperrno.h
mphal.h ports: Fix sys.stdout.buffer.write() return value. 2023-12-22 10:32:46 +11:00
mpprint.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
mpprint.h
mpstate.c
mpstate.h py/mpstate: Don't declare mp_thread_get_state(). 2024-02-29 13:33:51 +11:00
mpthread.h py/modthread: Return thread id from start_new_thread(). 2023-09-03 18:49:18 +10:00
mpz.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
mpz.h
nativeglue.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
nativeglue.h py/emitglue: Introduce mp_proto_fun_t as a more general mp_raw_code_t. 2024-02-16 14:17:01 +11:00
nlr.c
nlr.h
nlraarch64.c
nlrmips.c
nlrpowerpc.c
nlrsetjmp.c
nlrthumb.c
nlrx64.c py/nlrx64: Mark nlr_push() as naked function when possible. 2023-09-20 11:48:36 +10:00
nlrx86.c
nlrxtensa.c
obj.c py/obj: Introduce mp_obj_malloc_with_finaliser to allocate and set type. 2024-02-20 10:32:51 +11:00
obj.h py/objfun: Split viper fun type out to separate mp_type_fun_viper type. 2024-02-20 10:56:24 +11:00
objarray.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objarray.h
objattrtuple.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objbool.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objboundmeth.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objcell.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objclosure.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objcomplex.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objdeque.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objdict.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objenumerate.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objexcept.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objexcept.h
objfilter.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objfloat.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objfun.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objfun.h py/emitnative: Simplify layout and loading of native function prelude. 2024-02-20 10:56:24 +11:00
objgenerator.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objgenerator.h
objgetitemiter.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objint.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objint.h
objint_longlong.c
objint_mpz.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objlist.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objlist.h
objmap.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objmodule.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objmodule.h py/makemoduledefs.py: Automatically declare delegation attr functions. 2023-06-14 19:03:46 +10:00
objnamedtuple.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objnamedtuple.h
objnone.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objobject.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objpolyiter.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objproperty.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objrange.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objreversed.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objset.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objsingleton.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objslice.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objstr.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objstr.h
objstringio.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objstringio.h
objstrunicode.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objtuple.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objtuple.h
objtype.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
objtype.h
objzip.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
opmethods.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
pairheap.c
pairheap.h
parse.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
parse.h
parsenum.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
parsenum.h
parsenumbase.c
parsenumbase.h
persistentcode.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
persistentcode.h py/persistentcode: Bump .mpy sub-version. 2023-10-16 11:25:31 +11:00
profile.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
profile.h
py.cmake
py.mk py/py.mk: Remove extra build dir created for frozen_content. 2024-01-17 08:14:15 +11:00
pystack.c
pystack.h
qstr.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
qstr.h py/qstr: Add support for MICROPY_QSTR_BYTES_IN_HASH=0. 2024-01-25 16:38:17 +11:00
qstrdefs.h
reader.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
reader.h py/builtinevex: Handle invalid filenames for execfile. 2023-10-12 15:17:59 +11:00
repl.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
repl.h
ringbuf.c
ringbuf.h
runtime.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
runtime.h py/modthread: Move thread state initialisation to shared function. 2024-02-29 14:28:58 +01:00
runtime0.h py/emitglue: Simplify mp_raw_code_t's kind and scope_flags members. 2024-02-16 12:48:02 +11:00
runtime_utils.c
scheduler.c py: Add port-agnostic inline functions for event handling. 2023-12-08 12:47:00 +11:00
scope.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
scope.h py/emitglue: Include fun_data_len in mp_raw_code_t only when saving. 2024-02-16 14:17:01 +11:00
sequence.c
showbc.c py/emitglue: Include fun_data_len in mp_raw_code_t only when saving. 2024-02-16 14:17:01 +11:00
smallint.c
smallint.h
stackctrl.c
stackctrl.h
stream.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
stream.h extmod/vfs_reader: Add file ioctl to set read buffer size. 2023-11-09 11:20:31 +11:00
unicode.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
unicode.h
usermod.cmake
vm.c py/emitglue: Introduce mp_proto_fun_t as a more general mp_raw_code_t. 2024-02-16 14:17:01 +11:00
vmentrytable.h
vstr.c all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
warning.c