Browse Source

Add missing <cstdint> includes

Done with the following script:

```ruby
Dir["Source/**/*.{h,c,cc,cpp,hpp}"].each do |path|
  v = File.read(path)
  next if !v.include?("uint32_t") || v.include?("cstdint")

  lines = v.lines
  line_num = if lines[2].start_with?(" *")
    lines.index { |l| l.start_with?(" */") } + 3
  else
    3
  end

  lines.insert(line_num, "#include <cstdint>\n")

  File.write(path, lines.join(""))
end
```

then fixed-up manually
pull/6096/head
Gleb Mazovetskiy 3 years ago
parent
commit
4fa3732526
  1. 1
      Source/DiabloUI/diabloui.cpp
  2. 1
      Source/DiabloUI/hero/selhero.cpp
  3. 1
      Source/DiabloUI/mainmenu.cpp
  4. 2
      Source/DiabloUI/multi/selgame.cpp
  5. 2
      Source/DiabloUI/settingsmenu.cpp
  6. 1
      Source/control.cpp
  7. 1
      Source/debug.cpp
  8. 1
      Source/debug.h
  9. 1
      Source/diablo.cpp
  10. 1
      Source/dvlnet/abstract_net.h
  11. 1
      Source/dvlnet/base.cpp
  12. 1
      Source/dvlnet/base.h
  13. 1
      Source/dvlnet/cdwrap.h
  14. 2
      Source/dvlnet/loopback.cpp
  15. 1
      Source/dvlnet/loopback.h
  16. 1
      Source/dvlnet/protocol_zt.h
  17. 1
      Source/encrypt.cpp
  18. 1
      Source/engine/demomode.cpp
  19. 1
      Source/engine/dx.cpp
  20. 2
      Source/engine/palette.cpp
  21. 1
      Source/engine/path.cpp
  22. 1
      Source/engine/random.cpp
  23. 2
      Source/engine/render/scrollrt.cpp
  24. 1
      Source/engine/render/text_render.cpp
  25. 1
      Source/error.cpp
  26. 2
      Source/gmenu.cpp
  27. 3
      Source/inv.cpp
  28. 2
      Source/levels/drlg_l1.cpp
  29. 2
      Source/levels/drlg_l1.h
  30. 1
      Source/levels/drlg_l2.cpp
  31. 2
      Source/levels/drlg_l2.h
  32. 3
      Source/levels/drlg_l3.cpp
  33. 2
      Source/levels/drlg_l3.h
  34. 2
      Source/levels/drlg_l4.cpp
  35. 2
      Source/levels/drlg_l4.h
  36. 5
      Source/levels/gendung.cpp
  37. 1
      Source/loadsave.cpp
  38. 2
      Source/loadsave.h
  39. 2
      Source/menu.cpp
  40. 2
      Source/menu.h
  41. 1
      Source/minitext.cpp
  42. 1
      Source/monster.cpp
  43. 2
      Source/mpq/mpq_reader.cpp
  44. 1
      Source/mpq/mpq_sdl_rwops.cpp
  45. 1
      Source/msg.cpp
  46. 5
      Source/multi.cpp
  47. 2
      Source/nthread.cpp
  48. 2
      Source/nthread.h
  49. 2
      Source/pack.cpp
  50. 1
      Source/pfile.cpp
  51. 2
      Source/pfile.h
  52. 1
      Source/platform/ctr/asio/include/netinet/in.h
  53. 1
      Source/platform/ctr/display.cpp
  54. 1
      Source/platform/ctr/random.cpp
  55. 1
      Source/platform/ctr/sockets.cpp
  56. 1
      Source/platform/switch/keyboard.cpp
  57. 1
      Source/platform/switch/random.cpp
  58. 1
      Source/platform/vita/random.cpp
  59. 1
      Source/platform/vita/touch.cpp
  60. 2
      Source/playerdat.cpp
  61. 1
      Source/plrmsg.cpp
  62. 1
      Source/qol/floatingnumbers.cpp
  63. 2
      Source/quests.cpp
  64. 1
      Source/stores.cpp
  65. 5
      Source/storm/storm_net.cpp
  66. 1
      Source/sync.cpp
  67. 2
      Source/tmsg.cpp
  68. 1
      Source/utils/cel_to_clx.cpp
  69. 1
      Source/utils/cl2_to_clx.cpp
  70. 1
      Source/utils/display.cpp
  71. 1
      Source/utils/endian_stream.hpp
  72. 1
      Source/utils/file_util.cpp
  73. 1
      Source/utils/language.cpp
  74. 1
      Source/utils/surface_to_clx.cpp
  75. 1
      Source/utils/utf8.cpp

