(svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values
This commit is contained in:
@@ -58,6 +58,8 @@
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
extern Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY);
|
||||
|
||||
/**
|
||||
|
@@ -20,6 +20,8 @@
|
||||
#include "../network/network.h"
|
||||
#include "../ai/ai_instance.hpp"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static char _ai_saveload_name[64];
|
||||
static int _ai_saveload_version;
|
||||
static char _ai_saveload_settings[1024];
|
||||
|
@@ -14,6 +14,8 @@
|
||||
#include "saveload.h"
|
||||
#include "newgrf_sl.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static void Save_APID()
|
||||
{
|
||||
Save_NewGRFMapping(_airport_mngr);
|
||||
|
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
extern TileIndex *_animated_tile_list;
|
||||
extern uint _animated_tile_count;
|
||||
extern uint _animated_tile_allocated;
|
||||
|
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static const SaveLoad _engine_renew_desc[] = {
|
||||
SLE_VAR(EngineRenew, from, SLE_UINT16),
|
||||
SLE_VAR(EngineRenew, to, SLE_UINT16),
|
||||
|
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/** Temporary storage of cargo monitoring data for loading or saving it. */
|
||||
struct TempStorage {
|
||||
CargoMonitorID number;
|
||||
|
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/**
|
||||
* Savegame conversion for cargopackets.
|
||||
*/
|
||||
|
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/**
|
||||
* Save the cheat values.
|
||||
*/
|
||||
|
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/**
|
||||
* Converts an old company manager's face format to the new company manager's face format
|
||||
*
|
||||
|
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static TownID _town_index;
|
||||
|
||||
static const SaveLoad _depot_desc[] = {
|
||||
|
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/** Prices in pre 126 savegames */
|
||||
static void Load_PRIC()
|
||||
{
|
||||
|
@@ -14,6 +14,8 @@
|
||||
#include "../engine_base.h"
|
||||
#include <map>
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static const SaveLoad _engine_desc[] = {
|
||||
SLE_CONDVAR(Engine, intro_date, SLE_FILE_U16 | SLE_VAR_I32, 0, 30),
|
||||
SLE_CONDVAR(Engine, intro_date, SLE_INT32, 31, SL_MAX_VERSION),
|
||||
|
@@ -20,6 +20,8 @@
|
||||
#include "../game/game_instance.hpp"
|
||||
#include "../game/game_text.hpp"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static char _game_saveload_name[64];
|
||||
static int _game_saveload_version;
|
||||
static char _game_saveload_settings[1024];
|
||||
|
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static const SaveLoad _glog_action_desc[] = {
|
||||
SLE_VAR(LoggedAction, tick, SLE_UINT16),
|
||||
SLE_END()
|
||||
|
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static const SaveLoad _goals_desc[] = {
|
||||
SLE_VAR(Goal, company, SLE_UINT16),
|
||||
SLE_VAR(Goal, type, SLE_UINT16),
|
||||
|
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static const SaveLoad _group_desc[] = {
|
||||
SLE_CONDVAR(Group, name, SLE_NAME, 0, 83),
|
||||
SLE_CONDSTR(Group, name, SLE_STR | SLF_ALLOW_CONTROL, 0, 84, SL_MAX_VERSION),
|
||||
|
@@ -15,6 +15,8 @@
|
||||
#include "saveload.h"
|
||||
#include "newgrf_sl.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static OldPersistentStorage _old_ind_persistent_storage;
|
||||
|
||||
static const SaveLoad _industry_desc[] = {
|
||||
|
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static SmallVector<RailTypeLabel, RAILTYPE_END> _railtype_list;
|
||||
|
||||
/**
|
||||
|
@@ -16,6 +16,8 @@
|
||||
#include "../settings_internal.h"
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
typedef LinkGraph::BaseNode Node;
|
||||
typedef LinkGraph::BaseEdge Edge;
|
||||
|
||||
|
@@ -16,6 +16,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static uint32 _map_dim_x;
|
||||
static uint32 _map_dim_y;
|
||||
|
||||
|
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
extern TileIndex _cur_tileloop_tile;
|
||||
extern uint16 _disaster_delay;
|
||||
extern byte _trees_tick_ctr;
|
||||
|
@@ -15,6 +15,8 @@
|
||||
#include "saveload.h"
|
||||
#include "newgrf_sl.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/** Save and load the mapping between a spec and the NewGRF it came from. */
|
||||
static const SaveLoad _newgrf_mapping_desc[] = {
|
||||
SLE_VAR(EntityIDMapping, grfid, SLE_UINT32),
|
||||
|
@@ -16,6 +16,8 @@
|
||||
#include "saveload.h"
|
||||
#include "newgrf_sl.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static const SaveLoad _object_desc[] = {
|
||||
SLE_VAR(Object, location.tile, SLE_UINT32),
|
||||
SLE_VAR(Object, location.w, SLE_FILE_U8 | SLE_VAR_U16),
|
||||
|
@@ -23,6 +23,8 @@
|
||||
|
||||
#include <exception>
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static const int TTO_HEADER_SIZE = 41;
|
||||
static const int TTD_HEADER_SIZE = 49;
|
||||
|
||||
|
@@ -34,6 +34,8 @@
|
||||
#include "../table/engines.h"
|
||||
#include "../table/townname.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static bool _read_ttdpatch_flags; ///< Have we (tried to) read TTDPatch extra flags?
|
||||
static uint16 _old_extra_chunk_nums; ///< Number of extra TTDPatch chunks
|
||||
static byte _old_vehicle_multiplier; ///< TTDPatch vehicle multiplier
|
||||
|
@@ -16,6 +16,8 @@
|
||||
|
||||
#include "saveload_internal.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/**
|
||||
* Converts this order from an old savegame's version;
|
||||
* it moves all bits to the new location.
|
||||
|
@@ -49,6 +49,8 @@
|
||||
#include "saveload_internal.h"
|
||||
#include "saveload_filter.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/*
|
||||
* Previous savegame versions, the trunk revision where they were
|
||||
* introduced and the released version that had that particular
|
||||
|
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/** Description of a sign within the savegame. */
|
||||
static const SaveLoad _sign_desc[] = {
|
||||
SLE_CONDVAR(Sign, name, SLE_NAME, 0, 83),
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#include "saveload.h"
|
||||
#include "table/strings.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/**
|
||||
* Update the buoy orders to be waypoint orders.
|
||||
* @param o the order 'list' to check.
|
||||
|
@@ -13,6 +13,8 @@
|
||||
#include "../newgrf_storage.h"
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/** Description of the data to save and load in #PersistentStorage. */
|
||||
static const SaveLoad _storage_desc[] = {
|
||||
SLE_CONDVAR(PersistentStorage, grfid, SLE_UINT32, 6, SL_MAX_VERSION),
|
||||
|
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/** Called after load to trash broken pages. */
|
||||
void AfterLoadStoryBook()
|
||||
{
|
||||
|
@@ -15,6 +15,8 @@
|
||||
|
||||
#include "table/strings.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static const int NUM_OLD_STRINGS = 512; ///< The number of custom strings stored in old savegames.
|
||||
static const int LEN_OLD_STRINGS = 32; ///< The number of characters per string.
|
||||
static const int LEN_OLD_STRINGS_TTO = 24; ///< The number of characters per string in TTO savegames.
|
||||
|
@@ -14,6 +14,8 @@
|
||||
|
||||
#include "saveload.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
static const SaveLoad _subsidies_desc[] = {
|
||||
SLE_VAR(Subsidy, cargo_type, SLE_UINT8),
|
||||
SLE_VAR(Subsidy, remaining, SLE_UINT8),
|
||||
|
@@ -18,6 +18,8 @@
|
||||
#include "saveload.h"
|
||||
#include "newgrf_sl.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/**
|
||||
* Rebuild all the cached variables of towns.
|
||||
*/
|
||||
|
@@ -24,6 +24,8 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/**
|
||||
* Link front and rear multiheaded engines to each other
|
||||
* This is done when loading a savegame
|
||||
|
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "saveload_internal.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
/** Helper structure to convert from the old waypoint system. */
|
||||
struct OldWaypoint {
|
||||
size_t index;
|
||||
|
Reference in New Issue
Block a user