Changeset - r23517:1a32c3c14728
[Not reviewed]
src/animated_tile.cpp
Show inline comments
 
@@ -72,8 +72,8 @@ void AnimateAnimatedTiles()
 

	
 
/**
 
 * Initialize all animated tile variables to some known begin point
 
 */
 
void InitializeAnimatedTiles()
 
{
 
	_animated_tiles.Clear();
 
	_animated_tiles.clear();
 
}
src/autoreplace_gui.cpp
Show inline comments
 
@@ -120,13 +120,13 @@ class ReplaceVehicleWindow : public Wind
 
	{
 
		EngineID selected_engine = INVALID_ENGINE;
 
		VehicleType type = (VehicleType)this->window_number;
 
		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) {
 
			if (!draw_left && !this->show_hidden_engines && e->IsHidden(_local_company)) continue;
 
			EngineID eid = e->index;
 
			if (type == VEH_TRAIN && !this->GenerateReplaceRailList(eid, draw_left, this->replace_engines)) continue; // special rules for trains
 
@@ -167,13 +167,13 @@ class ReplaceVehicleWindow : public Wind
 
		}
 

	
 
		if (this->engines[1].NeedRebuild() || e != this->sel_engine[0]) {
 
			/* 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) {
 
					/* Select the current replacement for sel_engine[0]. */
 
					const Company *c = Company::Get(_local_company);
 
					this->sel_engine[1] = EngineReplacementForCompany(c, this->sel_engine[0], this->sel_group);
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -1225,13 +1225,13 @@ struct BuildVehicleWindow : Window {
 
		EngineID sel_id = INVALID_ENGINE;
 
		int num_engines = 0;
 
		int num_wagons  = 0;
 

	
 
		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,
 
		 * and if not, reset selection to INVALID_ENGINE. This could be the case
 
		 * when engines become obsolete and are removed */
 
		const Engine *e;
 
@@ -1273,13 +1273,13 @@ struct BuildVehicleWindow : Window {
 

	
 
	/* Figure out what road vehicle EngineIDs to put in the list */
 
	void GenerateBuildRoadVehList()
 
	{
 
		EngineID sel_id = INVALID_ENGINE;
 

	
 
		this->eng_list.Clear();
 
		this->eng_list.clear();
 

	
 
		const Engine *e;
 
		FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) {
 
			if (!this->show_hidden_engines && e->IsHidden(_local_company)) continue;
 
			EngineID eid = e->index;
 
			if (!IsEngineBuildable(eid, VEH_ROAD, _local_company)) continue;
 
@@ -1292,13 +1292,13 @@ struct BuildVehicleWindow : Window {
 
	}
 

	
 
	/* Figure out what ship EngineIDs to put in the list */
 
	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) {
 
			if (!this->show_hidden_engines && e->IsHidden(_local_company)) continue;
 
			EngineID eid = e->index;
 
			if (!IsEngineBuildable(eid, VEH_SHIP, _local_company)) continue;
 
@@ -1311,13 +1311,13 @@ struct BuildVehicleWindow : Window {
 

	
 
	/* Figure out what aircraft EngineIDs to put in the list */
 
	void GenerateBuildAircraftList()
 
	{
 
		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);
 

	
 
		/* Make list of all available planes.
 
		 * Also check to see if the previously selected plane is still available,
 
		 * and if not, reset selection to INVALID_ENGINE. This could be the case
src/command.cpp
Show inline comments
 
@@ -466,13 +466,13 @@ CommandCost DoCommand(TileIndex tile, ui
 
	CommandProc *proc = _command_proc_table[cmd & CMD_ID_MASK].proc;
 

	
 
	_docommand_recursive++;
 

	
 
	/* 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);
 
		if (res.Failed()) {
 
			goto error;
 
		}
 
@@ -489,13 +489,13 @@ CommandCost DoCommand(TileIndex tile, ui
 
			return res;
 
		}
 
	}
 

	
 
	/* 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:
 
		_docommand_recursive--;
 
		return res;
 
	}
 
@@ -663,13 +663,13 @@ CommandCost DoCommandPInternal(TileIndex
 
	Backup<CompanyByte> cur_company(_current_company, FILE_LINE);
 
	if (exec_as_spectator) cur_company.Change(COMPANY_SPECTATOR);
 

	
 
	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);
 
	BasePersistentStorageArray::SwitchMode(PSM_LEAVE_TESTMODE);
 
	SetTownRatingTestMode(false);
 

	
 
@@ -707,13 +707,13 @@ CommandCost DoCommandPInternal(TileIndex
 
		return_dcpi(CommandCost());
 
	}
 
	DEBUG(desync, 1, "cmd: %08x; %02x; %02x; %06x; %08x; %08x; %08x; \"%s\" (%s)", _date, _date_fract, (int)_current_company, tile, p1, p2, cmd & ~CMD_NETWORK_COMMAND, text, GetCommandName(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);
 

	
 
	if (cmd_id == CMD_COMPANY_CTRL) {
 
		cur_company.Trash();
src/company_gui.cpp
Show inline comments
 
@@ -649,14 +649,14 @@ private:
 
	}
 

	
 
	void BuildGroupList(CompanyID owner)
 
	{
 
		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;
 
			VehicleType vtype = (VehicleType)(this->livery_class - LC_GROUP_RAIL);
 

	
 
			const Group *g;
src/core/smallvec_type.hpp
Show inline comments
 
@@ -75,20 +75,12 @@ public:
 
		if ((const void *)&other == (void *)this) return;
 

	
 
		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.
 
	 */
 
	inline void Reset()
 
	{
 
		std::vector<T>::clear();
 
		std::vector<T>::shrink_to_fit();
src/economy.cpp
Show inline comments
 
@@ -1946,13 +1946,13 @@ void LoadUnloadStation(Station *st)
 

	
 
	/* Call the production machinery of industries */
 
	const Industry * const *isend = _cargo_delivery_destinations.End();
 
	for (Industry **iid = _cargo_delivery_destinations.Begin(); iid != isend; iid++) {
 
		TriggerIndustryProduction(*iid);
 
	}
 
	_cargo_delivery_destinations.Clear();
 
	_cargo_delivery_destinations.clear();
 
}
 

	
 
/**
 
 * Monthly update of the economic data (of the companies as well as economic fluctuations).
 
 */
 
void CompaniesMonthlyLoop()
src/engine.cpp
Show inline comments
 
@@ -484,13 +484,13 @@ StringID Engine::GetAircraftTypeText() c
 

	
 
/**
 
 * Initializes the #EngineOverrideManager with the default engines.
 
 */
 
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();
 
			eid->type            = type;
 
			eid->grfid           = INVALID_GRFID;
 
			eid->internal_id     = internal_id;
src/fios.h
Show inline comments
 
@@ -182,13 +182,13 @@ public:
 
		return this->files[index];
 
	}
 

	
 
	/** 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. */
 
	inline void Compact()
 
	{
 
		this->files.Compact();
src/fios_gui.cpp
Show inline comments
 
@@ -58,13 +58,13 @@ void LoadCheckData::Clear()
 
	memset(&this->settings, 0, sizeof(this->settings));
 

	
 
	const CompanyPropertiesMap::iterator end = this->companies.End();
 
	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;
 
	this->gamelog_actions = 0;
 

	
 
	ClearGRFConfigList(&this->grfconfig);
src/gfx_layout.cpp
Show inline comments
 
@@ -597,13 +597,13 @@ static inline void GetLayouter(Layouter:
 
	const typename T::CharType *buffer_last = buff_begin + DRAW_STRING_BUFFER;
 
	typename T::CharType *buff = buff_begin;
 
	FontMap &fontMapping = line.runs;
 
	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
 
	 * whenever the font changes, and convert the wide characters into a format
 
	 * usable by ParagraphLayout.
 
	 */
 
@@ -844,13 +844,13 @@ Font *Layouter::GetFont(FontSize size, T
 
 */
 
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();
 

	
 
#if defined(WITH_UNISCRIBE)
 
	UniscribeResetScriptCache(size);
src/graph_gui.cpp
Show inline comments
 
@@ -1133,13 +1133,13 @@ private:
 
	 * (Re)Build the company league list
 
	 */
 
	void BuildCompanyList()
 
	{
 
		if (!this->companies.NeedRebuild()) return;
 

	
 
		this->companies.Clear();
 
		this->companies.clear();
 

	
 
		const Company *c;
 
		FOR_ALL_COMPANIES(c) {
 
			*this->companies.Append() = c;
 
		}
 

	
src/group_gui.cpp
Show inline comments
 
@@ -164,14 +164,14 @@ private:
 
	 * @param owner The owner of the window
 
	 */
 
	void BuildGroupList(Owner owner)
 
	{
 
		if (!this->groups.NeedRebuild()) return;
 

	
 
		this->groups.Clear();
 
		this->indents.Clear();
 
		this->groups.clear();
 
		this->indents.clear();
 

	
 
		GUIGroupList list;
 

	
 
		const Group *g;
 
		FOR_ALL_GROUPS(g) {
 
			if (g->owner == owner && g->vehicle_type == this->vli.vtype) {
src/hotkeys.cpp
Show inline comments
 
@@ -270,13 +270,13 @@ HotkeyList::~HotkeyList()
 
void HotkeyList::Load(IniFile *ini)
 
{
 
	IniGroup *group = ini->GetGroup(this->ini_group);
 
	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);
 
		}
 
	}
 
}
 

	
 
/**
src/industry_gui.cpp
Show inline comments
 
@@ -1199,13 +1199,13 @@ protected:
 
	Scrollbar *vscroll;
 

	
 
	/** (Re)Build industries list */
 
	void BuildSortIndustriesList()
 
	{
 
		if (this->industries.NeedRebuild()) {
 
			this->industries.Clear();
 
			this->industries.clear();
 

	
 
			const Industry *i;
 
			FOR_ALL_INDUSTRIES(i) {
 
				*this->industries.Append() = i;
 
			}
 

	
 
@@ -2411,13 +2411,13 @@ struct IndustryCargoesWindow : public Wi
 
	{
 
		this->GetWidget<NWidgetCore>(WID_IC_CAPTION)->widget_data = STR_INDUSTRY_CARGOES_INDUSTRY_CAPTION;
 
		this->ind_cargo = it;
 
		_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);
 
		row->columns[2].MakeEmpty(CFT_SMALL_EMPTY);
 
		row->columns[3].MakeEmpty(CFT_SMALL_EMPTY);
 
		row->columns[4].MakeHeader(STR_INDUSTRY_CARGOES_CUSTOMERS);
 
@@ -2489,13 +2489,13 @@ struct IndustryCargoesWindow : public Wi
 
	void ComputeCargoDisplay(CargoID cid)
 
	{
 
		this->GetWidget<NWidgetCore>(WID_IC_CAPTION)->widget_data = STR_INDUSTRY_CARGOES_CARGO_CAPTION;
 
		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);
 
		row->columns[2].MakeHeader(STR_INDUSTRY_CARGOES_CUSTOMERS);
 
		row->columns[3].MakeEmpty(CFT_SMALL_EMPTY);
 
		row->columns[4].MakeEmpty(CFT_SMALL_EMPTY);
src/network/core/tcp_listen.h
Show inline comments
 
@@ -161,13 +161,13 @@ public:
 
	/** Close the sockets we're listening on. */
 
	static void CloseListeners()
 
	{
 
		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());
 
	}
 
};
 

	
 
template <class Tsocket, PacketType Tfull_packet, PacketType Tban_packet> SocketList TCPListenHandler<Tsocket, Tfull_packet, Tban_packet>::sockets;
 

	
src/network/core/udp.cpp
Show inline comments
 
@@ -59,13 +59,13 @@ bool NetworkUDPSocketHandler::Listen()
 
 */
 
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)
 
{
 
	NetworkSocketHandler::CloseConnection(error);
 
	return NETWORK_RECV_STATUS_OKAY;
src/network/network_content.cpp
Show inline comments
 
@@ -978,13 +978,13 @@ void ClientNetworkContentSocketHandler::
 
			DownloadContentInfo(ci->dependencies[i]);
 
			continue;
 
		}
 
		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 */
 
		int sel_count = 0;
 
		bool force_selection = false;
 
		for (ConstContentIterator iter = parents.Begin(); iter != parents.End(); iter++) {
 
@@ -997,13 +997,13 @@ void ClientNetworkContentSocketHandler::
 
			continue;
 
		}
 
		/* Something manually selected depends directly on us */
 
		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. */
 
		for (ConstContentIterator iter = parents.Begin(); iter != parents.End(); iter++) {
 
			if ((*iter)->state != ContentInfo::SELECTED) continue;
 

	
 
@@ -1030,14 +1030,14 @@ void ClientNetworkContentSocketHandler::
 

	
 
/** Clear all downloaded content information. */
 
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 ***/
 

	
 
void ClientNetworkContentSocketHandler::OnConnect(bool success)
 
{
src/network/network_content_gui.cpp
Show inline comments
 
@@ -382,13 +382,13 @@ class NetworkContentListWindow : public 
 
	 */
 
	void BuildContentList()
 
	{
 
		if (!this->content.NeedRebuild()) return;
 

	
 
		/* Create temporary array of games to use for listing */
 
		this->content.Clear();
 
		this->content.clear();
 

	
 
		bool all_available = true;
 

	
 
		for (ConstContentIterator iter = _network_content_client.Begin(); iter != _network_content_client.End(); iter++) {
 
			if ((*iter)->state == ContentInfo::DOES_NOT_EXIST) all_available = false;
 
			*this->content.Append() = *iter;
src/network/network_gui.cpp
Show inline comments
 
@@ -247,13 +247,13 @@ protected:
 
	 */
 
	void BuildGUINetworkGameList()
 
	{
 
		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;
 
		}
 

	
 
		/* Apply the filter condition immediately, if a search string has been provided. */
src/network/network_udp.cpp
Show inline comments
 
@@ -665,13 +665,13 @@ void NetworkUDPInitialize()
 
	_udp_client_socket = new ClientNetworkUDPSocketHandler();
 

	
 
	NetworkAddressList server;
 
	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);
 

	
 
	_network_udp_server = false;
 
	_network_udp_broadcast = 0;
 
	_network_udp_mutex->EndCritical();
src/newgrf.cpp
Show inline comments
 
@@ -1903,13 +1903,13 @@ static ChangeInfoResult StationChangeInf
 

	
 
					ReadSpriteLayoutSprite(buf, false, false, false, GSF_STATIONS, &dts->ground);
 
					/* On error, bail out immediately. Temporary GRF data was already freed */
 
					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();
 
						MemSetT(dtss, 0);
 

	
 
						dtss->delta_x = buf->ReadByte();
 
@@ -2588,13 +2588,13 @@ static ChangeInfoResult LoadTranslationT
 
{
 
	if (gvid != 0) {
 
		grfmsg(1, "LoadTranslationTable: %s translation table must start at zero", name);
 
		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);
 
	}
 

	
 
	return CIR_SUCCESS;
 
@@ -4788,13 +4788,13 @@ static void NewSpriteGroup(ByteReader *b
 
				case 0: group->size = DSG_SIZE_BYTE;  varsize = 1; break;
 
				case 1: group->size = DSG_SIZE_WORD;  varsize = 2; break;
 
				case 2: group->size = DSG_SIZE_DWORD; varsize = 4; break;
 
			}
 

	
 
			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. */
 
			do {
 
				DeterministicSpriteGroupAdjust *adjust = adjusts.Append();
 

	
 
@@ -8243,13 +8243,13 @@ static void ResetNewGRF()
 
{
 
	const GRFFile * const *end = _grf_files.End();
 
	for (GRFFile **file = _grf_files.Begin(); file != end; file++) {
 
		delete *file;
 
	}
 

	
 
	_grf_files.Clear();
 
	_grf_files.clear();
 
	_cur.grffile   = NULL;
 
}
 

	
 
/** Clear all NewGRF errors */
 
static void ResetNewGRFErrors()
 
{
 
@@ -9329,13 +9329,13 @@ extern void InitGRFTownGeneratorNames();
 
/** Finish loading NewGRFs and execute needed post-processing */
 
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++) {
 
		free((*it).second);
 
	}
 
	_grf_line_to_action6_sprite_override.clear();
src/newgrf_commons.cpp
Show inline comments
 
@@ -658,13 +658,13 @@ void NewGRFSpriteLayout::AllocateRegiste
 
 * @param constr_stage         Construction stage (0-3) to apply to all action-1 sprites.
 
 * @param separate_ground      Whether the ground sprite shall be resolved by a separate action-1-2-3 chain by default.
 
 * @return Bitmask of values for variable 10 to resolve action-1-2-3 chains for.
 
 */
 
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.
 
	 * Also include the groundsprite into the sequence for easier processing. */
 
	DrawTileSeqStruct *result = result_seq.Append();
 
	result->image = ground;
src/newgrf_gui.cpp
Show inline comments
 
@@ -1453,13 +1453,13 @@ private:
 
	}
 

	
 
	void BuildAvailables()
 
	{
 
		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;
 
			for (const GRFConfig *grf = this->actives; grf != NULL && !found; grf = grf->next) found = grf->ident.HasGrfIdentifier(c->ident.grfid, c->ident.md5sum);
 
			if (found) continue;
 

	
src/newgrf_sound.cpp
Show inline comments
 
@@ -37,13 +37,13 @@ SoundEntry *AllocateSound(uint num)
 
	return sound;
 
}
 

	
 

	
 
void InitializeSoundPool()
 
{
 
	_sounds.Clear();
 
	_sounds.clear();
 

	
 
	/* Copy original sound data to the pool */
 
	SndCopyToPool();
 
}
 

	
 

	
src/rail_cmd.cpp
Show inline comments
 
@@ -164,13 +164,13 @@ RailType AllocateRailType(RailTypeLabel 
 
		RailtypeInfo *rti = &_railtypes[rt];
 

	
 
		if (rti->label == 0) {
 
			/* 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);
 
			rti->compatible_railtypes = (RailTypes)(1LL << rt);
 

	
 
			/* We also introduce ourself. */
src/saveload/afterload.cpp
Show inline comments
 
@@ -2939,13 +2939,13 @@ bool AfterLoadGame()
 
		 * So, make articulated parts catch up. */
 
		RoadVehicle *v;
 
		bool roadside = _settings_game.vehicle.road_side == 1;
 
		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;
 
			for (RoadVehicle *u = v; u != NULL; u = u->Next()) {
 
				if (u->tile != prev_tile) {
 
					prev_tile_skip = cur_skip;
src/saveload/animated_tile_sl.cpp
Show inline comments
 
@@ -45,13 +45,13 @@ static void Load_ANIT()
 
			*_animated_tiles.Append() = anim_list[i];
 
		}
 
		return;
 
	}
 

	
 
	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);
 
}
 

	
 
/**
 
 * "Definition" imported by the saveload code to be able to load and save
src/saveload/engine_sl.cpp
Show inline comments
 
@@ -184,13 +184,13 @@ static void Save_EIDS()
 
		SlObject(eid, _engine_id_mapping_desc);
 
	}
 
}
 

	
 
static void Load_EIDS()
 
{
 
	_engine_mngr.Clear();
 
	_engine_mngr.clear();
 

	
 
	while (SlIterateArray() != -1) {
 
		EngineIDMapping *eid = _engine_mngr.Append();
 
		SlObject(eid, _engine_id_mapping_desc);
 
	}
 
}
src/saveload/labelmaps_sl.cpp
Show inline comments
 
@@ -78,13 +78,13 @@ void AfterLoadLabelMaps()
 
				default:
 
					break;
 
			}
 
		}
 
	}
 

	
 
	_railtype_list.Clear();
 
	_railtype_list.clear();
 
}
 

	
 
/** Container for a label for SaveLoad system */
 
struct LabelObject {
 
	uint32 label;
 
};
 
@@ -105,13 +105,13 @@ static void Save_RAIL()
 
		SlObject(&lo, _label_object_desc);
 
	}
 
}
 

	
 
static void Load_RAIL()
 
{
 
	_railtype_list.Clear();
 
	_railtype_list.clear();
 

	
 
	LabelObject lo;
 

	
 
	while (SlIterateArray() != -1) {
 
		SlObject(&lo, _label_object_desc);
 
		*_railtype_list.Append() = (RailTypeLabel)lo.label;
src/saveload/waypoint_sl.cpp
Show inline comments
 
@@ -169,13 +169,13 @@ static const SaveLoad _old_waypoint_desc
 
	SLE_END()
 
};
 

	
 
static void Load_WAYP()
 
{
 
	/* Precaution for when loading failed and it didn't get cleared */
 
	_old_waypoints.Clear();
 
	_old_waypoints.clear();
 

	
 
	int index;
 

	
 
	while ((index = SlIterateArray()) != -1) {
 
		OldWaypoint *wp = _old_waypoints.Append();
 
		memset(wp, 0, sizeof(*wp));
 
@@ -198,13 +198,13 @@ static void Ptrs_WAYP()
 
			if (!Town::IsValidID(wp->town_index)) {
 
				/* Upon a corrupted waypoint we'll likely get here. The next step will be to
 
				 * loop over all Ptrs procs to NULL the pointers. However, we don't know
 
				 * 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);
 
		}
 
		if (IsSavegameVersionBefore(SLV_84)) {
 
			wp->name = CopyFromOldName(wp->string_id);
src/settingsgen/settingsgen.cpp
Show inline comments
 
@@ -100,13 +100,13 @@ public:
 
		this->Clear();
 
	}
 

	
 
	/** Clear the temporary storage. */
 
	void Clear()
 
	{
 
		this->output_buffer.Clear();
 
		this->output_buffer.clear();
 
	}
 

	
 
	/**
 
	 * Add text to the output storage.
 
	 * @param text   Text to store.
 
	 * @param length Length of the text in bytes, \c 0 means 'length of the string'.
src/signs_gui.cpp
Show inline comments
 
@@ -57,13 +57,13 @@ struct SignList {
 
	void BuildSignsList()
 
	{
 
		if (!this->signs.NeedRebuild()) return;
 

	
 
		DEBUG(misc, 3, "Building sign list");
 

	
 
		this->signs.Clear();
 
		this->signs.clear();
 

	
 
		const Sign *si;
 
		FOR_ALL_SIGNS(si) *this->signs.Append() = si;
 

	
 
		this->signs.SetFilterState(true);
 
		this->FilterSignList();
src/station_gui.cpp
Show inline comments
 
@@ -175,13 +175,13 @@ protected:
 
	void BuildStationsList(const Owner owner)
 
	{
 
		if (!this->stations.NeedRebuild()) return;
 

	
 
		DEBUG(misc, 3, "Building station list for company %d", owner);
 

	
 
		this->stations.Clear();
 
		this->stations.clear();
 

	
 
		const Station *st;
 
		FOR_ALL_STATIONS(st) {
 
			if (st->owner == owner || (st->owner == OWNER_NONE && HasStationInUse(st->index, true, owner))) {
 
				if (this->facilities & st->facilities) { // only stations with selected facilities
 
					int num_waiting_cargo = 0;
 
@@ -2170,14 +2170,14 @@ static bool AddNearbyStation(TileIndex t
 
 */
 
template <class T>
 
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) {
 
		if (t < MapSize() && IsTileType(t, MP_STATION) && T::IsValidID(GetStationIndex(t))) return T::GetByTile(t);
 
	}
 

	
src/story_gui.cpp
Show inline comments
 
@@ -49,13 +49,13 @@ protected:
 
	static GUIStoryPageElementList::SortFunction * const page_element_sorter_funcs[];
 

	
 
	/** (Re)Build story page list. */
 
	void BuildStoryPageList()
 
	{
 
		if (this->story_pages.NeedRebuild()) {
 
			this->story_pages.Clear();
 
			this->story_pages.clear();
 

	
 
			const StoryPage *p;
 
			FOR_ALL_STORY_PAGES(p) {
 
				if (this->IsPageAvailable(p)) {
 
					*this->story_pages.Append() = p;
 
				}
 
@@ -75,13 +75,13 @@ protected:
 
	}
 

	
 
	/** (Re)Build story page element list. */
 
	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) {
 
				const StoryPageElement *pe;
 
				FOR_ALL_STORY_PAGE_ELEMENTS(pe) {
 
					if (pe->page == p->index) {
src/strgen/strgen_base.cpp
Show inline comments
 
@@ -1043,10 +1043,10 @@ void LanguageWriter::WriteLang(const Str
 
			}
 

	
 
			if (cmdp != NULL) PutCommandString(&buffer, cmdp);
 

	
 
			this->WriteLength(buffer.Length());
 
			this->Write(buffer.Begin(), buffer.Length());
 
			buffer.Clear();
 
			buffer.clear();
 
		}
 
	}
 
}
src/string.cpp
Show inline comments
 
@@ -649,14 +649,14 @@ public:
 
		const char *string_base = s;
 

	
 
		/* Unfortunately current ICU versions only provide rudimentary support
 
		 * 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;
 

	
 
			WChar c = Utf8Consume(&s);
 
			if (c < 0x10000) {
src/textfile_gui.cpp
Show inline comments
 
@@ -316,13 +316,13 @@ static void Xunzip(byte **bufp, size_t *
 
 * Loads the textfile text from file and setup #lines.
 
 */
 
/* virtual */ void TextfileWindow::LoadTextfile(const char *textfile, Subdirectory dir)
 
{
 
	if (textfile == NULL) return;
 

	
 
	this->lines.Clear();
 
	this->lines.clear();
 

	
 
	/* Get text from file */
 
	size_t filesize;
 
	FILE *handle = FioFOpenFile(textfile, "rb", dir, &filesize);
 
	if (handle == NULL) return;
 

	
src/town_cmd.cpp
Show inline comments
 
@@ -3466,13 +3466,13 @@ static SmallMap<const Town *, int, 4> _t
 
 */
 
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 {
 
		assert(ref_count > 0);
 
		ref_count--;
 
	}
src/town_gui.cpp
Show inline comments
 
@@ -647,13 +647,13 @@ private:
 

	
 
	Scrollbar *vscroll;
 

	
 
	void BuildSortTownList()
 
	{
 
		if (this->towns.NeedRebuild()) {
 
			this->towns.Clear();
 
			this->towns.clear();
 

	
 
			const Town *t;
 
			FOR_ALL_TOWNS(t) {
 
				*this->towns.Append() = t;
 
			}
 

	
src/train_gui.cpp
Show inline comments
 
@@ -260,13 +260,13 @@ static void TrainDetailsCapacityTab(cons
 
 * Collects the cargo transported
 
 * @param v Vehicle to process
 
 * @param summary Space for the result
 
 */
 
static void GetCargoSummaryOfArticulatedVehicle(const Train *v, CargoSummary *summary)
 
{
 
	summary->Clear();
 
	summary->clear();
 
	do {
 
		if (!v->GetEngine()->CanCarryCargo()) continue;
 

	
 
		CargoSummaryItem new_item;
 
		new_item.cargo = v->cargo_cap > 0 ? v->cargo_type : INVALID_CARGO;
 
		new_item.subtype = GetCargoSubtypeText(v);
src/vehicle.cpp
Show inline comments
 
@@ -939,13 +939,13 @@ static void RunVehicleDayProc()
 
		v->OnNewDay();
 
	}
 
}
 

	
 
void CallVehicleTicks()
 
{
 
	_vehicles_to_autoreplace.Clear();
 
	_vehicles_to_autoreplace.clear();
 

	
 
	RunVehicleDayProc();
 

	
 
	{
 
		PerformanceMeasurer framerate(PFE_GL_ECONOMY);
 
		Station *st;
src/vehicle_cmd.cpp
Show inline comments
 
@@ -344,13 +344,13 @@ static CommandCost RefitVehicle(Vehicle 
 
		GetVehicleSet(vehicles_to_refit, v, num_vehicles);
 
		/* In this case, we need to check the whole chain. */
 
		v = v->First();
 
	}
 

	
 
	static SmallVector<RefitResult, 16> refit_result;
 
	refit_result.Clear();
 
	refit_result.clear();
 

	
 
	v->InvalidateNewGRFCacheOfChain();
 
	byte actual_subtype = new_subtype;
 
	for (; v != NULL; v = (only_this ? NULL : v->Next())) {
 
		/* Reset actual_subtype for every new vehicle */
 
		if (!v->IsArticulatedPart()) actual_subtype = new_subtype;
 
@@ -439,13 +439,13 @@ static CommandCost RefitVehicle(Vehicle 
 
				w->cargo_cap = result->mail_capacity;
 
				if (w->cargo.TotalCount() > w->refit_cap) w->cargo.Truncate(w->cargo.TotalCount() - w->refit_cap);
 
			}
 
		}
 
	}
 

	
 
	refit_result.Clear();
 
	refit_result.clear();
 
	_returned_refit_capacity = total_capacity;
 
	_returned_mail_refit_capacity = total_mail_capacity;
 
	return cost;
 
}
 

	
 
/**
src/vehicle_gui.cpp
Show inline comments
 
@@ -231,13 +231,13 @@ byte GetBestFittingSubType(Vehicle *v_fr
 
{
 
	v_from = v_from->GetFirstEnginePart();
 
	v_for = v_for->GetFirstEnginePart();
 

	
 
	/* 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;
 
		subtypes.Include(GetCargoSubtypeText(v_from));
 
	}
 

	
 
@@ -403,13 +403,13 @@ struct RefitWindow : public Window {
 

	
 
	/**
 
	 * Collects all (cargo, subcargo) refit options of a vehicle chain.
 
	 */
 
	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. */
 
		VehicleSet vehicles_to_refit;
 
		GetVehicleSet(vehicles_to_refit, Vehicle::Get(this->selected_vehicle), this->num_vehicles);
 

	
src/vehiclelist.cpp
Show inline comments
 
@@ -67,14 +67,14 @@ bool VehicleListIdentifier::UnpackIfVali
 
 * @param engines Pointer to list to add vehicles to
 
 * @param wagons  Pointer to list to add wagons to (can be NULL)
 
 * @param individual_wagons If true add every wagon to \a wagons which is not attached to an engine. If false only add the first wagon of every row.
 
 */
 
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) {
 
		/* General tests for all vehicle types */
 
		if (v->type != type) continue;
 
		if (v->tile != tile) continue;
 
@@ -112,13 +112,13 @@ void BuildDepotVehicleList(VehicleType t
 
 * @param list Pointer to list to add vehicles to
 
 * @param vli  The identifier of this vehicle list.
 
 * @return false if invalid list is requested
 
 */
 
bool GenerateVehicleSortList(VehicleList *list, const VehicleListIdentifier &vli)
 
{
 
	list->Clear();
 
	list->clear();
 

	
 
	const Vehicle *v;
 

	
 
	switch (vli.type) {
 
		case VL_STATION_LIST:
 
			FOR_ALL_VEHICLES(v) {
src/viewport.cpp
Show inline comments
 
@@ -1617,17 +1617,17 @@ void ViewportDoDraw(const ViewPort *vp, 
 
		dp.top = UnScaleByZoom(_vd.dpi.top, zoom);
 
		ViewportDrawStrings(zoom, &_vd.string_sprites_to_draw);
 
	}
 

	
 
	_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();
 
}
 

	
 
/**
 
 * Make sure we don't draw a too big area at a time.
 
 * If we do, the sprite memory will overflow.
 
 */
src/window.cpp
Show inline comments
 
@@ -3021,13 +3021,13 @@ void HandleMouseEvents()
 

	
 
	if (click == MC_LEFT && _newgrf_debug_sprite_picker.mode == SPM_WAIT_CLICK) {
 
		/* Mark whole screen dirty, and wait for the next realtime tick, when drawing is finished. */
 
		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 {
 
		MouseLoop(click, mousewheel);
 
	}
 

	
 
@@ -3252,13 +3252,13 @@ void Window::InvalidateData(int data, bo
 
 */
 
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();
 
}
 

	
 
/**
 
 * Process all invalidation of highlighted widgets.
 
 */
 
void Window::ProcessHighlightedInvalidations()
0 comments (0 inline, 0 general)