1
Source/DiabloUI/diabloui.cpp

@ -1,6 +1,7 @@
#include "DiabloUI/diabloui.h"
#include <algorithm>
#include <cstdint>
#include <string>
#include "DiabloUI/button.h"

1
Source/DiabloUI/hero/selhero.cpp

@ -2,6 +2,7 @@
#include <algorithm>
#include <chrono>
#include <cstdint>
#include <random>
#include <fmt/format.h>

1
Source/DiabloUI/mainmenu.cpp

@ -1,3 +1,4 @@
#include <cstdint>
#include "DiabloUI/diabloui.h"
#include "DiabloUI/selok.h"

2
Source/DiabloUI/multi/selgame.cpp

@ -1,5 +1,7 @@
#include "DiabloUI/multi/selgame.h"
#include <cstdint>
#include <fmt/format.h>
#include "DiabloUI/diabloui.h"

2
Source/DiabloUI/settingsmenu.cpp

@ -1,5 +1,7 @@
#include "selstart.h"
#include <cstdint>
#include <function_ref.hpp>
#include "DiabloUI/diabloui.h"

1
Source/control.cpp

@ -8,6 +8,7 @@
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <string>
#include <fmt/format.h>

1
Source/debug.cpp

@ -6,6 +6,7 @@
#ifdef _DEBUG
#include <cstdint>
#include <cstdio>
#include "debug.h"

1
Source/debug.h

@ -5,6 +5,7 @@
*/
#pragma once
#include <cstdint>
#include <unordered_map>
#include "engine.h"

1
Source/diablo.cpp

@ -4,6 +4,7 @@
* Implementation of the main game initialization functions.
*/
#include <array>
#include <cstdint>
#include <fmt/format.h>

1
Source/dvlnet/abstract_net.h

@ -1,5 +1,6 @@
#pragma once
#include <cstdint>
#include <exception>
#include <memory>
#include <string>

1
Source/dvlnet/base.cpp

@ -1,6 +1,7 @@
#include "dvlnet/base.h"
#include <algorithm>
#include <cstdint>
#include <cstring>
#include <memory>

1
Source/dvlnet/base.h

@ -1,6 +1,7 @@
#pragma once
#include <array>
#include <cstdint>
#include <deque>
#include <map>
#include <memory>

1
Source/dvlnet/cdwrap.h

@ -1,5 +1,6 @@
#pragma once
#include <cstdint>
#include <exception>
#include <map>
#include <memory>

2
Source/dvlnet/loopback.cpp

@ -1,5 +1,7 @@
#include "dvlnet/loopback.h"
#include <cstdint>
#include "multi.h"
#include "player.h"
#include "utils/language.h"

1
Source/dvlnet/loopback.h

@ -1,5 +1,6 @@
#pragma once
#include <cstdint>
#include <queue>
#include <string>

1
Source/dvlnet/protocol_zt.h

@ -3,6 +3,7 @@
#include <algorithm>
#include <array>
#include <atomic>
#include <cstdint>
#include <deque>
#include <exception>
#include <map>

1
Source/encrypt.cpp

@ -5,6 +5,7 @@
*/
#include <array>
#include <cctype>
#include <cstdint>
#include <cstring>
#include <memory>

1
Source/engine/demomode.cpp

@ -1,5 +1,6 @@
#include "engine/demomode.h"
#include <cstdint>
#include <cstdio>
#include <deque>

