Skip to content

Commit

Permalink
Use C++-style includes
Browse files Browse the repository at this point in the history
Convert all C library includes to their C++ equivalents (stdio.h ->
cstdio, etc.).
  • Loading branch information
jbytheway committed Dec 24, 2019
1 parent dbb1105 commit 095bd51
Show file tree
Hide file tree
Showing 62 changed files with 75 additions and 75 deletions.
4 changes: 2 additions & 2 deletions src/avatar.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "avatar.h"

#include <limits.h>
#include <stdlib.h>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <list>
#include <map>
Expand Down
2 changes: 1 addition & 1 deletion src/avatar.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef AVATAR_H
#define AVATAR_H

#include <stddef.h>
#include <cstddef>
#include <iosfwd>
#include <string>
#include <unordered_set>
Expand Down
2 changes: 1 addition & 1 deletion src/avatar_action.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "avatar_action.h"

#include <stdlib.h>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion src/avatar_action.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef AVATAR_ACTION_H
#define AVATAR_ACTION_H

#include <limits.h>
#include <climits>

#include "optional.h"
#include "point.h"
Expand Down
2 changes: 1 addition & 1 deletion src/behavior.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "behavior.h"

#include <assert.h>
#include <cassert>
#include <list>
#include <set>
#include <unordered_map>
Expand Down
2 changes: 1 addition & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "character.h"

#include <ctype.h>
#include <cctype>
#include <climits>
#include <cstdlib>
#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion src/clzones.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef CLZONES_H
#define CLZONES_H

#include <stddef.h>
#include <cstddef>
#include <map>
#include <unordered_map>
#include <unordered_set>
Expand Down
2 changes: 1 addition & 1 deletion src/construction_category.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef CONSTRUCTION_CATEGORY_H
#define CONSTRUCTION_CATEGORY_H

#include <stddef.h>
#include <cstddef>
#include <string>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion src/craft_command.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "craft_command.h"

#include <limits.h>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <limits>
Expand Down
6 changes: 3 additions & 3 deletions src/debug_menu.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "debug_menu.h"

// IWYU pragma: no_include <cxxabi.h>
#include <limits.h>
#include <stdint.h>
#include <climits>
#include <cstdint>
#include <algorithm>
#include <chrono>
#include <vector>
Expand Down Expand Up @@ -67,7 +67,7 @@
#include "artifact.h"
#include "vpart_position.h"
#include "rng.h"
#include "signal.h"
#include <csignal>
#include "magic.h"
#include "bodypart.h"
#include "calendar.h"
Expand Down
2 changes: 1 addition & 1 deletion src/faction.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "faction.h"

#include <assert.h>
#include <cassert>
#include <cstdlib>
#include <bitset>
#include <map>
Expand Down
4 changes: 2 additions & 2 deletions src/field_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#ifndef FIELD_TYPE_H
#define FIELD_TYPE_H

#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>
#include <algorithm>
#include <vector>
#include <memory>
Expand Down
4 changes: 2 additions & 2 deletions src/game.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "game.h"

#include <wctype.h>
#include <assert.h>
#include <cwctype>
#include <cassert>
#include <cstdio>
#include <algorithm>
#include <chrono>
Expand Down
2 changes: 1 addition & 1 deletion src/game_inventory.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "game_inventory.h"

#include <math.h>
#include <cmath>
#include <climits>
#include <cstddef>
#include <functional>
Expand Down
4 changes: 2 additions & 2 deletions src/handle_liquid.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "handle_liquid.h"

#include <limits.h>
#include <stddef.h>
#include <climits>
#include <cstddef>
#include <algorithm>
#include <functional>
#include <iterator>
Expand Down
2 changes: 1 addition & 1 deletion src/inventory_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef INVENTORY_UI_H
#define INVENTORY_UI_H

#include <assert.h>
#include <cassert>
#include <climits>
#include <cstddef>
#include <functional>
Expand Down
2 changes: 1 addition & 1 deletion src/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef ITEM_H
#define ITEM_H

#include <stdint.h>
#include <cstdint>
#include <climits>
#include <list>
#include <map>
Expand Down
2 changes: 1 addition & 1 deletion src/magic.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "magic.h"

#include <stdlib.h>
#include <cstdlib>
#include <set>
#include <algorithm>
#include <array>
Expand Down
2 changes: 1 addition & 1 deletion src/magic.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef MAGIC_H
#define MAGIC_H

#include <stddef.h>
#include <cstddef>
#include <map>
#include <set>
#include <string>
Expand Down
6 changes: 3 additions & 3 deletions src/magic_spell_effect.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <limits.h>
#include <math.h>
#include <stdlib.h>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <set>
#include <algorithm>
#include <array>
Expand Down
2 changes: 1 addition & 1 deletion src/magic_teleporter_list.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "magic_teleporter_list.h"

