(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:
rubidium
2014-04-23 20:13:33 +00:00
parent dd84952d15
commit 2be4215f43
402 changed files with 873 additions and 1 deletions

View File

@@ -58,6 +58,8 @@
#include <signal.h>
#include "../safeguards.h"
extern Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY);
/**

View File

@@ -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];

View File

@@ -14,6 +14,8 @@
#include "saveload.h"
#include "newgrf_sl.h"
#include "../safeguards.h"
static void Save_APID()
{
Save_NewGRFMapping(_airport_mngr);

View File

@@ -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;

View File

@@ -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),

View File

@@ -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;

View File

@@ -15,6 +15,8 @@
#include "saveload.h"
#include "../safeguards.h"
/**
* Savegame conversion for cargopackets.
*/

View File

@@ -14,6 +14,8 @@
#include "saveload.h"
#include "../safeguards.h"
/**
* Save the cheat values.
*/

View File

@@ -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
*

View File

@@ -15,6 +15,8 @@
#include "saveload.h"
#include "../safeguards.h"
static TownID _town_index;
static const SaveLoad _depot_desc[] = {

View File

@@ -15,6 +15,8 @@
#include "saveload.h"
#include "../safeguards.h"
/** Prices in pre 126 savegames */
static void Load_PRIC()
{

View File

@@ -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),

View File

@@ -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];

View File

@@ -15,6 +15,8 @@
#include "saveload.h"
#include "../safeguards.h"
static const SaveLoad _glog_action_desc[] = {
SLE_VAR(LoggedAction, tick, SLE_UINT16),
SLE_END()

View File

@@ -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),

View File

@@ -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),

View File

@@ -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[] = {

View File

@@ -15,6 +15,8 @@
#include "saveload.h"
#include "../safeguards.h"
static SmallVector<RailTypeLabel, RAILTYPE_END> _railtype_list;
/**

View File

@@ -16,6 +16,8 @@
#include "../settings_internal.h"
#include "saveload.h"
#include "../safeguards.h"
typedef LinkGraph::BaseNode Node;
typedef LinkGraph::BaseEdge Edge;

View File

@@ -16,6 +16,8 @@
#include "saveload.h"
#include "../safeguards.h"
static uint32 _map_dim_x;
static uint32 _map_dim_y;

View File

@@ -21,6 +21,8 @@
#include "saveload.h"
#include "../safeguards.h"
extern TileIndex _cur_tileloop_tile;
extern uint16 _disaster_delay;
extern byte _trees_tick_ctr;

View File

@@ -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),

View File

@@ -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),

View File

@@ -23,6 +23,8 @@
#include <exception>
#include "../safeguards.h"
static const int TTO_HEADER_SIZE = 41;
static const int TTD_HEADER_SIZE = 49;

View File

@@ -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

View File

@@ -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.

View File

@@ -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

View File

@@ -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),

View File

@@ -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.

View File

@@ -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),

View File

@@ -14,6 +14,8 @@
#include "saveload.h"
#include "../safeguards.h"
/** Called after load to trash broken pages. */
void AfterLoadStoryBook()
{

View File

@@ -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.

View File

@@ -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),

View File

@@ -18,6 +18,8 @@
#include "saveload.h"
#include "newgrf_sl.h"
#include "../safeguards.h"
/**
* Rebuild all the cached variables of towns.
*/

View File

@@ -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

View File

@@ -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;