private void updateFunctionDef(long sourceFunctionDefDtID,
			FunctionDefinition sourceFunctionDefDt, FunctionDefinition destDt,
			MyIdentityHashMap<Long, DataType> resolvedDataTypes) {

		// NOTE: it is possible for the same function def to be updated more than once;
		// therefor we must cleanup any previous obsolete fixups
		removeFixUps(sourceFunctionDefDtID);

		long oldLastChangeTime = sourceFunctionDefDt.getLastChangeTime();
		long oldLastChangeTimeInSourceArchive =
			sourceFunctionDefDt.getLastChangeTimeInSourceArchive();
		DataTypeManager sourceDTM = sourceFunctionDefDt.getDataTypeManager();
		DataType sourceReturnType = sourceFunctionDefDt.getReturnType();
		ParameterDefinition[] sourceVars = sourceFunctionDefDt.getArguments();
		ParameterDefinition[] destVars = new ParameterDefinition[sourceVars.length];
		boolean sourceHasVarArgs = sourceFunctionDefDt.hasVarArgs();
		boolean sourceHasNoReturn = sourceFunctionDefDt.hasNoReturn();

		DataType resolvedRDT = DataType.DEFAULT;
		if (sourceReturnType != null) {
			long returnTypeID = sourceDTM.getID(sourceReturnType);
			resolvedRDT = getResolvedParam(sourceFunctionDefDtID, returnTypeID, sourceReturnType,
				-1, resolvedDataTypes);
		}
		destDt.setReturnType(resolvedRDT);

		for (int i = 0; i < sourceVars.length; i++) {
			DataType varDt = sourceVars[i].getDataType();
			long varID = sourceDTM.getID(varDt);
			DataType resolvedDt =
				getResolvedParam(sourceFunctionDefDtID, varID, varDt, i, resolvedDataTypes);
			destVars[i] = new ParameterDefinitionImpl(sourceVars[i].getName(), resolvedDt,
				sourceVars[i].getComment());
		}
		destDt.setArguments(destVars);
		destDt.setVarArgs(sourceHasVarArgs);
		destDt.setNoReturn(sourceHasNoReturn);

		destDt.setLastChangeTime(oldLastChangeTime);
		destDt.setLastChangeTimeInSourceArchive(oldLastChangeTimeInSourceArchive);
	}
Bitfield insertions can cause excess growth of structure which must be trimmed.
@param struct structure to be trimmed
@param preferredSize preferred structure size
Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/DataTypeMergeManager.java