12 Commits

Author SHA1 Message Date
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
Clarence "Sparr" Risher 8b27b967ae Replace point constants with static class members 2024-11-26 10:14:26 -05:00
PatrikLundell 456a199f5c typified a bit of map.cpp and dependents 2024-10-08 16:23:15 +02:00
PatrikLundell ab062c5e8b typified a bit of map.h/cpp + some dependents (#75125)
* typified a bit of map.h/cpp + some dependents

* Macro crasher found by one compiler!

* demanded changes

* stupid wokaround for demanded changes

* Sort out conflict mess
2024-09-10 09:42:54 -05:00
PatrikLundell ec028a90be typified lightmap 2024-05-07 16:05:53 +02:00
Binrui Dong 32774b37da Migrate from cata::optional<T> to std::optional<T> (#64333)
Co-authored-by: Kevin Granade <kevin.granade@gmail.com>
2023-03-20 20:11:23 -07:00
Zhilkin Serg e44f38af40 Remove excessive empty lines 2022-12-06 10:42:15 +03:00
John Bytheway 875cadf142 Enable performance-unnecessary-value-param (#59533)
This clang-tidy check looks for potentially-expensive-to-copy value
parameters which are only used as const values.

If they are only used once, in an assignment or initialization, then
their use will be converted to std::move.  This can save a copy in some
cases.

Otherwise, the parameter will be converted to a const reference, which
can also save a copy in some cases.
2022-07-23 19:29:45 -04:00
John Bytheway 2fd2d7453c Move large functions out of headers
Generally speaking, we don't want large functions in headers.  They
increase compile time, not just because the function itself is compiled
many times over but also because they need extra headers to be included.

Using a new clang-tidy check (added in the next commit) find all
functions in headers with more than five statements, and move them into
cpp files.

Also, some static functions in cpp files were marked inline.  This
serves no real purpose; the compiler will already do a good job of
inlining static functions, so stop that.
2022-07-06 13:44:54 -04:00
Binrui Dong 9fdb7ef59c Run IWYU
* Change _ctype.h and __locale to cctype and clocale

* Change _wctype.h to cwctype in game.cpp

* Change __functional_base to functional

* Remove libcxx internal headers

* Remove UNIX system headers

* Fix clang-tidy error with -nostdinc++
2021-02-06 00:18:41 -05:00
ZhilkinSerg 0b6d4f0a7c Use const references in function parameters 2020-10-09 00:49:56 +03:00
Ivan Zaitsev 163fc540ed Refactored vision_test for extensibility (#44216)
* introduce `map_test_case`: a framework that simplifies tile-setting tests
refactor vision_test.cpp using `map_test_case` framework
add new vision test with thick smoke

* fix clang-tidy warnings

* another clang-tidy fix

* remove mutations that potentially affect vision

* narrow the scope of the overloaded operators
2020-10-02 13:01:44 +03:00