public void replaceFunctionParameters(Function toFunc, Function fromFunc) {

		if (toFunc == null || fromFunc == null) {
			return;
		}

		try {

			Parameter[] fromParams = fromFunc.getParameters();
			if (!resolveParamaterNameConflicts(toFunc, fromParams)) {
				return;
			}

			toFunc.updateFunction(toFunc.getCallingConventionName(), fromFunc.getReturn(),
				fromFunc.hasCustomVariableStorage() ? FunctionUpdateType.CUSTOM_STORAGE
						: FunctionUpdateType.DYNAMIC_STORAGE_ALL_PARAMS,
				true, fromFunc.getSignatureSource(), fromParams);
		}
		catch (DuplicateNameException e) {
			Msg.error(this, "Unexpected Exception: " + e.getMessage(), e);
			errorMsg.append("Can't replace parameters for function " + toFunc.getName(true));
			errorMsg.append(e.getMessage() + "\n");
			return;
		}
		catch (InvalidInputException e) {
			Msg.error(this, "Unexpected Exception: " + e.getMessage(), e);
			errorMsg.append("Can't replace return/parameters for function " + toFunc.getName(true));
			errorMsg.append(e.getMessage() + "\n");
			return;
		}

		// Add or remove the varargs as necessary.
		boolean shouldHaveVarArgs = fromFunc.hasVarArgs();
		if (toFunc.hasVarArgs() != shouldHaveVarArgs) {
			toFunc.setVarArgs(shouldHaveVarArgs);
		}

	}
<CODE>replaceFunctionParameters</CODE> replaces the parameters of the
function in program1 with the parameters of the function in program2
at the specified entry point address.  It also replaces the return
type/storage as well as custom storage use.
@param toFunc target function
@param fromFunc source function
Ghidra/Features/Base/src/main/java/ghidra/program/util/ProgramMerge.java