1
Source/engine/dx.cpp

@ -6,6 +6,7 @@
#include "engine/dx.h"
#include <SDL.h>
#include <cstdint>
#include "controls/plrctrls.h"
#include "engine.h"

2
Source/engine/palette.cpp

@ -5,6 +5,8 @@
*/
#include "engine/palette.h"
#include <cstdint>
#include <fmt/core.h>
#include "engine/backbuffer_state.hpp"

1
Source/engine/path.cpp

@ -6,6 +6,7 @@
#include "engine/path.h"
#include <array>
#include <cstdint>
#include <function_ref.hpp>

1
Source/engine/random.cpp

@ -1,5 +1,6 @@
#include "engine/random.hpp"
#include <cstdint>
#include <limits>
#include <random>

2
Source/engine/render/scrollrt.cpp

@ -5,6 +5,8 @@
*/
#include "engine/render/scrollrt.h"
#include <cstdint>
#include "DiabloUI/ui_flags.hpp"
#include "automap.h"
#include "controls/plrctrls.h"

1
Source/engine/render/text_render.cpp

@ -7,6 +7,7 @@
#include <array>
#include <cstddef>
#include <cstdint>
#include <unordered_map>
#include <utility>

1
Source/error.cpp

@ -4,6 +4,7 @@
* Implementation of in-game message functions.
*/
#include <cstdint>
#include <deque>
#include "error.h"

2
Source/gmenu.cpp

@ -5,6 +5,8 @@
*/
#include "gmenu.h"
#include <cstdint>
#include "DiabloUI/ui_flags.hpp"
#include "control.h"
#include "controls/axis_direction.h"

3
Source/inv.cpp

@ -3,9 +3,10 @@
*
* Implementation of player inventory.
*/
#include <algorithm>
#include <cstdint>
#include <utility>
#include <algorithm>
#include <fmt/format.h>
#include "DiabloUI/ui_flags.hpp"

2
Source/levels/drlg_l1.cpp

@ -1,5 +1,7 @@
#include "levels/drlg_l1.h"
#include <cstdint>
#include "engine/load_file.hpp"
#include "engine/point.hpp"
#include "engine/random.hpp"

2
Source/levels/drlg_l1.h

@ -5,6 +5,8 @@
*/
#pragma once
#include <cstdint>
#include "engine/world_tile.hpp"
#include "levels/gendung.h"

1
Source/levels/drlg_l2.cpp

@ -5,6 +5,7 @@
*/
#include "levels/drlg_l2.h"
#include <cstdint>
#include <list>
#include "diablo.h"

2
Source/levels/drlg_l2.h

