|
OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
|
Functions | |
| load (path) | |
| strip_lexemes (text) | |
| named (text, names) | |
| plain_uses (preprocessed, names) | |
| source_text (path) | |
| preprocess_args (entry) | |
| source_root (build_dir) | |
| engine_entries (build_dir) | |
| check (path, entry, names) | |
| main () | |
Variables | |
| ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| LEXEMES = re.compile(r'//[^\n]*|/\*.*?\*/|"(?:\\.|[^"\\\n])*"|\'(?:\\.|[^\'\\\n])*\'', re.S) | |
| LINE_MARKER = re.compile(r'^# (\d+) "((?:\\.|[^"\\])*)"') | |
Lists the engine sources that name a renamed bgame global under its plain name.
python3 scripts/check_bgame_names.py <build_dir> [--names FILE]
In the client the engine's bgame globals that CoD2rev-Plus's code also defines
are renamed to eng_<name> by src/headers/engine_bgame_names.h, which
common_types.h includes (scripts/bgame_names.py). An engine source that names
one of them without that header in effect would link to CoD2rev-Plus's global
without an error. For each translation unit in <build_dir>/compile_commands.json
that is not CoD2rev-Plus's (the cod2_plus_* targets and test/vendored_files.txt)
and whose text names one of test/engine_bgame_names.txt, this runs the
preprocessor and looks for the plain name left in its output. Exits with 0
when there is none.
| check_bgame_names.check | ( | path, | |
| entry, | |||
| names ) |
| check_bgame_names.engine_entries | ( | build_dir | ) |
| check_bgame_names.load | ( | path | ) |
| check_bgame_names.main | ( | ) |
| check_bgame_names.named | ( | text, | |
| names ) |
The names text uses as identifiers (not in comments or literals).
| check_bgame_names.plain_uses | ( | preprocessed, | |
| names ) |
(file, line, name) for each plain name left in preprocessor output.
| check_bgame_names.preprocess_args | ( | entry | ) |
The compile command of entry, made to write its preprocessed output.
| check_bgame_names.source_root | ( | build_dir | ) |
| check_bgame_names.source_text | ( | path | ) |
path's text and that of the files it includes by a quoted name next to it or by an absolute one (as the C++ wrappers under cxx_wrap/ include their C source), one level deep.
| check_bgame_names.strip_lexemes | ( | text | ) |
text without comments and literals; newlines kept, so lines still count.
| check_bgame_names.LEXEMES = re.compile(r'//[^\n]*|/\*.*?\*/|"(?:\\.|[^"\\\n])*"|\'(?:\\.|[^\'\\\n])*\'', re.S) |
| check_bgame_names.LINE_MARKER = re.compile(r'^# (\d+) "((?:\\.|[^"\\])*)"') |
| check_bgame_names.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |