mirror of https://github.com/OpenTTD/OpenTTD
Codefix: stdafx.h and safeguards.h should be the first and last include in every source file, and not appear in any header file.
parent
54de376c55
commit
461b73e21b
|
@ -10,8 +10,6 @@
|
|||
#ifndef KDTREE_HPP
|
||||
#define KDTREE_HPP
|
||||
|
||||
#include "../stdafx.h"
|
||||
|
||||
/**
|
||||
* K-dimensional tree, specialised for 2-dimensional space.
|
||||
* This is not intended as a primary storage of data, but as an index into existing data.
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include "stdafx.h"
|
||||
#include "error_func.h"
|
||||
#include "safeguards.h"
|
||||
|
||||
[[noreturn]] void NOT_REACHED(const std::source_location location)
|
||||
{
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
/** @file framerate_gui.cpp GUI for displaying framerate/game speed information. */
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "framerate_type.h"
|
||||
#include <chrono>
|
||||
#include "gfx_func.h"
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
#ifndef FRAMERATE_TYPE_H
|
||||
#define FRAMERATE_TYPE_H
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "core/enum_type.hpp"
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <fluidsynth.h>
|
||||
#include "../mixer.h"
|
||||
#include <mutex>
|
||||
#include "../safeguards.h"
|
||||
|
||||
static struct {
|
||||
fluid_settings_t *settings; ///< FluidSynth settings handle
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#ifndef MUSIC_MIDI_H
|
||||
#define MUSIC_MIDI_H
|
||||
|
||||
#include "../stdafx.h"
|
||||
|
||||
/** Header of a Stanard MIDI File */
|
||||
struct SMFHeader {
|
||||
uint16_t format;
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
/* @file midifile.cpp Parser for standard MIDI files */
|
||||
|
||||
#include "../stdafx.h"
|
||||
|
||||
#include "midifile.hpp"
|
||||
#include "../fileio_func.h"
|
||||
#include "../fileio_type.h"
|
||||
|
@ -21,6 +23,8 @@
|
|||
|
||||
#include "table/strings.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/* SMF reader based on description at: http://www.somascape.org/midi/tech/mfile.html */
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#ifndef MUSIC_MIDIFILE_HPP
|
||||
#define MUSIC_MIDIFILE_HPP
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../fileio_type.h"
|
||||
#include "midi.h"
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
|
||||
/** @file newgrf_profiling.cpp Profiling of NewGRF action 2 handling. */
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "newgrf_profiling.h"
|
||||
#include "fileio_func.h"
|
||||
#include "string_func.h"
|
||||
|
@ -18,6 +20,7 @@
|
|||
|
||||
#include <chrono>
|
||||
|
||||
#include "safeguards.h"
|
||||
|
||||
std::vector<NewGRFProfiler> _newgrf_profilers;
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#ifndef NEWGRF_PROFILING_H
|
||||
#define NEWGRF_PROFILING_H
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "timer/timer_game_calendar.h"
|
||||
#include "newgrf.h"
|
||||
#include "newgrf_callbacks.h"
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "macos.h"
|
||||
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include "../../safeguards.h"
|
||||
|
||||
|
||||
/* CTRunDelegateCreate is supported since MacOS X 10.5, but was only included in the SDKs starting with the 10.9 SDK. */
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "../ship.h"
|
||||
#include "../debug.h"
|
||||
#include "../3rdparty/fmt/ranges.h"
|
||||
#include "../safeguards.h"
|
||||
|
||||
using TWaterRegionTraversabilityBits = uint16_t;
|
||||
constexpr TWaterRegionPatchLabel FIRST_REGION_LABEL = 1;
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#ifndef YAPF_SHIP_REGIONS_H
|
||||
#define YAPF_SHIP_REGIONS_H
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "../../tile_type.h"
|
||||
#include "../water_regions.h"
|
||||
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#ifndef SPRITECACHE_INTERNAL_H
|
||||
#define SPRITECACHE_INTERNAL_H
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "core/math_func.hpp"
|
||||
#include "gfx_type.h"
|
||||
#include "spriteloader/spriteloader.hpp"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include "../stdafx.h"
|
||||
#include "sprite_file_type.hpp"
|
||||
#include "../safeguards.h"
|
||||
|
||||
/** Signature of a container version 2 GRF. */
|
||||
extern const std::array<uint8_t, 8> _grf_cont_v2_sig = {'G', 'R', 'F', 0x82, 0x0D, 0x0A, 0x1A, 0x0A};
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
#include "../core/bitmath_func.hpp"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
TEST_CASE("SetBitIterator tests")
|
||||
{
|
||||
auto test_case = [&](auto input, std::initializer_list<uint> expected) {
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
#include "../3rdparty/catch2/catch.hpp"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
enum TestEnum : int8_t {
|
||||
ZERO,
|
||||
ONE,
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include "../landscape.h"
|
||||
#include "../slope_func.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/**
|
||||
* Check whether the addition of two slope's GetPartialPixelZ values results in
|
||||
* the GetPartialPixelZ values of the expected slope.
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
#include "../core/math_func.hpp"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
TEST_CASE("DivideApproxTest - Negative")
|
||||
{
|
||||
CHECK(-2 == DivideApprox(-5, 2));
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
#ifndef MOCK_FONTCACHE_H
|
||||
#define MOCK_FONTCACHE_H
|
||||
|
||||
#include "../stdafx.h"
|
||||
|
||||
#include "../fontcache.h"
|
||||
#include "../string_func.h"
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
#include "../spritecache_internal.h"
|
||||
#include "../table/sprites.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static bool MockLoadNextSprite(SpriteID load_index)
|
||||
{
|
||||
static UniquePtrSpriteAllocator allocator;
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
#include "table/strings.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/**** String compare/equals *****/
|
||||
|
||||
TEST_CASE("StrCompareIgnoreCase - std::string")
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
#include "../network/core/packet.h"
|
||||
#include "../string_func.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/* The length of the hexadecimal representation of a X25519 key must fit in the key length. */
|
||||
static_assert(NETWORK_SECRET_KEY_LENGTH >= X25519_KEY_SIZE * 2 + 1);
|
||||
static_assert(NETWORK_PUBLIC_KEY_LENGTH >= X25519_KEY_SIZE * 2 + 1);
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
#include <squirrel.h>
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/**
|
||||
* A controller to start enough so we can use Squirrel for testing.
|
||||
*
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
#include "../window_gui.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/**
|
||||
* List of WindowDescs. Defined in window.cpp but not exposed as this unit-test is the only other place that needs it.
|
||||
* WindowDesc is a self-registering class so all WindowDescs will be included in the list.
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#ifndef TIMER_GAME_CALENDAR_H
|
||||
#define TIMER_GAME_CALENDAR_H
|
||||
|
||||
#include "../stdafx.h"
|
||||
#include "../core/strong_typedef_type.hpp"
|
||||
#include "timer_game_common.h"
|
||||
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
#ifndef TIMER_MANAGER_H
|
||||
#define TIMER_MANAGER_H
|
||||
|
||||
#include "../stdafx.h"
|
||||
|
||||
template <typename TTimerType>
|
||||
class BaseTimer;
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
#include "../window_func.h"
|
||||
#include "video_driver.hpp"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
bool _video_hw_accel; ///< Whether to consider hardware accelerated video drivers on startup.
|
||||
bool _video_vsync; ///< Whether we should use vsync (only if active video driver supports HW acceleration).
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
/** @file viewport_sprite_sorter.h Types related to sprite sorting. */
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "gfx_type.h"
|
||||
|
||||
#ifndef VIEWPORT_SPRITE_SORTER_H
|
||||
|
|
Loading…
Reference in New Issue