Changeset - r26828:fa6e2fa4b68c
[Not reviewed]
master
0 4 0
rubidium42 - 22 months ago 2023-01-28 18:07:51
rubidium@openttd.org
Codechange: do not hide parameters with local variables
4 files changed with 15 insertions and 15 deletions:
0 comments (0 inline, 0 general)
src/3rdparty/squirrel/squirrel/sqstate.cpp
Show inline comments
 
@@ -243,15 +243,15 @@ void SQSharedState::DelayFinalFree(SQCol
 
{
 
	this->_collectable_free_queue.push_back(collectable);
 

	
 
	if (!this->_collectable_free_processing) {
 
		this->_collectable_free_processing = true;
 
		while (!this->_collectable_free_queue.empty()) {
 
			SQCollectable *collectable = this->_collectable_free_queue.back();
 
			SQCollectable *collectable_to_free = this->_collectable_free_queue.back();
 
			this->_collectable_free_queue.pop_back();
 
			collectable->FinalFree();
 
			collectable_to_free->FinalFree();
 
		}
 
		this->_collectable_free_processing = false;
 
	}
 
}
 

	
 

	
src/3rdparty/squirrel/squirrel/sqvm.cpp
Show inline comments
 
@@ -1061,17 +1061,17 @@ exception_trap:
 
		if(ci) {
 
			if(_ss(this)->_notifyallexceptions) CallErrorHandler(currerror);
 

	
 
			if(traps) {
 
				do {
 
					if(ci->_etraps > 0) {
 
						SQExceptionTrap &et = _etraps.top();
 
						ci->_ip = et._ip;
 
						_top = et._stacksize;
 
						_stackbase = et._stackbase;
 
						_stack._vals[_stackbase+et._extarget] = currerror;
 
						SQExceptionTrap &trap = _etraps.top();
 
						ci->_ip = trap._ip;
 
						_top = trap._stacksize;
 
						_stackbase = trap._stackbase;
 
						_stack._vals[_stackbase+trap._extarget] = currerror;
 
						_etraps.pop_back(); traps--; ci->_etraps--;
 
						CLEARSTACK(last_top);
 
						goto exception_restore;
 
					}
 
					//if is a native closure
 
					if(type(ci->_closure) != OT_CLOSURE && n)
src/group_cmd.cpp
Show inline comments
 
@@ -525,16 +525,16 @@ std::tuple<CommandCost, GroupID> CmdAddV
 
	}
 

	
 
	if (v->owner != _current_company || !v->IsPrimaryVehicle()) return { CMD_ERROR, INVALID_GROUP };
 

	
 
	if (new_g == NEW_GROUP) {
 
		/* Create new group. */
 
		auto [ret, group_id] = CmdCreateGroup(flags, v->type, INVALID_GROUP);
 
		if (ret.Failed()) return { ret, group_id };
 
		auto [ret, new_group_id] = CmdCreateGroup(flags, v->type, INVALID_GROUP);
 
		if (ret.Failed()) return { ret, new_group_id };
 

	
 
		new_g = group_id;
 
		new_g = new_group_id;
 
	}
 

	
 
	if (flags & DC_EXEC) {
 
		AddVehicleToGroup(v, new_g);
 

	
 
		if (add_shared) {
src/saveload/saveload.cpp
Show inline comments
 
@@ -1920,32 +1920,32 @@ std::vector<SaveLoad> SlTableHeader(cons
 
				auto sld_it = key_lookup.find(key);
 
				if (sld_it == key_lookup.end()) {
 
					/* SLA_LOADCHECK triggers this debug statement a lot and is perfectly normal. */
 
					Debug(sl, _sl.action == SLA_LOAD ? 2 : 6, "Field '{}' of type 0x{:02x} not found, skipping", key, type);
 

	
 
					std::shared_ptr<SaveLoadHandler> handler = nullptr;
 
					SaveLoadType slt;
 
					SaveLoadType saveload_type;
 
					switch (type & SLE_FILE_TYPE_MASK) {
 
						case SLE_FILE_STRING:
 
							/* Strings are always marked with SLE_FILE_HAS_LENGTH_FIELD, as they are a list of chars. */
 
							slt = SL_STR;
 
							saveload_type = SL_STR;
 
							break;
 

	
 
						case SLE_FILE_STRUCT:
 
							/* Structs are always marked with SLE_FILE_HAS_LENGTH_FIELD as SL_STRUCT is seen as a list of 0/1 in length. */
 
							slt = SL_STRUCTLIST;
 
							saveload_type = SL_STRUCTLIST;
 
							handler = std::make_shared<SlSkipHandler>();
 
							break;
 

	
 
						default:
 
							slt = (type & SLE_FILE_HAS_LENGTH_FIELD) ? SL_ARR : SL_VAR;
 
							saveload_type = (type & SLE_FILE_HAS_LENGTH_FIELD) ? SL_ARR : SL_VAR;
 
							break;
 
					}
 

	
 
					/* We don't know this field, so read to nothing. */
 
					saveloads.push_back({key, slt, ((VarType)type & SLE_FILE_TYPE_MASK) | SLE_VAR_NULL, 1, SL_MIN_VERSION, SL_MAX_VERSION, 0, nullptr, 0, handler});
 
					saveloads.push_back({key, saveload_type, ((VarType)type & SLE_FILE_TYPE_MASK) | SLE_VAR_NULL, 1, SL_MIN_VERSION, SL_MAX_VERSION, 0, nullptr, 0, handler});
 
					continue;
 
				}
 

	
 
				/* Validate the type of the field. If it is changed, the
 
				 * savegame should have been bumped so we know how to do the
 
				 * conversion. If this error triggers, that clearly didn't
0 comments (0 inline, 0 general)