* 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++
Resolves a TODO on that constructor, and one more TODO elsewhere due to
the resulting refactoring.
time_point was implicitly convertible from int. This led to unclear
code. In particular, the item constructor took a time_point and a
quantity, and these two ints appeared adjacent with no obvious way to
see what they meant at call sites.
Make the constructor explicit, so the conversion is no longer implicit.
Update the rest of the code accordingly.
In most cases switched from 0 to calendar::turn_zero, which is
equivalent. In a couple of places, used start_of_cataclysm instead,
when it seemed more appropriate (such as birthday of toilet water).
It's possible there are more cases which should have been something
other than turn_zero.
itype_id is (presumably) one of the oldest type ids in the game. In
particular, it predates string_id, and was simply a typedef of
std::string.
This is bad for type safety.
Make it be a string_id specialization instead, and update the rest of
the code accordingly.
* Helper script to run IWYU
* Run IWYU
* Update deprecated headers
* Run IWYU again
* Re-suppress cxxabi.h
This pragma got accidentally removed because it was deemed to be a
comment attached to a #include.
* Remove extra SDL header includes
* Fix ime.cpp headers
Some tweaks to help IWYU not break this file by messing with
platform-specific stuff not relevant on Linux.
* Update game.h
* Move new point.h includes inside #ifdef
* Re-add platform_win.h to mapsharing.cpp
* Apply suggestions from code review
Co-authored-by: ZhilkinSerg <ZhilkinSerg@users.noreply.github.com>
* Revert "Moved more string consts into single file (#38237)"
This reverts commit 49877426ce.
* Revert "Moved more string consts into single file (#38220)"
This reverts commit d9c6079762.
* Revert "Move string consts into single file (#38195)"
This reverts commit b1b48badff.
* Revert "More string consts into single file (#38189)"
This reverts commit 4fffd96143.
* Revert "More string consts into single file (#38183)"
This reverts commit 05940bfe3a.
* Revert "Move string consts into single file (#38184)"
This reverts commit 19c569826b.
* Revert "Move string consts into single file (#38181)"
This reverts commit 55cabb794c.
* Revert "Move more string consts into single file (#38175)"
This reverts commit 571efb2f8e.
* Revert "Merge pull request #38176 from Ramza13/string_consts_and_more"
This reverts commit 9c9835ff08, reversing
changes made to 07995cdda5.
* Revert "Move more string consts into single file (#38169)"
This reverts commit 07995cdda5.
* Revert "Merge pull request #38168 from Ramza13/even_more_string_consts"
This reverts commit 2bf1c1ea18, reversing
changes made to 24a32c0d1a.
* Revert "Merge pull request #38141 from ZhilkinSerg/sa-2020-02-18"
This reverts commit 142295b1dc, reversing
changes made to f98c67d3c3.
* Revert "Move string consts into single file (#38158)"
This reverts commit 50059c8a24.
* Revert "Merge pull request #38157 from Ramza13/string_consts_more_flags"
This reverts commit 8ec8e78959, reversing
changes made to 72ef0222a0.
* Revert "Move string_consts"
This reverts commit 0a6bf67436.
* Revert "Merge pull request #38146 from Ramza13/battery"
This reverts commit 9286722b74, reversing
changes made to e9f1cd7787.
* Revert "Merge pull request #38134 from AMurkin/rename-blob"
This reverts commit 06f72d2b7d, reversing
changes made to bcfe0741e1.
* Revert "Yet more string consts moved out (#38130)"
This reverts commit b5f18f3574.
* Revert "Merge pull request #38115 from Ramza13/string_consts_game"
This reverts commit 98076577b0, reversing
changes made to 036465f517.
* Fixup to the picked_up
* RE-inline item_location initialization
* Update character.h
* Update item.cpp
* Update item.h
* Update item_action.cpp
* Update item_factory.cpp
* Update point.h
* Update safemode_ui.cpp
The tests have a clear_player helper. I wanted to use it with an NPC,
so I've split it into clear_avatar for the avatar, and clear_character
for a generic character. Currently clear_character actually takes a
player& argument, because not all the things it clears are yet in
Character, but that's the direction we're headed.
* Add IWYU pragma: keep
* Run IWYU and astyle
* Run IWYU a second time
* Prevent #include <cxxabi.h>
Unclear why IWYU thinks this is needed. It isn't, and it causes
problems on Visual Studio.
* Fix missing declarations
Mark functions with no prior declarations as static, and remove the
unused ones.
* Move debug_is_safe_string definition
Put it inside !WIN32 since it's only used there.
A first step towards IWYU support. Doing the sorting first because it
makes reviewing any additions or removals of headers much simpler.
The IWYU order is:
- Associated headers
- Misc system headers
- C++ STL headers
- Other project headers
The biggest change is moving system headers before project headers (they
are usually afterwards in Cata at the moment.
The associated header for a cpp file is the header file which declares
the functions defined in that cpp file. Normally that's the one which
shares the same name (up to extension), and if so IWYU figures it out
automatically.
However, in this project there are many corner cases, so we need to use
IWYU pragma: associated to tell it which header (or, in some cases,
which headers) is the associated header. We are unusual in having
multiple associated headers for some files, which might lead to
discovering some interesting IWYU bugs later, but in theory it is
supported.
The 'reload_gun_with_integral_magazine' test wasn't using a gun with an
integral magazine. It also was using ammunition without a quantity.
The 'reload_gun_with_swappable_magazine' was assuming that the gun would be
created with a magazine already present in it. It wasn't, so I've added the
expected magazine type to the gun. I also fixed the null ammo quantity.
Signed-off-by: Steven Noonan <steven@uplinklabs.net>