diff options
author | Henry Wilson <m3henry@googlemail.com> | 2018-09-20 23:44:14 +0100 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-03-26 20:15:57 +0000 |
commit | bfd79e59dc34314a089a0024af56d04d84456ebd (patch) | |
tree | d03559bac7a8c3f1d260cead2ed77791c03d37a5 /src | |
parent | 4b349c0f90c3f7b6a39171cec41cd98dcd0d88b7 (diff) | |
download | openttd-bfd79e59dc34314a089a0024af56d04d84456ebd.tar.xz |
Codechange: Replace SmallVector::Clear() with std::vector::clear()
Diffstat (limited to 'src')
47 files changed, 80 insertions, 88 deletions
diff --git a/src/animated_tile.cpp b/src/animated_tile.cpp index 2a4cd8958..5d4384820 100644 --- a/src/animated_tile.cpp +++ b/src/animated_tile.cpp @@ -75,5 +75,5 @@ void AnimateAnimatedTiles() */ void InitializeAnimatedTiles() { - _animated_tiles.Clear(); + _animated_tiles.clear(); } diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 3a8a7543d..356058e93 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -123,7 +123,7 @@ class ReplaceVehicleWindow : public Window { byte side = draw_left ? 0 : 1; GUIEngineList *list = &this->engines[side]; - list->Clear(); + list->clear(); const Engine *e; 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 */ if (this->sel_engine[0] == INVALID_ENGINE) { /* 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; } else { if (this->reset_sel_engine && this->sel_engine[0] != INVALID_ENGINE) { diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index a086feccc..e160d6dac 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1228,7 +1228,7 @@ struct BuildVehicleWindow : Window { 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. * Also check to see if the previously selected engine is still available, @@ -1276,7 +1276,7 @@ struct BuildVehicleWindow : Window { { EngineID sel_id = INVALID_ENGINE; - this->eng_list.Clear(); + this->eng_list.clear(); const Engine *e; FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) { @@ -1295,7 +1295,7 @@ struct BuildVehicleWindow : Window { void GenerateBuildShipList() { EngineID sel_id = INVALID_ENGINE; - this->eng_list.Clear(); + this->eng_list.clear(); const Engine *e; FOR_ALL_ENGINES_OF_TYPE(e, VEH_SHIP) { @@ -1314,7 +1314,7 @@ struct BuildVehicleWindow : Window { { 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); diff --git a/src/command.cpp b/src/command.cpp index 7500a170b..b914563fc 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -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. */ 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); res = proc(tile, flags & ~DC_EXEC, p1, p2, text); 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 * 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); if (res.Failed()) { 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; /* Test the command. */ - _cleared_object_areas.Clear(); + _cleared_object_areas.clear(); SetTownRatingTestMode(true); BasePersistentStorageArray::SwitchMode(PSM_ENTER_TESTMODE); 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 * use the construction one */ - _cleared_object_areas.Clear(); + _cleared_object_areas.clear(); BasePersistentStorageArray::SwitchMode(PSM_ENTER_COMMAND); CommandCost res2 = proc(tile, flags | DC_EXEC, p1, p2, text); BasePersistentStorageArray::SwitchMode(PSM_LEAVE_COMMAND); diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 58f972364..ba82b44b8 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -652,8 +652,8 @@ private: { if (!this->groups.NeedRebuild()) return; - this->groups.Clear(); - this->indents.Clear(); + this->groups.clear(); + this->indents.clear(); if (this->livery_class >= LC_GROUP_RAIL) { GUIGroupList list; diff --git a/src/core/smallvec_type.hpp b/src/core/smallvec_type.hpp index 795435d7a..89fdd1369 100644 --- a/src/core/smallvec_type.hpp +++ b/src/core/smallvec_type.hpp @@ -78,14 +78,6 @@ public: } /** - * Remove all items from the list. - */ - inline void Clear() - { - std::vector<T>::clear(); - } - - /** * Remove all items from the list and free allocated memory. */ inline void Reset() diff --git a/src/economy.cpp b/src/economy.cpp index bf520c3f6..d306fd0ba 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1949,7 +1949,7 @@ void LoadUnloadStation(Station *st) for (Industry **iid = _cargo_delivery_destinations.Begin(); iid != isend; iid++) { TriggerIndustryProduction(*iid); } - _cargo_delivery_destinations.Clear(); + _cargo_delivery_destinations.clear(); } /** diff --git a/src/engine.cpp b/src/engine.cpp index d539a4852..e0536e7ba 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -487,7 +487,7 @@ StringID Engine::GetAircraftTypeText() const */ void EngineOverrideManager::ResetToDefaultMapping() { - this->Clear(); + this->clear(); for (VehicleType type = VEH_TRAIN; type <= VEH_AIRCRAFT; type++) { for (uint internal_id = 0; internal_id < _engine_counts[type]; internal_id++) { EngineIDMapping *eid = this->Append(); diff --git a/src/fios.h b/src/fios.h index 24c9f370e..788ac654f 100644 --- a/src/fios.h +++ b/src/fios.h @@ -185,7 +185,7 @@ public: /** Remove all items from the list. */ inline void Clear() { - this->files.Clear(); + this->files.clear(); } /** Compact the list down to the smallest block size boundary. */ diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index f4a2f497b..49c1deac3 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -61,7 +61,7 @@ void LoadCheckData::Clear() for (CompanyPropertiesMap::iterator it = this->companies.Begin(); it != end; it++) { delete it->second; } - companies.Clear(); + companies.clear(); GamelogFree(this->gamelog_action, this->gamelog_actions); this->gamelog_action = NULL; diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index 3bf490da6..f0fb39107 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -600,7 +600,7 @@ static inline void GetLayouter(Layouter::LineCacheItem &line, const char *&str, Font *f = Layouter::GetFont(state.fontsize, state.cur_colour); line.buffer = buff_begin; - fontMapping.Clear(); + fontMapping.clear(); /* * 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) { delete it->second; } - fonts[size].Clear(); + fonts[size].clear(); /* We must reset the linecache since it references the just freed fonts */ ResetLineCache(); diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index d74f833ce..c459e2a03 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -1136,7 +1136,7 @@ private: { if (!this->companies.NeedRebuild()) return; - this->companies.Clear(); + this->companies.clear(); const Company *c; FOR_ALL_COMPANIES(c) { diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 299bf58cc..bd8f37ec5 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -167,8 +167,8 @@ private: { if (!this->groups.NeedRebuild()) return; - this->groups.Clear(); - this->indents.Clear(); + this->groups.clear(); + this->indents.clear(); GUIGroupList list; diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index 12bd827fa..c88d4499a 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -273,7 +273,7 @@ void HotkeyList::Load(IniFile *ini) for (Hotkey *hotkey = this->items; hotkey->name != NULL; ++hotkey) { IniItem *item = group->GetItem(hotkey->name, false); if (item != NULL) { - hotkey->keycodes.Clear(); + hotkey->keycodes.clear(); if (item->value != NULL) ParseHotkeys(hotkey, item->value); } } diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 898786ff7..4fa350128 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -1202,7 +1202,7 @@ protected: void BuildSortIndustriesList() { if (this->industries.NeedRebuild()) { - this->industries.Clear(); + this->industries.clear(); const Industry *i; FOR_ALL_INDUSTRIES(i) { @@ -2414,7 +2414,7 @@ struct IndustryCargoesWindow : public Window { _displayed_industries.reset(); _displayed_industries.set(it); - this->fields.Clear(); + this->fields.clear(); CargoesRow *row = this->fields.Append(); row->columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS); row->columns[1].MakeEmpty(CFT_SMALL_EMPTY); @@ -2492,7 +2492,7 @@ struct IndustryCargoesWindow : public Window { this->ind_cargo = cid + NUM_INDUSTRYTYPES; _displayed_industries.reset(); - this->fields.Clear(); + this->fields.clear(); CargoesRow *row = this->fields.Append(); row->columns[0].MakeHeader(STR_INDUSTRY_CARGOES_PRODUCERS); row->columns[1].MakeEmpty(CFT_SMALL_EMPTY); diff --git a/src/network/core/tcp_listen.h b/src/network/core/tcp_listen.h index 21bcaea3c..b9f987190 100644 --- a/src/network/core/tcp_listen.h +++ b/src/network/core/tcp_listen.h @@ -164,7 +164,7 @@ public: for (SocketList::iterator s = sockets.Begin(); s != sockets.End(); s++) { closesocket(s->second); } - sockets.Clear(); + sockets.clear(); DEBUG(net, 1, "[%s] closed listeners", Tsocket::GetName()); } }; diff --git a/src/network/core/udp.cpp b/src/network/core/udp.cpp index 4a2f77368..83c14d2b0 100644 --- a/src/network/core/udp.cpp +++ b/src/network/core/udp.cpp @@ -62,7 +62,7 @@ void NetworkUDPSocketHandler::Close() for (SocketList::iterator s = this->sockets.Begin(); s != this->sockets.End(); s++) { closesocket(s->second); } - this->sockets.Clear(); + this->sockets.clear(); } NetworkRecvStatus NetworkUDPSocketHandler::CloseConnection(bool error) diff --git a/src/network/network_content.cpp b/src/network/network_content.cpp index 786f1c04a..0ef060628 100644 --- a/src/network/network_content.cpp +++ b/src/network/network_content.cpp @@ -981,7 +981,7 @@ void ClientNetworkContentSocketHandler::CheckDependencyState(ContentInfo *ci) if (c->state != ContentInfo::AUTOSELECTED) continue; /* Only unselect when WE are the only parent. */ - parents.Clear(); + parents.clear(); this->ReverseLookupDependency(parents, c); /* First check whether anything depends on us */ @@ -1000,7 +1000,7 @@ void ClientNetworkContentSocketHandler::CheckDependencyState(ContentInfo *ci) if (force_selection) continue; /* "Flood" search to find all items in the dependency graph*/ - parents.Clear(); + parents.clear(); this->ReverseLookupTreeDependency(parents, c); /* 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; - this->infos.Clear(); - this->requested.Clear(); + this->infos.clear(); + this->requested.clear(); } /*** CALLBACK ***/ diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 406c6aa05..2ac7e6b12 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -385,7 +385,7 @@ class NetworkContentListWindow : public Window, ContentCallback { if (!this->content.NeedRebuild()) return; /* Create temporary array of games to use for listing */ - this->content.Clear(); + this->content.clear(); bool all_available = true; diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index b12aaa823..1366906b8 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -250,7 +250,7 @@ protected: if (!this->servers.NeedRebuild()) return; /* 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) { *this->servers.Append() = ngl; diff --git a/src/network/network_udp.cpp b/src/network/network_udp.cpp index cee230c88..b416ee98e 100644 --- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -668,7 +668,7 @@ void NetworkUDPInitialize() GetBindAddresses(&server, _settings_client.network.server_port); _udp_server_socket = new ServerNetworkUDPSocketHandler(&server); - server.Clear(); + server.clear(); GetBindAddresses(&server, 0); _udp_master_socket = new MasterNetworkUDPSocketHandler(&server); diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 2fc546d4e..e26577353 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -1906,7 +1906,7 @@ static ChangeInfoResult StationChangeInfo(uint stid, int numinfo, int prop, Byte if (_cur.skip_sprites < 0) return CIR_DISABLED; static SmallVector<DrawTileSeqStruct, 8> tmp_layout; - tmp_layout.Clear(); + tmp_layout.clear(); for (;;) { /* no relative bounding box support */ DrawTileSeqStruct *dtss = tmp_layout.Append(); @@ -2591,7 +2591,7 @@ static ChangeInfoResult LoadTranslationTable(uint gvid, int numinfo, ByteReader return CIR_INVALID_ID; } - translation_table.Clear(); + translation_table.clear(); for (int i = 0; i < numinfo; i++) { uint32 item = buf->ReadDWord(); *translation_table.Append() = BSWAP32(item); @@ -4791,7 +4791,7 @@ static void NewSpriteGroup(ByteReader *buf) } static SmallVector<DeterministicSpriteGroupAdjust, 16> adjusts; - adjusts.Clear(); + adjusts.clear(); /* Loop through the var adjusts. Unfortunately we don't know how many we have * from the outset, so we shall have to keep reallocing. */ @@ -8246,7 +8246,7 @@ static void ResetNewGRF() delete *file; } - _grf_files.Clear(); + _grf_files.clear(); _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++) { *it->target = MapGRFStringID(it->grfid, it->source); } - _string_to_grf_mapping.Clear(); + _string_to_grf_mapping.clear(); /* 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++) { diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index 4caf3a5d4..e25f6d085 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -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 { - result_seq.Clear(); + result_seq.clear(); uint32 var10_values = 0; /* Create a copy of the spritelayout, so we can modify some values. diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 37844423a..fcb04be0d 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -1456,7 +1456,7 @@ private: { if (!this->avails.NeedRebuild()) return; - this->avails.Clear(); + this->avails.clear(); for (const GRFConfig *c = _all_grfs; c != NULL; c = c->next) { bool found = false; diff --git a/src/newgrf_sound.cpp b/src/newgrf_sound.cpp index 0cc113d9d..9d890e9ca 100644 --- a/src/newgrf_sound.cpp +++ b/src/newgrf_sound.cpp @@ -40,7 +40,7 @@ SoundEntry *AllocateSound(uint num) void InitializeSoundPool() { - _sounds.Clear(); + _sounds.clear(); /* Copy original sound data to the pool */ SndCopyToPool(); diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 1c07932cd..a948ac0f9 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -167,7 +167,7 @@ RailType AllocateRailType(RailTypeLabel label) /* Set up new rail type */ *rti = _original_railtypes[RAILTYPE_RAIL]; rti->label = label; - rti->alternate_labels.Clear(); + rti->alternate_labels.clear(); /* Make us compatible with ourself. */ rti->powered_railtypes = (RailTypes)(1LL << rt); diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 6ec4ab67c..851eb6a78 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -2942,7 +2942,7 @@ bool AfterLoadGame() SmallVector<uint, 16> skip_frames; FOR_ALL_ROADVEHICLES(v) { if (!v->IsFrontEngine()) continue; - skip_frames.Clear(); + skip_frames.clear(); TileIndex prev_tile = v->tile; uint prev_tile_skip = 0; uint cur_skip = 0; diff --git a/src/saveload/animated_tile_sl.cpp b/src/saveload/animated_tile_sl.cpp index c54c4724a..6db0561cd 100644 --- a/src/saveload/animated_tile_sl.cpp +++ b/src/saveload/animated_tile_sl.cpp @@ -48,7 +48,7 @@ static void Load_ANIT() } uint count = (uint)SlGetFieldLength() / sizeof(*_animated_tiles.Begin()); - _animated_tiles.Clear(); + _animated_tiles.clear(); _animated_tiles.Append(count); SlArray(_animated_tiles.Begin(), count, SLE_UINT32); } diff --git a/src/saveload/engine_sl.cpp b/src/saveload/engine_sl.cpp index 5221d1bbd..87b18336c 100644 --- a/src/saveload/engine_sl.cpp +++ b/src/saveload/engine_sl.cpp @@ -187,7 +187,7 @@ static void Save_EIDS() static void Load_EIDS() { - _engine_mngr.Clear(); + _engine_mngr.clear(); while (SlIterateArray() != -1) { EngineIDMapping *eid = _engine_mngr.Append(); diff --git a/src/saveload/labelmaps_sl.cpp b/src/saveload/labelmaps_sl.cpp index 3b898a3b8..b57a89f20 100644 --- a/src/saveload/labelmaps_sl.cpp +++ b/src/saveload/labelmaps_sl.cpp @@ -81,7 +81,7 @@ void AfterLoadLabelMaps() } } - _railtype_list.Clear(); + _railtype_list.clear(); } /** Container for a label for SaveLoad system */ @@ -108,7 +108,7 @@ static void Save_RAIL() static void Load_RAIL() { - _railtype_list.Clear(); + _railtype_list.clear(); LabelObject lo; diff --git a/src/saveload/waypoint_sl.cpp b/src/saveload/waypoint_sl.cpp index ae74d812b..2567c2c93 100644 --- a/src/saveload/waypoint_sl.cpp +++ b/src/saveload/waypoint_sl.cpp @@ -172,7 +172,7 @@ static const SaveLoad _old_waypoint_desc[] = { static void Load_WAYP() { /* Precaution for when loading failed and it didn't get cleared */ - _old_waypoints.Clear(); + _old_waypoints.clear(); 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 * 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. */ - _old_waypoints.Clear(); + _old_waypoints.clear(); SlErrorCorrupt("Referencing invalid Town"); } wp->town = Town::Get(wp->town_index); diff --git a/src/settingsgen/settingsgen.cpp b/src/settingsgen/settingsgen.cpp index d8d76a4d6..35c9911d8 100644 --- a/src/settingsgen/settingsgen.cpp +++ b/src/settingsgen/settingsgen.cpp @@ -103,7 +103,7 @@ public: /** Clear the temporary storage. */ void Clear() { - this->output_buffer.Clear(); + this->output_buffer.clear(); } /** diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 5e752da52..fab2ac912 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -60,7 +60,7 @@ struct SignList { DEBUG(misc, 3, "Building sign list"); - this->signs.Clear(); + this->signs.clear(); const Sign *si; FOR_ALL_SIGNS(si) *this->signs.Append() = si; diff --git a/src/station_gui.cpp b/src/station_gui.cpp index ef434c4ff..965240e3e 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -178,7 +178,7 @@ protected: DEBUG(misc, 3, "Building station list for company %d", owner); - this->stations.Clear(); + this->stations.clear(); const Station *st; FOR_ALL_STATIONS(st) { @@ -2173,8 +2173,8 @@ static const T *FindStationsNearby(TileArea ta, bool distant_join) { TileArea ctx = ta; - _stations_nearby_list.Clear(); - _deleted_stations_nearby.Clear(); + _stations_nearby_list.clear(); + _deleted_stations_nearby.clear(); /* Check the inside, to return, if we sit on another station */ TILE_AREA_LOOP(t, ta) { diff --git a/src/story_gui.cpp b/src/story_gui.cpp index 8b12207e3..0ccfe2b63 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -52,7 +52,7 @@ protected: void BuildStoryPageList() { if (this->story_pages.NeedRebuild()) { - this->story_pages.Clear(); + this->story_pages.clear(); const StoryPage *p; FOR_ALL_STORY_PAGES(p) { @@ -78,7 +78,7 @@ protected: void BuildStoryPageElementList() { if (this->story_page_elements.NeedRebuild()) { - this->story_page_elements.Clear(); + this->story_page_elements.clear(); const StoryPage *p = GetSelPage(); if (p != NULL) { diff --git a/src/strgen/strgen_base.cpp b/src/strgen/strgen_base.cpp index 8d46b1b27..8f3f8941f 100644 --- a/src/strgen/strgen_base.cpp +++ b/src/strgen/strgen_base.cpp @@ -1046,7 +1046,7 @@ void LanguageWriter::WriteLang(const StringData &data) this->WriteLength(buffer.Length()); this->Write(buffer.Begin(), buffer.Length()); - buffer.Clear(); + buffer.clear(); } } } diff --git a/src/string.cpp b/src/string.cpp index 18ed863d0..cb6c1e8f7 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -652,8 +652,8 @@ public: * 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 * UTF-16 and create a mapping back to UTF-8 character indices. */ - this->utf16_str.Clear(); - this->utf16_to_utf8.Clear(); + this->utf16_str.clear(); + this->utf16_to_utf8.clear(); while (*s != '\0') { size_t idx = s - string_base; diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index 3480a2aef..018888d0b 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -319,7 +319,7 @@ static void Xunzip(byte **bufp, size_t *sizep) { if (textfile == NULL) return; - this->lines.Clear(); + this->lines.clear(); /* Get text from file */ size_t filesize; diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 0ae79367c..35ef97e94 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -3469,7 +3469,7 @@ void SetTownRatingTestMode(bool mode) static int ref_count = 0; // Number of times test-mode is switched on. if (mode) { if (ref_count == 0) { - _town_test_ratings.Clear(); + _town_test_ratings.clear(); } ref_count++; } else { diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 18b767ebc..5cc934f0a 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -650,7 +650,7 @@ private: void BuildSortTownList() { if (this->towns.NeedRebuild()) { - this->towns.Clear(); + this->towns.clear(); const Town *t; FOR_ALL_TOWNS(t) { diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 51e772b52..5246b59cb 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -263,7 +263,7 @@ static void TrainDetailsCapacityTab(const CargoSummaryItem *item, int left, int */ static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary *summary) { - summary->Clear(); + summary->clear(); do { if (!v->GetEngine()->CanCarryCargo()) continue; diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 4f987a4bf..d885a0458 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -942,7 +942,7 @@ static void RunVehicleDayProc() void CallVehicleTicks() { - _vehicles_to_autoreplace.Clear(); + _vehicles_to_autoreplace.clear(); RunVehicleDayProc(); diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp index 7dd7a790a..27f2262e7 100644 --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -347,7 +347,7 @@ static CommandCost RefitVehicle(Vehicle *v, bool only_this, uint8 num_vehicles, } static SmallVector<RefitResult, 16> refit_result; - refit_result.Clear(); + refit_result.clear(); v->InvalidateNewGRFCacheOfChain(); 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_mail_refit_capacity = total_mail_capacity; return cost; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index f4e766589..2ae385aa2 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -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 */ static SmallVector<StringID, 4> subtypes; - subtypes.Clear(); + subtypes.clear(); for (; v_from != NULL; v_from = v_from->HasArticulatedPart() ? v_from->GetNextArticulatedPart() : NULL) { const Engine *e_from = v_from->GetEngine(); 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() { - 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); /* Check only the selected vehicles. */ diff --git a/src/vehiclelist.cpp b/src/vehiclelist.cpp index bfe4e5ffd..402226268 100644 --- a/src/vehiclelist.cpp +++ b/src/vehiclelist.cpp @@ -70,8 +70,8 @@ bool VehicleListIdentifier::UnpackIfValid(uint32 data) */ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engines, VehicleList *wagons, bool individual_wagons) { - engines->Clear(); - if (wagons != NULL && wagons != engines) wagons->Clear(); + engines->clear(); + if (wagons != NULL && wagons != engines) wagons->clear(); const Vehicle *v; FOR_ALL_VEHICLES(v) { @@ -115,7 +115,7 @@ void BuildDepotVehicleList(VehicleType type, TileIndex tile, VehicleList *engine */ bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli) { - list->Clear(); + list->clear(); const Vehicle *v; diff --git a/src/viewport.cpp b/src/viewport.cpp index 2cb3baa57..bd0570cf1 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1620,11 +1620,11 @@ void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom _cur_dpi = old_dpi; - _vd.string_sprites_to_draw.Clear(); - _vd.tile_sprites_to_draw.Clear(); - _vd.parent_sprites_to_draw.Clear(); - _vd.parent_sprites_to_sort.Clear(); - _vd.child_screen_sprites_to_draw.Clear(); + _vd.string_sprites_to_draw.clear(); + _vd.tile_sprites_to_draw.clear(); + _vd.parent_sprites_to_draw.clear(); + _vd.parent_sprites_to_sort.clear(); + _vd.child_screen_sprites_to_draw.clear(); } /** diff --git a/src/window.cpp b/src/window.cpp index 243114e20..184b9940a 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -3024,7 +3024,7 @@ void HandleMouseEvents() 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.click_time = _realtime_tick; - _newgrf_debug_sprite_picker.sprites.Clear(); + _newgrf_debug_sprite_picker.sprites.clear(); _newgrf_debug_sprite_picker.mode = SPM_REDRAW; MarkWholeScreenDirty(); } 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++) { this->OnInvalidateData(*data, true); } - this->scheduled_invalidation_data.Clear(); + this->scheduled_invalidation_data.clear(); } /** |