@ -5,6 +5,8 @@
*/
#pragma once
#include <cstdint>
#include "levels/gendung.h"
namespace devilution {

3
Source/levels/drlg_l3.cpp

@ -1,4 +1,7 @@
#include "levels/drlg_l3.h"
#include <algorithm>
#include <cstdint>
#include "engine/load_file.hpp"
#include "engine/points_in_rectangle_range.hpp"

2
Source/levels/drlg_l3.h

@ -5,6 +5,8 @@
*/
#pragma once
#include <cstdint>
#include "levels/gendung.h"
namespace devilution {

2
Source/levels/drlg_l4.cpp

@ -5,6 +5,8 @@
*/
#include "levels/drlg_l4.h"
#include <cstdint>
#include "engine/load_file.hpp"
#include "engine/random.hpp"
#include "levels/gendung.h"

2
Source/levels/drlg_l4.h

@ -5,6 +5,8 @@
*/
#pragma once
#include <cstdint>
#include "engine/world_tile.hpp"
#include "levels/gendung.h"

5
Source/levels/gendung.cpp

@ -1,7 +1,8 @@
#include <stack>
#include "levels/gendung.h"
#include <cstdint>
#include <stack>
#include "engine/load_file.hpp"
#include "engine/random.hpp"
#include "init.h"

1
Source/loadsave.cpp

@ -6,6 +6,7 @@
#include "loadsave.h"
#include <climits>
#include <cstdint>
#include <cstring>
#include <numeric>
#include <unordered_map>

2
Source/loadsave.h

@ -5,6 +5,8 @@
*/
#pragma once
#include <cstdint>
#include "pfile.h"
#include "player.h"
#include "utils/attributes.h"

2
Source/menu.cpp

@ -4,6 +4,8 @@
* Implementation of functions for interacting with the main menu.
*/
#include <cstdint>
#include "DiabloUI/diabloui.h"
#include "DiabloUI/settingsmenu.h"
#include "engine/demomode.h"

2
Source/menu.h

@ -5,6 +5,8 @@
*/
#pragma once
#include <cstdint>
#include "multi.h"
namespace devilution {

1
Source/minitext.cpp

@ -3,6 +3,7 @@
*
* Implementation of scrolling dialog text.
*/
#include <cstdint>
#include <string>
#include <vector>

1
Source/monster.cpp

@ -6,6 +6,7 @@
#include "monster.h"
#include <climits>
#include <cstdint>
#include <algorithm>
#include <array>

2
Source/mpq/mpq_reader.cpp

@ -1,5 +1,7 @@
#include "mpq/mpq_reader.hpp"
#include <cstdint>
#include <libmpq/mpq.h>
#include "utils/stdcompat/optional.hpp"

1
Source/mpq/mpq_sdl_rwops.cpp

@ -1,5 +1,6 @@
#include "mpq/mpq_sdl_rwops.hpp"
#include <cstdint>
#include <cstring>
#include <memory>
#include <vector>

1
Source/msg.cpp

@ -4,6 +4,7 @@
* Implementation of function for sending and reciving network messages.
*/
#include <climits>
#include <cstdint>
#include <list>
#include <memory>
#include <unordered_map>

5
Source/multi.cpp

@ -4,10 +4,11 @@
* Implementation of functions for keeping multiplaye games in sync.
*/
#include <cstdint>
#include <ctime>
#include <SDL.h>
#include <config.h>
#include <ctime>
#include <fmt/format.h>
#include "DiabloUI/diabloui.h"

2
Source/nthread.cpp

@ -5,6 +5,8 @@
*/
#include "nthread.h"
#include <cstdint>
#include <fmt/core.h>
#include "diablo.h"

2
Source/nthread.h

@ -5,6 +5,8 @@
*/
#pragma once
#include <cstdint>
#include "player.h"
#include "utils/attributes.h"

2
Source/pack.cpp

@ -5,6 +5,8 @@
*/
#include "pack.h"
#include <cstdint>
#include "engine/random.hpp"
#include "init.h"
#include "loadsave.h"

1
Source/pfile.cpp

@ -5,6 +5,7 @@
*/
#include "pfile.h"
#include <cstdint>
#include <string>
#include <unordered_map>

2
Source/pfile.h

@ -5,6 +5,8 @@
*/
#pragma once
#include <cstdint>
#include "DiabloUI/diabloui.h"
#include "player.h"

1
Source/platform/ctr/asio/include/netinet/in.h

@ -1,5 +1,6 @@
#pragma once
#include <cstdint>
#include_next <netinet/in.h>
struct in6_addr {

1
Source/platform/ctr/display.cpp

@ -1,6 +1,7 @@
#include "platform/ctr/display.hpp"
#include <SDL.h>
#include <cstdint>
uint32_t Get3DSScalingFlag(bool fitToScreen, int width, int height)
{
if (fitToScreen)

1
Source/platform/ctr/random.cpp

@ -1,4 +1,5 @@
#include <3ds.h>
#include <cstdint>
#include <sodium.h>
#include <sys/types.h>

1
Source/platform/ctr/sockets.cpp

@ -1,5 +1,6 @@
#include "platform/ctr/sockets.hpp"
#include <cstdint>
#include <malloc.h>
#include <3ds.h>

1
Source/platform/switch/keyboard.cpp

@ -1,5 +1,6 @@
#include "platform/switch/keyboard.h"
#include <cstdint>
#include <cstring>
#include <SDL.h>

1
Source/platform/switch/random.cpp

@ -1,5 +1,6 @@
#include "platform/switch/random.hpp"
#include <cstdint>
#include <sys/types.h>
#include <sodium.h>

1
Source/platform/vita/random.cpp

@ -1,3 +1,4 @@
#include <cstdint>
#include <psp2/kernel/rng.h>
#include <sodium.h>
#include <sys/types.h>

1
Source/platform/vita/touch.cpp

@ -1,6 +1,7 @@
#include "platform/vita/touch.h"
#include <cmath>
#include <cstdint>
#include "options.h"
#include "utils/display.h"

2
Source/playerdat.cpp

@ -6,6 +6,8 @@
#include "playerdat.hpp"
#include <cstdint>
#include "items.h"
#include "player.h"
#include "textdat.h"

1
Source/plrmsg.cpp

@ -6,6 +6,7 @@
#include "plrmsg.h"
#include <algorithm>
#include <cstdint>
#include <fmt/format.h>

1
Source/qol/floatingnumbers.cpp

@ -1,5 +1,6 @@
#include "floatingnumbers.h"
#include <cstdint>
#include <ctime>
#include <deque>
#include <fmt/format.h>

2
Source/quests.cpp

@ -5,6 +5,8 @@
*/
#include "quests.h"
#include <cstdint>
#include <fmt/format.h>
#include "DiabloUI/ui_flags.hpp"

1
Source/stores.cpp

@ -6,6 +6,7 @@
#include "stores.h"
#include <algorithm>
#include <cstdint>
#include <fmt/format.h>

5
Source/storm/storm_net.cpp

@ -1,11 +1,14 @@
#include "storm/storm_net.hpp"
#include <cstdint>
#include <memory>
#ifndef NONET
#include "utils/sdl_mutex.h"
#include <mutex>
#include <thread>
#include <utility>
#include "utils/sdl_mutex.h"
#endif
#include "dvlnet/abstract_net.h"

1
Source/sync.cpp

@ -4,6 +4,7 @@
* Implementation of functionality for syncing game state with other players.
*/
#include <climits>
#include <cstdint>
#include "levels/gendung.h"
#include "monster.h"

2
Source/tmsg.cpp

@ -5,6 +5,8 @@
*/
#include <list>
#include <cstdint>
#include "diablo.h"
#include "tmsg.h"

1
Source/utils/cel_to_clx.cpp

@ -1,5 +1,6 @@
#include "utils/cel_to_clx.hpp"
#include <cstdint>
#include <cstring>
#include <vector>

1
Source/utils/cl2_to_clx.cpp

@ -1,5 +1,6 @@
#include "utils/cl2_to_clx.hpp"
#include <cstdint>
#include <cstring>
#include "utils/endian.hpp"

1
Source/utils/display.cpp

@ -1,6 +1,7 @@
#include "utils/display.h"
#include <algorithm>
#include <cstdint>
#ifdef __vita__
#include <psp2/power.h>

1
Source/utils/endian_stream.hpp

@ -1,5 +1,6 @@
#pragma once
#include <cstdint>
#include <cstdio>
#include <cstring>

1
Source/utils/file_util.cpp

@ -1,6 +1,7 @@
#include "utils/file_util.h"
#include <cerrno>
#include <cstdint>
#include <cstring>
#include <algorithm>

1
Source/utils/language.cpp

@ -1,5 +1,6 @@
#include "utils/language.h"
#include <cstdint>
#include <memory>
#include <unordered_map>
#include <vector>

1
Source/utils/surface_to_clx.cpp

@ -1,5 +1,6 @@
#include "utils/surface_to_clx.hpp"
#include <cstdint>
#include <cstring>
#include <vector>

1
Source/utils/utf8.cpp

@ -1,6 +1,7 @@
#include "utils/utf8.hpp"
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <hoehrmann_utf8.h>

Loading…
Cancel
Save