7 Commits

Author SHA1 Message Date
moxian 8b6cbac614 Stop including catch.hpp directly
.. as suggested by the comment in cata_catch.h:

// To avoid ODR violations, it's important that whenever a file includes
// catch.hpp it also includes stringmaker.h, so that all specializations of
// StringMaker match.  Therefore, all test code should include catch.hpp via
// this file.

Honestly, i'm not exactly sure how valuable this is, given that we've
been running with the current odr-violating(?) setup for a while nand
not had many issues, but sure, why not.
2025-02-16 19:45:21 -08:00
moxian 2ee44002fd Mechanically IWYU the tests
python3 ~/github/include-what-you-use/iwyu_tool.py -j5 -p build $( find
src/ tests/ -maxdepth 1 -name '*.cpp' | grep -v -f
tools/iwyu/bad_files.txt )  --  -Xiwyu --comment_style=long -Xiwyu -
-max_line_length=1000 -Xiwyu --cxx17ns -Xiwyu
--mapping_file=../tools/iwyu/cata.imp   | tee out/iwyu/f-a-01.txt >
/dev/null

followed by

cat out/iwyu/f-a-02.txt | python3
~/github/include-what-you-use/fix_includes.py --reorder --nosafe_headers

followed by manual fixups of <stddef.h> -> <cstddef> and similar.

tests/generic_factory_test.cpp gets mangled very badly (IWYU bug) so
it's excluded from the list.

Code size:
includes:
$ cat obj/tiles/*.inc | wc
 288068  576136 17898260
$ cat tests/obj/tiles/*.inc | wc
 167044  334088 10465766

post-processed source (clang -E):
./make_preproc.sh src/
68567896 177775140 2134075721
./make_preproc.sh tests/
39341957 102891720 1243323710
2025-02-10 00:46:57 -08:00
prharvey a3f5d31341 Replace all global mon_flag_str_id with mon_flag_id located in mtype.h. Initialize them on game load. 2024-01-01 11:31:20 -07:00
David Seguin 12e198612d Jsonify monster flags (#66722)
* jsonify monster flags: code and flag conversion

* jsonify monster flags: docs and lang parser

* jsonify monster flags: optimizations

* jsonify monster flags: remove expensive debug stats tracker for mflags
2023-07-10 13:54:00 -03:00
John Bytheway e95a4fc9b8 Promote string_id constants to global statics
Our string_id constants were a mixture of temporaries, locals, and
globals.  Pull them all out as globals, for consistency and efficiency.
The efficiency comes from the fact that each string_id instance caches
its respective int_id, and sharing one instance means that value need
not be recomputed.
2021-11-19 19:10:09 -05:00
John Bytheway 5ff129c26b Sort and collect string_id declarations
The static string_id collections at the start of each cpp file should
have a consistent ordering.  This is in particular to permit new ones to
be added automatically by clang-tidy checks.

We've added a check to automatically sort them all.  Apply it across the
codebase.
2021-11-11 16:02:14 -05:00
Saicchi 3a567393c1 speed description checks 2021-08-29 20:11:21 -03:00