micropython/tools
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
..
autobuild all: Switch to new preview build versioning scheme. 2023-10-06 12:10:14 +11:00
mpremote tools/mpremote: Reduce dependency on importlib_metadata. 2024-01-17 11:27:47 +11:00
.gitattributes
.gitignore
boardgen.py all: Remove the "STATIC" macro and just use "static" instead. 2024-03-07 14:20:42 +11:00
cc1
ci.sh github/workflows: Move codespell to a GitHub workflow, version it. 2024-02-07 15:19:38 +11:00
codeformat.py all: Replace "black" with "ruff format". 2023-11-03 13:30:38 +11:00
codestats.sh tests,tools: Update path to unix micropython executable. 2022-08-18 11:47:58 +10:00
dfu.py tools/dfu.py: Make tool work with python3 when parsing DFU files. 2021-11-01 15:46:59 +11:00
file2h.py all: Reformat C and Python source code with tools/codeformat.py. 2020-02-28 10:33:03 +11:00
gen-changelog.sh tools/gen-changelog.sh: Exclude "-preview" tags from generated log. 2024-01-05 15:06:14 +11:00
gen-cpydiff.py docs: Add note about position-only arguments in CPython vs MicroPython. 2024-01-25 11:56:38 +11:00
hci_trace_to_pcap.py extmod/modbluetooth: Make all HCI transports trace in the same format. 2023-04-26 11:37:20 +10:00
insert-usb-ids.py all: Fix strings with backslash by using raw string literals. 2023-05-02 11:55:02 +10:00
makemanifest.py tools/makemanifest.py: Fix printing of mpy_cross.CrossCompileError. 2022-11-02 14:06:18 +11:00
manifestfile.py tools/manifestfile.py: Add --unix-ffi option. 2024-02-19 13:32:23 +11:00
metrics.py tools/metrics.py: Fix esp32 and esp8266 board names after renaming. 2023-10-04 15:44:25 +11:00
mpy-tool.py py/emitglue: Include fun_data_len in mp_raw_code_t only when saving. 2024-02-16 14:17:01 +11:00
mpy_bin2res.py
mpy_cross_all.py all: Remove MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE. 2021-09-16 16:04:03 +10:00
mpy_ld.py py/persistentcode: Bump .mpy sub-version. 2023-10-16 11:25:31 +11:00
pyboard.py all: Update Python formatting to ruff-format. 2023-11-03 13:30:41 +11:00
pydfu.py all: Fix various spelling mistakes found by codespell 2.2.6. 2023-10-03 11:24:50 +11:00
tinytest-codegen.py tools/tinytest-codegen.py: Externalise tests list. 2023-11-07 15:53:27 +11:00
uf2conv.py all: Fix strings with backslash by using raw string literals. 2023-05-02 11:55:02 +10:00
uf2families.json tools/uf2conv.py: Update to latest version. 2022-02-02 23:43:58 +11:00
uncrustify.cfg all: Fix spelling mistakes based on codespell check. 2023-04-27 18:03:06 +10:00
verifygitlog.py CODECONVENTIONS: Require that commits be signed-off by the author. 2023-05-08 12:20:56 +10:00