1
0
Fork 0

Codechange: Replace SmallVector::Clear() with std::vector::clear()

pull/7419/head
Henry Wilson 2018-09-20 23:44:14 +01:00 committed by PeterN
parent 4b349c0f90
commit bfd79e59dc
47 changed files with 80 additions and 88 deletions

View File

@ -75,5 +75,5 @@ void AnimateAnimatedTiles()
*/ */
void InitializeAnimatedTiles() void InitializeAnimatedTiles()
{ {
_animated_tiles.Clear(); _animated_tiles.clear();
} }

View File

@ -123,7 +123,7 @@ class ReplaceVehicleWindow : public Window {
byte side = draw_left ? 0 : 1; byte side = draw_left ? 0 : 1;
GUIEngineList *list = &this->engines[side]; GUIEngineList *list = &this->engines[side];
list->Clear(); list->clear();
const Engine *e; const Engine *e;
FOR_ALL_ENGINES_OF_TYPE(e, type) { FOR_ALL_ENGINES_OF_TYPE(e, type) {
@ -170,7 +170,7 @@ class ReplaceVehicleWindow : public Window {
/* Either we got a request to rebuild the right engines list, or the left engines list selected a different engine */ /* Either we got a request to rebuild the right engines list, or the left engines list selected a different engine */
if (this->sel_engine[0] == INVALID_ENGINE) { if (this->sel_engine[0] == INVALID_ENGINE) {
/* Always empty the right engines list when nothing is selected in the left engines list */ /* Always empty the right engines list when nothing is selected in the left engines list */
this->engines[1].Clear(); this->engines[1].clear();
this->sel_engine[1] = INVALID_ENGINE; this->sel_engine[1] = INVALID_ENGINE;
} else { } else {
if (this->reset_sel_engine && this->sel_engine[0] != INVALID_ENGINE) { if (this->reset_sel_engine && this->sel_engine[0] != INVALID_ENGINE) {

View File

@ -1228,7 +1228,7 @@ struct BuildVehicleWindow : Window {
this->filter.railtype = (this->listview_mode) ? RAILTYPE_END : GetRailType(this->window_number); this->filter.railtype = (this->listview_mode) ? RAILTYPE_END : GetRailType(this->window_number);
this->eng_list.Clear(); this->eng_list.clear();
/* Make list of all available train engines and wagons. /* Make list of all available train engines and wagons.
* Also check to see if the previously selected engine is still available, * Also check to see if the previously selected engine is still available,
@ -1276,7 +1276,7 @@ struct BuildVehicleWindow : Window {
{ {
EngineID sel_id = INVALID_ENGINE; EngineID sel_id = INVALID_ENGINE;
this->eng_list.Clear(); this->eng_list.clear();
const Engine *e; const Engine *e;
FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) { FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) {
@ -1295,7 +1295,7 @@ struct BuildVehicleWindow : Window {
void GenerateBuildShipList() void GenerateBuildShipList()
{ {
EngineID sel_id = INVALID_ENGINE; EngineID sel_id = INVALID_ENGINE;
this->eng_list.Clear(); this->eng_list.clear();
const Engine *e; const Engine *e;
FOR_ALL_ENGINES_OF_TYPE(e, VEH_SHIP) { FOR_ALL_ENGINES_OF_TYPE(e, VEH_SHIP) {
@ -1314,7 +1314,7 @@ struct BuildVehicleWindow : Window {
{ {
EngineID sel_id = INVALID_ENGINE; EngineID sel_id = INVALID_ENGINE;
this->eng_list.Clear(); this->eng_list.clear();
const Station *st = this->listview_mode ? NULL : Station::GetByTile(this->window_number); const Station *st = this->listview_mode ? NULL : Station::GetByTile(this->window_number);

View File

@ -469,7 +469,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, DoCommandFlag flags,
/* only execute the test call if it's toplevel, or we're not execing. */ /* only execute the test call if it's toplevel, or we're not execing. */
if (_docommand_recursive == 1 || !(flags & DC_EXEC) ) { if (_docommand_recursive == 1 || !(flags & DC_EXEC) ) {
if (_docommand_recursive == 1) _cleared_object_areas.Clear(); if (_docommand_recursive == 1) _cleared_object_areas.clear();
SetTownRatingTestMode(true); SetTownRatingTestMode(true);
res = proc(tile, flags & ~DC_EXEC, p1, p2, text); res = proc(tile, flags & ~DC_EXEC, p1, p2, text);
SetTownRatingTestMode(false); SetTownRatingTestMode(false);
@ -492,7 +492,7 @@ CommandCost DoCommand(TileIndex tile, uint32 p1, uint32 p2, DoCommandFlag flags,
/* Execute the command here. All cost-relevant functions set the expenses type /* Execute the command here. All cost-relevant functions set the expenses type
* themselves to the cost object at some point */ * themselves to the cost object at some point */
if (_docommand_recursive == 1) _cleared_object_areas.Clear(); if (_docommand_recursive == 1) _cleared_object_areas.clear();
res = proc(tile, flags, p1, p2, text); res = proc(tile, flags, p1, p2, text);
if (res.Failed()) { if (res.Failed()) {
error: error:
@ -666,7 +666,7 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd,
bool test_and_exec_can_differ = (cmd_flags & CMD_NO_TEST) != 0; bool test_and_exec_can_differ = (cmd_flags & CMD_NO_TEST) != 0;
/* Test the command. */ /* Test the command. */
_cleared_object_areas.Clear(); _cleared_object_areas.clear();
SetTownRatingTestMode(true); SetTownRatingTestMode(true);
BasePersistentStorageArray::SwitchMode(PSM_ENTER_TESTMODE); BasePersistentStorageArray::SwitchMode(PSM_ENTER_TESTMODE);
CommandCost res = proc(tile, flags, p1, p2, text); CommandCost res = proc(tile, flags, p1, p2, text);
@ -710,7 +710,7 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd,
/* Actually try and execute the command. If no cost-type is given /* Actually try and execute the command. If no cost-type is given
* use the construction one */ * use the construction one */
_cleared_object_areas.Clear(); _cleared_object_areas.clear();
BasePersistentStorageArray::SwitchMode(PSM_ENTER_COMMAND); BasePersistentStorageArray::SwitchMode(PSM_ENTER_COMMAND);
CommandCost res2 = proc(tile, flags | DC_EXEC, p1, p2, text); CommandCost res2 = proc(tile, flags | DC_EXEC, p1, p2, text);
BasePersistentStorageArray::SwitchMode(PSM_LEAVE_COMMAND); BasePersistentStorageArray::SwitchMode(PSM_LEAVE_COMMAND);

View File

@ -652,8 +652,8 @@ private:
{ {
if (!this->groups.NeedRebuild()) return; if (!this->groups.NeedRebuild()) return;
this->groups.Clear(); this->groups.clear();
this->indents.Clear(); this->indents.clear();
if (this->livery_class >= LC_GROUP_RAIL) { if (this->livery_class >= LC_GROUP_RAIL) {
GUIGroupList list; GUIGroupList list;

View File

@ -77,14 +77,6 @@ public:
std::vector<T>::operator=(other); std::vector<T>::operator=(other);
} }
/**
* Remove all items from the list.
*/
inline void Clear()
{
std::vector<T>::clear();
}
/** /**
* Remove all items from the list and free allocated memory. * Remove all items from the list and free allocated memory.
*/ */

View File

@ -1949,7 +1949,7 @@ void LoadUnloadStation(Station *st)
for (Industry **iid = _cargo_delivery_destinations.Begin(); iid != isend; iid++) { for (Industry **iid = _cargo_delivery_destinations.Begin(); iid != isend; iid++) {
TriggerIndustryProduction(*iid); TriggerIndustryProduction(*iid);
} }
_cargo_delivery_destinations.Clear(); _cargo_delivery_destinations.clear();
} }
/** /**

View File

@ -487,7 +487,7 @@ StringID Engine::GetAircraftTypeText() const
*/ */
void EngineOverrideManager::ResetToDefaultMapping() void EngineOverrideManager::ResetToDefaultMapping()
{ {
this->Clear(); this->clear();
for (VehicleType type = VEH_TRAIN; type <= VEH_AIRCRAFT; type++) { for (VehicleType type = VEH_TRAIN; type <= VEH_AIRCRAFT; type++) {
for (uint internal_id = 0; internal_id < _engine_counts[type]; internal_id++) { for (uint internal_id = 0; internal_id < _engine_counts[type]; internal_id++) {
EngineIDMapping *eid = this->Append(); EngineIDMapping *eid = this->Append();

View File

@ -185,7 +185,7 @@ public:
/** Remove all items from the list. */ /** Remove all items from the list. */
inline void Clear() inline void Clear()
{ {
this->files.Clear(); this->files.clear();
} }
/** Compact the list down to the smallest block size boundary. */ /** Compact the list down to the smallest block size boundary. */

View File

@ -61,7 +61,7 @@ void LoadCheckData::Clear()
for (CompanyPropertiesMap::iterator it = this->companies.Begin(); it != end; it++) { for (CompanyPropertiesMap::iterator it = this->companies.Begin(); it != end; it++) {
delete it->second; delete it->second;
} }
companies.Clear(); companies.clear();
GamelogFree(this->gamelog_action, this->gamelog_actions); GamelogFree(this->gamelog_action, this->gamelog_actions);
this->gamelog_action = NULL; this->gamelog_action = NULL;

View File

@ -600,7 +600,7 @@ static inline void GetLayouter(Layouter::LineCacheItem &line, const char *&str,
Font *f = Layouter::GetFont(state.fontsize, state.cur_colour); Font *f = Layouter::GetFont(state.fontsize, state.cur_colour);
line.buffer = buff_begin; line.buffer = buff_begin;
fontMapping.Clear(); fontMapping.clear();
/* /*
* Go through the whole string while adding Font instances to the font map * Go through the whole string while adding Font instances to the font map
@ -847,7 +847,7 @@ void Layouter::ResetFontCache(FontSize size)
for (FontColourMap::iterator it = fonts[size].Begin(); it != fonts[size].End(); ++it) { for (FontColourMap::iterator it = fonts[size].Begin(); it != fonts[size].End(); ++it) {
delete it->second; delete it->second;
} }
fonts[size].Clear(); fonts[size].clear();
/* We must reset the linecache since it references the just freed fonts */ /* We must reset the linecache since it references the just freed fonts */
ResetLineCache(); ResetLineCache();

View File

@ -1136,7 +1136,7 @@ private:
{ {
if (!this->companies.NeedRebuild()) return; if (!this->companies.NeedRebuild()) return;
this->companies.Clear(); this->companies.clear();
const Company *c; const Company *c;
FOR_ALL_COMPANIES(c) { FOR_ALL_COMPANIES(c) {

View File

@ -167,8 +167,8 @@ private:
{ {
if (!this->groups.NeedRebuild()) return; if (!this->groups.NeedRebuild()) return;
this->groups.Clear(); this->groups.clear();
this->indents.Clear(); this->indents.clear();
GUIGroupList list; GUIGroupList list;

View File

@ -273,7 +273,7 @@ void HotkeyList::Load(IniFile *ini)
for (Hotkey *hotkey = this->items; hotkey->name != NULL; ++hotkey) { for (Hotkey *hotkey = this->items; hotkey->name != NULL; ++hotkey) {
IniItem *item = group->GetItem(hotkey->name, false); IniItem *item = group->GetItem(hotkey->name, false);
if (item != NULL) { if (item != NULL) {
hotkey->keycodes.Clear(); hotkey->keycodes.clear();
if (item->value != NULL) ParseHotkeys(hotkey, item->value); if (item->value != NULL) ParseHotkeys(hotkey, item->value);
} }
} }

View File

@ -1202,7 +1202,7 @@ protected:
void BuildSortIndustriesList() void BuildSortIndustriesList()
{ {
if (this->industries.NeedRebuild()) { if (this->industries.NeedRebuild()) {
this->industries.Clear(); this->industries.clear();
const Industry *i; const Industry *i;
FOR_ALL_INDUSTRIES(i) { FOR_ALL_INDUSTRIES(i) {
@ -2414,7 +2414,7 @@ struct IndustryCargoesWindow : public Window {
_displayed_industries.reset(); _displayed_industries.reset();
_displayed_industries.set(it); _displayed_industries.set(it);
this->fields.Clear(); this->fields.clear();
CargoesRow *row = this->fields.Append(); CargoesRow *row = this->fields.Append();
row->columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS); row->columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS);
row->columns[1].MakeEmpty(CFT_SMALL_EMPTY); row->columns[1].MakeEmpty(CFT_SMALL_EMPTY);
@ -2492,7 +2492,7 @@ struct IndustryCargoesWindow : public Window {
this->ind_cargo = cid + NUM_INDUSTRYTYPES; this->ind_cargo = cid + NUM_INDUSTRYTYPES;
_displayed_industries.reset(); _displayed_industries.reset();
this->fields.Clear(); this->fields.clear();
CargoesRow *row = this->fields.Append(); CargoesRow *row = this->fields.Append();
row->columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS); row->columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS);
row->columns[1].MakeEmpty(CFT_SMALL_EMPTY); row->columns[1].MakeEmpty(CFT_SMALL_EMPTY);

View File

@ -164,7 +164,7 @@ public:
for (SocketList::iterator s = sockets.Begin(); s != sockets.End(); s++) { for (SocketList::iterator s = sockets.Begin(); s != sockets.End(); s++) {
closesocket(s->second); closesocket(s->second);
} }
sockets.Clear(); sockets.clear();
DEBUG(net, 1, "[%s] closed listeners", Tsocket::GetName()); DEBUG(net, 1, "[%s] closed listeners", Tsocket::GetName());
} }
}; };

View File

@ -62,7 +62,7 @@ void NetworkUDPSocketHandler::Close()
for (SocketList::iterator s = this->sockets.Begin(); s != this->sockets.End(); s++) { for (SocketList::iterator s = this->sockets.Begin(); s != this->sockets.End(); s++) {
closesocket(s->second); closesocket(s->second);
} }
this->sockets.Clear(); this->sockets.clear();
} }
NetworkRecvStatus NetworkUDPSocketHandler::CloseConnection(bool error) NetworkRecvStatus NetworkUDPSocketHandler::CloseConnection(bool error)

View File

@ -981,7 +981,7 @@ void ClientNetworkContentSocketHandler::CheckDependencyState(ContentInfo *ci)
if (c->state != ContentInfo::AUTOSELECTED) continue; if (c->state != ContentInfo::AUTOSELECTED) continue;
/* Only unselect when WE are the only parent. */ /* Only unselect when WE are the only parent. */
parents.Clear(); parents.clear();
this->ReverseLookupDependency(parents, c); this->ReverseLookupDependency(parents, c);
/* First check whether anything depends on us */ /* First check whether anything depends on us */
@ -1000,7 +1000,7 @@ void ClientNetworkContentSocketHandler::CheckDependencyState(ContentInfo *ci)
if (force_selection) continue; if (force_selection) continue;
/* "Flood" search to find all items in the dependency graph*/ /* "Flood" search to find all items in the dependency graph*/
parents.Clear(); parents.clear();
this->ReverseLookupTreeDependency(parents, c); this->ReverseLookupTreeDependency(parents, c);
/* Is there anything that is "force" selected?, if so... we're done. */ /* Is there anything that is "force" selected?, if so... we're done. */
@ -1033,8 +1033,8 @@ void ClientNetworkContentSocketHandler::Clear()
{ {
for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) delete *iter; for (ContentIterator iter = this->infos.Begin(); iter != this->infos.End(); iter++) delete *iter;
this->infos.Clear(); this->infos.clear();
this->requested.Clear(); this->requested.clear();
} }
/*** CALLBACK ***/ /*** CALLBACK ***/

View File

@ -385,7 +385,7 @@ class NetworkContentListWindow : public Window, ContentCallback {
if (!this->content.NeedRebuild()) return; if (!this->content.NeedRebuild()) return;
/* Create temporary array of games to use for listing */ /* Create temporary array of games to use for listing */
this->content.Clear(); this->content.clear();
bool all_available = true; bool all_available = true;

View File

@ -250,7 +250,7 @@ protected:
if (!this->servers.NeedRebuild()) return; if (!this->servers.NeedRebuild()) return;
/* Create temporary array of games to use for listing */ /* Create temporary array of games to use for listing */
this->servers.Clear(); this->servers.clear();
for (NetworkGameList *ngl = _network_game_list; ngl != NULL; ngl = ngl->next) { for (NetworkGameList *ngl = _network_game_list; ngl != NULL; ngl = ngl->next) {
*this->servers.Append() = ngl; *this->servers.Append() = ngl;

View File

@ -668,7 +668,7 @@ void NetworkUDPInitialize()
GetBindAddresses(&server, _settings_client.network.server_port); GetBindAddresses(&server, _settings_client.network.server_port);
_udp_server_socket = new ServerNetworkUDPSocketHandler(&server); _udp_server_socket = new ServerNetworkUDPSocketHandler(&server);
server.Clear(); server.clear();
GetBindAddresses(&server, 0); GetBindAddresses(&server, 0);
_udp_master_socket = new MasterNetworkUDPSocketHandler(&server); _udp_master_socket = new MasterNetworkUDPSocketHandler(&server);

View File

@ -1906,7 +1906,7 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte
if (_cur.skip_sprites < 0) return CIR_DISABLED; if (_cur.skip_sprites < 0) return CIR_DISABLED;
static SmallVector<DrawTileSeqStruct, 8> tmp_layout; static SmallVector<DrawTileSeqStruct, 8> tmp_layout;
tmp_layout.Clear(); tmp_layout.clear();
for (;;) { for (;;) {
/* no relative bounding box support */ /* no relative bounding box support */
DrawTileSeqStruct *dtss = tmp_layout.Append(); DrawTileSeqStruct *dtss = tmp_layout.Append();
@ -2591,7 +2591,7 @@ static ChangeInfoResult LoadTranslationTable(uint gvid, int numinfo, ByteReader
return CIR_INVALID_ID; return CIR_INVALID_ID;
} }
translation_table.Clear(); translation_table.clear();
for (int i = 0; i < numinfo; i++) { for (int i = 0; i < numinfo; i++) {
uint32 item = buf->ReadDWord(); uint32 item = buf->ReadDWord();
*translation_table.Append() = BSWAP32(item); *translation_table.Append() = BSWAP32(item);
@ -4791,7 +4791,7 @@ static void NewSpriteGroup(ByteReader *buf)
} }
static SmallVector<DeterministicSpriteGroupAdjust, 16> adjusts; static SmallVector<DeterministicSpriteGroupAdjust, 16> adjusts;
adjusts.Clear(); adjusts.clear();
/* Loop through the var adjusts. Unfortunately we don't know how many we have /* Loop through the var adjusts. Unfortunately we don't know how many we have
* from the outset, so we shall have to keep reallocing. */ * from the outset, so we shall have to keep reallocing. */
@ -8246,7 +8246,7 @@ static void ResetNewGRF()
delete *file; delete *file;
} }
_grf_files.Clear(); _grf_files.clear();
_cur.grffile = NULL; _cur.grffile = NULL;
} }
@ -9332,7 +9332,7 @@ static void AfterLoadGRFs()
for (StringIDMapping *it = _string_to_grf_mapping.Begin(); it != _string_to_grf_mapping.End(); it++) { for (StringIDMapping *it = _string_to_grf_mapping.Begin(); it != _string_to_grf_mapping.End(); it++) {
*it->target = MapGRFStringID(it->grfid, it->source); *it->target = MapGRFStringID(it->grfid, it->source);
} }
_string_to_grf_mapping.Clear(); _string_to_grf_mapping.clear();
/* Free the action 6 override sprites. */ /* Free the action 6 override sprites. */
for (GRFLineToSpriteOverride::iterator it = _grf_line_to_action6_sprite_override.begin(); it != _grf_line_to_action6_sprite_override.end(); it++) { for (GRFLineToSpriteOverride::iterator it = _grf_line_to_action6_sprite_override.begin(); it != _grf_line_to_action6_sprite_override.end(); it++) {

View File

@ -661,7 +661,7 @@ void NewGRFSpriteLayout::AllocateRegisters()
*/ */
uint32 NewGRFSpriteLayout::PrepareLayout(uint32 orig_offset, uint32 newgrf_ground_offset, uint32 newgrf_offset, uint constr_stage, bool separate_ground) const uint32 NewGRFSpriteLayout::PrepareLayout(uint32 orig_offset, uint32 newgrf_ground_offset, uint32 newgrf_offset, uint constr_stage, bool separate_ground) const
{ {
result_seq.Clear(); result_seq.clear();
uint32 var10_values = 0; uint32 var10_values = 0;
/* Create a copy of the spritelayout, so we can modify some values. /* Create a copy of the spritelayout, so we can modify some values.

View File

@ -1456,7 +1456,7 @@ private:
{ {
if (!this->avails.NeedRebuild()) return; if (!this->avails.NeedRebuild()) return;
this->avails.Clear(); this->avails.clear();
for (const GRFConfig *c = _all_grfs; c != NULL; c = c->next) { for (const GRFConfig *c = _all_grfs; c != NULL; c = c->next) {
bool found = false; bool found = false;

View File

@ -40,7 +40,7 @@ SoundEntry *AllocateSound(uint num)
void InitializeSoundPool() void InitializeSoundPool()
{ {
_sounds.Clear(); _sounds.clear();
/* Copy original sound data to the pool */ /* Copy original sound data to the pool */
SndCopyToPool(); SndCopyToPool();

View File

@ -167,7 +167,7 @@ RailType AllocateRailType(RailTypeLabel label)
/* Set up new rail type */ /* Set up new rail type */
*rti = _original_railtypes[RAILTYPE_RAIL]; *rti = _original_railtypes[RAILTYPE_RAIL];
rti->label = label; rti->label = label;
rti->alternate_labels.Clear(); rti->alternate_labels.clear();
/* Make us compatible with ourself. */ /* Make us compatible with ourself. */
rti->powered_railtypes = (RailTypes)(1LL << rt); rti->powered_railtypes = (RailTypes)(1LL << rt);

View File

@ -2942,7 +2942,7 @@ bool AfterLoadGame()
SmallVector<uint, 16> skip_frames; SmallVector<uint, 16> skip_frames;
FOR_ALL_ROADVEHICLES(v) { FOR_ALL_ROADVEHICLES(v) {
if (!v->IsFrontEngine()) continue; if (!v->IsFrontEngine()) continue;
skip_frames.Clear(); skip_frames.clear();
TileIndex prev_tile = v->tile; TileIndex prev_tile = v->tile;
uint prev_tile_skip = 0; uint prev_tile_skip = 0;
uint cur_skip = 0; uint cur_skip = 0;

View File

@ -48,7 +48,7 @@ static void Load_ANIT()
} }
uint count = (uint)SlGetFieldLength() / sizeof(*_animated_tiles.Begin()); uint count = (uint)SlGetFieldLength() / sizeof(*_animated_tiles.Begin());
_animated_tiles.Clear(); _animated_tiles.clear();
_animated_tiles.Append(count); _animated_tiles.Append(count);
SlArray(_animated_tiles.Begin(), count, SLE_UINT32); SlArray(_animated_tiles.Begin(), count, SLE_UINT32);
} }

View File

@ -187,7 +187,7 @@ static void Save_EIDS()
static void Load_EIDS() static void Load_EIDS()
{ {
_engine_mngr.Clear(); _engine_mngr.clear();
while (SlIterateArray() != -1) { while (SlIterateArray() != -1) {
EngineIDMapping *eid = _engine_mngr.Append(); EngineIDMapping *eid = _engine_mngr.Append();

View File

@ -81,7 +81,7 @@ void AfterLoadLabelMaps()
} }
} }
_railtype_list.Clear(); _railtype_list.clear();
} }
/** Container for a label for SaveLoad system */ /** Container for a label for SaveLoad system */
@ -108,7 +108,7 @@ static void Save_RAIL()
static void Load_RAIL() static void Load_RAIL()
{ {
_railtype_list.Clear(); _railtype_list.clear();
LabelObject lo; LabelObject lo;

View File

@ -172,7 +172,7 @@ static const SaveLoad _old_waypoint_desc[] = {
static void Load_WAYP() static void Load_WAYP()
{ {
/* Precaution for when loading failed and it didn't get cleared */ /* Precaution for when loading failed and it didn't get cleared */
_old_waypoints.Clear(); _old_waypoints.clear();
int index; int index;
@ -201,7 +201,7 @@ static void Ptrs_WAYP()
* whether we're in the NULL or "normal" Ptrs proc. So just clear the list * whether we're in the NULL or "normal" Ptrs proc. So just clear the list
* of old waypoints we constructed and then this waypoint (and the other * of old waypoints we constructed and then this waypoint (and the other
* possibly corrupt ones) will not be queried in the NULL Ptrs proc run. */ * possibly corrupt ones) will not be queried in the NULL Ptrs proc run. */
_old_waypoints.Clear(); _old_waypoints.clear();
SlErrorCorrupt("Referencing invalid Town"); SlErrorCorrupt("Referencing invalid Town");
} }
wp->town = Town::Get(wp->town_index); wp->town = Town::Get(wp->town_index);

View File

@ -103,7 +103,7 @@ public:
/** Clear the temporary storage. */ /** Clear the temporary storage. */
void Clear() void Clear()
{ {
this->output_buffer.Clear(); this->output_buffer.clear();
} }
/** /**

View File

@ -60,7 +60,7 @@ struct SignList {
DEBUG(misc, 3, "Building sign list"); DEBUG(misc, 3, "Building sign list");
this->signs.Clear(); this->signs.clear();
const Sign *si; const Sign *si;
FOR_ALL_SIGNS(si) *this->signs.Append() = si; FOR_ALL_SIGNS(si) *this->signs.Append() = si;

View File

@ -178,7 +178,7 @@ protected:
DEBUG(misc, 3, "Building station list for company %d", owner); DEBUG(misc, 3, "Building station list for company %d", owner);
this->stations.Clear(); this->stations.clear();
const Station *st; const Station *st;
FOR_ALL_STATIONS(st) { FOR_ALL_STATIONS(st) {
@ -2173,8 +2173,8 @@ static const T *FindStationsNearby(TileArea ta, bool distant_join)
{ {
TileArea ctx = ta; TileArea ctx = ta;
_stations_nearby_list.Clear(); _stations_nearby_list.clear();
_deleted_stations_nearby.Clear(); _deleted_stations_nearby.clear();
/* Check the inside, to return, if we sit on another station */ /* Check the inside, to return, if we sit on another station */
TILE_AREA_LOOP(t, ta) { TILE_AREA_LOOP(t, ta) {

View File

@ -52,7 +52,7 @@ protected:
void BuildStoryPageList() void BuildStoryPageList()
{ {
if (this->story_pages.NeedRebuild()) { if (this->story_pages.NeedRebuild()) {
this->story_pages.Clear(); this->story_pages.clear();
const StoryPage *p; const StoryPage *p;
FOR_ALL_STORY_PAGES(p) { FOR_ALL_STORY_PAGES(p) {
@ -78,7 +78,7 @@ protected:
void BuildStoryPageElementList() void BuildStoryPageElementList()
{ {
if (this->story_page_elements.NeedRebuild()) { if (this->story_page_elements.NeedRebuild()) {
this->story_page_elements.Clear(); this->story_page_elements.clear();
const StoryPage *p = GetSelPage(); const StoryPage *p = GetSelPage();
if (p != NULL) { if (p != NULL) {

View File

@ -1046,7 +1046,7 @@ void LanguageWriter::WriteLang(const StringData &data)
this->WriteLength(buffer.Length()); this->WriteLength(buffer.Length());
this->Write(buffer.Begin(), buffer.Length()); this->Write(buffer.Begin(), buffer.Length());
buffer.Clear(); buffer.clear();
} }
} }
} }

View File

@ -652,8 +652,8 @@ public:
* for word break iterators (especially for CJK languages) in combination * for word break iterators (especially for CJK languages) in combination
* with UTF-8 input. As a work around we have to convert the input to * with UTF-8 input. As a work around we have to convert the input to
* UTF-16 and create a mapping back to UTF-8 character indices. */ * UTF-16 and create a mapping back to UTF-8 character indices. */
this->utf16_str.Clear(); this->utf16_str.clear();
this->utf16_to_utf8.Clear(); this->utf16_to_utf8.clear();
while (*s != '\0') { while (*s != '\0') {
size_t idx = s - string_base; size_t idx = s - string_base;

View File

@ -319,7 +319,7 @@ static void Xunzip(byte **bufp, size_t *sizep)
{ {
if (textfile == NULL) return; if (textfile == NULL) return;
this->lines.Clear(); this->lines.clear();
/* Get text from file */ /* Get text from file */
size_t filesize; size_t filesize;

View File

@ -3469,7 +3469,7 @@ void SetTownRatingTestMode(bool mode)
static int ref_count = 0; // Number of times test-mode is switched on. static int ref_count = 0; // Number of times test-mode is switched on.
if (mode) { if (mode) {
if (ref_count == 0) { if (ref_count == 0) {
_town_test_ratings.Clear(); _town_test_ratings.clear();
} }
ref_count++; ref_count++;
} else { } else {

View File

@ -650,7 +650,7 @@ private:
void BuildSortTownList() void BuildSortTownList()
{ {
if (this->towns.NeedRebuild()) { if (this->towns.NeedRebuild()) {
this->towns.Clear(); this->towns.clear();
const Town *t; const Town *t;
FOR_ALL_TOWNS(t) { FOR_ALL_TOWNS(t) {

View File

@ -263,7 +263,7 @@ static void TrainDetailsCapacityTab(const CargoSummaryItem *item, int left, int
*/ */
static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary *summary) static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary *summary)
{ {
summary->Clear(); summary->clear();
do { do {
if (!v->GetEngine()->CanCarryCargo()) continue; if (!v->GetEngine()->CanCarryCargo()) continue;

View File

@ -942,7 +942,7 @@ static void RunVehicleDayProc()
void CallVehicleTicks() void CallVehicleTicks()
{ {
_vehicles_to_autoreplace.Clear(); _vehicles_to_autoreplace.clear();
RunVehicleDayProc(); RunVehicleDayProc();

View File

@ -347,7 +347,7 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles,
} }
static SmallVector<RefitResult, 16> refit_result; static SmallVector<RefitResult, 16> refit_result;
refit_result.Clear(); refit_result.clear();
v->InvalidateNewGRFCacheOfChain(); v->InvalidateNewGRFCacheOfChain();
byte actual_subtype = new_subtype; byte actual_subtype = new_subtype;
@ -442,7 +442,7 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles,
} }
} }
refit_result.Clear(); refit_result.clear();
_returned_refit_capacity = total_capacity; _returned_refit_capacity = total_capacity;
_returned_mail_refit_capacity = total_mail_capacity; _returned_mail_refit_capacity = total_mail_capacity;
return cost; return cost;

View File

@ -234,7 +234,7 @@ byte GetBestFittingSubType(Vehicle *v_from, Vehicle *v_for, CargoID dest_cargo_t
/* Create a list of subtypes used by the various parts of v_for */ /* Create a list of subtypes used by the various parts of v_for */
static SmallVector<StringID, 4> subtypes; static SmallVector<StringID, 4> subtypes;
subtypes.Clear(); subtypes.clear();
for (; v_from != NULL; v_from = v_from->HasArticulatedPart() ? v_from->GetNextArticulatedPart() : NULL) { for (; v_from != NULL; v_from = v_from->HasArticulatedPart() ? v_from->GetNextArticulatedPart() : NULL) {
const Engine *e_from = v_from->GetEngine(); const Engine *e_from = v_from->GetEngine();
if (!e_from->CanCarryCargo() || !HasBit(e_from->info.callback_mask, CBM_VEHICLE_CARGO_SUFFIX)) continue; if (!e_from->CanCarryCargo() || !HasBit(e_from->info.callback_mask, CBM_VEHICLE_CARGO_SUFFIX)) continue;
@ -406,7 +406,7 @@ struct RefitWindow : public Window {
*/ */
void BuildRefitList() void BuildRefitList()
{ {
for (uint i = 0; i < NUM_CARGO; i++) this->list[i].Clear(); for (uint i = 0; i < NUM_CARGO; i++) this->list[i].clear();
Vehicle *v = Vehicle::Get(this->window_number); Vehicle *v = Vehicle::Get(this->window_number);
/* Check only the selected vehicles. */ /* Check only the selected vehicles. */

View File

@ -70,8 +70,8 @@ bool VehicleListIdentifier::UnpackIfValid(uint32 data)
*/ */
void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engines, VehicleList *wagons, bool individual_wagons) void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engines, VehicleList *wagons, bool individual_wagons)
{ {
engines->Clear(); engines->clear();
if (wagons != NULL && wagons != engines) wagons->Clear(); if (wagons != NULL && wagons != engines) wagons->clear();
const Vehicle *v; const Vehicle *v;
FOR_ALL_VEHICLES(v) { FOR_ALL_VEHICLES(v) {
@ -115,7 +115,7 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine
*/ */
bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli) bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli)
{ {
list->Clear(); list->clear();
const Vehicle *v; const Vehicle *v;

View File

@ -1620,11 +1620,11 @@ void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom
_cur_dpi = old_dpi; _cur_dpi = old_dpi;
_vd.string_sprites_to_draw.Clear(); _vd.string_sprites_to_draw.clear();
_vd.tile_sprites_to_draw.Clear(); _vd.tile_sprites_to_draw.clear();
_vd.parent_sprites_to_draw.Clear(); _vd.parent_sprites_to_draw.clear();
_vd.parent_sprites_to_sort.Clear(); _vd.parent_sprites_to_sort.clear();
_vd.child_screen_sprites_to_draw.Clear(); _vd.child_screen_sprites_to_draw.clear();
} }
/** /**

View File

@ -3024,7 +3024,7 @@ void HandleMouseEvents()
Blitter *blitter = BlitterFactory::GetCurrentBlitter(); Blitter *blitter = BlitterFactory::GetCurrentBlitter();
_newgrf_debug_sprite_picker.clicked_pixel = blitter->MoveTo(_screen.dst_ptr, _cursor.pos.x, _cursor.pos.y); _newgrf_debug_sprite_picker.clicked_pixel = blitter->MoveTo(_screen.dst_ptr, _cursor.pos.x, _cursor.pos.y);
_newgrf_debug_sprite_picker.click_time = _realtime_tick; _newgrf_debug_sprite_picker.click_time = _realtime_tick;
_newgrf_debug_sprite_picker.sprites.Clear(); _newgrf_debug_sprite_picker.sprites.clear();
_newgrf_debug_sprite_picker.mode = SPM_REDRAW; _newgrf_debug_sprite_picker.mode = SPM_REDRAW;
MarkWholeScreenDirty(); MarkWholeScreenDirty();
} else { } else {
@ -3255,7 +3255,7 @@ void Window::ProcessScheduledInvalidations()
for (int *data = this->scheduled_invalidation_data.Begin(); this->window_class != WC_INVALID && data != this->scheduled_invalidation_data.End(); data++) { for (int *data = this->scheduled_invalidation_data.Begin(); this->window_class != WC_INVALID && data != this->scheduled_invalidation_data.End(); data++) {
this->OnInvalidateData(*data, true); this->OnInvalidateData(*data, true);
} }
this->scheduled_invalidation_data.Clear(); this->scheduled_invalidation_data.clear();
} }
/** /**