private List<Parameter> createParameters(CompilerSpec compilerSpec, String conventionName,
			ParameterDefinition[] args, Parameter returnParam) throws InvalidInputException {

		DataType returnDt = returnParam.getDataType();

		int firstParamIndex = getIndexOfFirstParameter(conventionName, args);

		List<Parameter> params = new ArrayList<>();
		boolean settleCTypes = compilerSpec.doesCDataTypeConversions();
		DataTypeManager dtm = program.getDataTypeManager();
		for (int i = firstParamIndex; i < args.length; i++) {
			String name = args[i].getName();
			DataType type = args[i].getDataType().clone(dtm);
			if (Function.RETURN_PTR_PARAM_NAME.equals(name)) {
				if ((type instanceof Pointer) &&
					(type.isEquivalent(returnDt) || VoidDataType.dataType.isEquivalent(returnDt))) {
					returnParam.setDataType(((Pointer) type).getDataType(), source);
				}
				continue; // remove what should be an auto-param
			}

			if (settleCTypes) {
				type = settleCDataType(type, dtm);
			}
			Parameter param =
				new ParameterImpl(name, type, VariableStorage.UNASSIGNED_STORAGE, program);
			param.setComment(args[i].getComment());
			params.add(param);
		}

		return params;
	}
Sets a function's signature in the program using the command details.
@param func the function
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/ApplyFunctionSignatureCmd.java