#include <stddef.h>
#include <cstddef>
#include <map>
#include <algorithm>
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#if defined(_WIN32)
#include "platform_win.h"
#else
#include <signal.h>
#include <csignal>
#endif
#include "color.h"
#include "crash.h"
Expand Down
2 changes: 1 addition & 1 deletion src/map_extras.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef MAP_EXTRAS_H
#define MAP_EXTRAS_H

#include <stdint.h>
#include <cstdint>
#include <string>
#include <unordered_map>

Expand Down
2 changes: 1 addition & 1 deletion src/mapgen.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "mapgen.h"

#include <assert.h>
#include <cassert>
#include <cstdlib>
#include <algorithm>
#include <list>
Expand Down
2 changes: 1 addition & 1 deletion src/monattack.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "monattack.h"

#include <assert.h>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion src/npctrade.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "npctrade.h"

#include <limits.h>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion src/npctrade.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef NPCTRADE_H
#define NPCTRADE_H

#include <stddef.h>
#include <cstddef>
#include <vector>
#include <string>
#include <utility>
Expand Down
2 changes: 1 addition & 1 deletion src/output.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "output.h"

#include <errno.h>
#include <cerrno>
#include <cctype>
#include <cstdio>
#include <algorithm>
Expand Down
4 changes: 2 additions & 2 deletions src/pixel_minimap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@

#include <algorithm>
#include <array>
#include <assert.h>
#include <cassert>
#include <bitset>
#include <cmath>
#include <iterator>
#include <memory>
#include <set>
#include <stdlib.h>
#include <cstdlib>
#include <utility>
#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion src/requirements.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "requirements.h"

#include <limits.h>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <limits>
Expand Down
2 changes: 1 addition & 1 deletion src/rng.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "rng.h"

#include <math.h>
#include <cmath>
#include <chrono>
#include <utility>

Expand Down
2 changes: 1 addition & 1 deletion src/savegame_json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "npc_favor.h" // IWYU pragma: associated
#include "pldata.h" // IWYU pragma: associated

#include <limits.h>
#include <climits>
#include <cctype>
#include <cstddef>
#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion src/sdl_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "sdl_utils.h"

#include <stddef.h>
#include <cstddef>
#include <array>

#include "color.h"
Expand Down
2 changes: 1 addition & 1 deletion src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "sdltiles.h" // IWYU pragma: associated
#include "cursesdef.h" // IWYU pragma: associated

#include <stdint.h>
#include <cstdint>
#include <climits>
#include <algorithm>
#include <cassert>
Expand Down
2 changes: 1 addition & 1 deletion src/string_input_popup.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef STRING_INPUT_POPUP_H
#define STRING_INPUT_POPUP_H

#include <stdint.h>
#include <cstdint>
#include <cstddef>
#include <functional>
#include <map>
Expand Down
2 changes: 1 addition & 1 deletion src/ui.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ui.h"

#include <assert.h>
#include <cassert>
#include <cctype>
#include <climits>
#include <cstdlib>
Expand Down
4 changes: 2 additions & 2 deletions tests/bionics_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <limits.h>
#include <stddef.h>
#include <climits>
#include <cstddef>
#include <list>
#include <memory>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion tests/colony_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <stddef.h>
#include <cstddef>
#include <algorithm> // std::find
#include <functional> // std::greater
#include <utility> // std::move
Expand Down
2 changes: 1 addition & 1 deletion tests/comestible_tests.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <stdio.h>
#include <cstdio>
#include <algorithm>
#include <list>
#include <map>
Expand Down
2 changes: 1 addition & 1 deletion tests/crafting_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <limits.h>
#include <climits>
#include <sstream>
#include <algorithm>
#include <list>
Expand Down
2 changes: 1 addition & 1 deletion tests/creature_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <stdlib.h>
#include <cstdlib>
#include <map>
#include <utility>

Expand Down
2 changes: 1 addition & 1 deletion tests/fake_messages.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <stddef.h>
#include <cstddef>
#include <string>
#include <utility>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion tests/health_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <stddef.h>
#include <cstddef>
#include <sstream>
#include <array>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion tests/invlet_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <stddef.h>
#include <cstddef>
#include <sstream>
#include <list>
#include <map>
Expand Down
2 changes: 1 addition & 1 deletion tests/iuse_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <limits.h>
#include <climits>
#include <list>
#include <memory>

Expand Down
2 changes: 1 addition & 1 deletion tests/line_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <time.h>
#include <ctime>
#include <chrono>
#include <cstdio>
#include <algorithm>
Expand Down
Loading

0 comments on commit 095bd51

Please sign in to comment.