This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Implementing new intrinsic


On Mon, Jan 24, 2005 at 11:52:45PM +0100, FX Coudert wrote:
> 
> In a effort to contribute to gfortran, I tried to write a missing 
> intrinsic (rename), following instructions given in a recent thread here 
> on the files to modify to write a new intrinsic. However, most things 
> were written by comparing and guessing, and I'm not sure of what I have 
> written.

Comparing and guessing is the method I use(d).  Paul has been
patient with me. :-)

>  
>  try
> +gfc_check_rename (gfc_expr * path1, gfc_expr * path2)
> +{
> +  if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
> +    return FAILURE;
> +
> +  if (type_check (path2, 0, BT_CHARACTER) == FAILURE)

type_check (path2, 1, BT_CHARACTER)

The 2nd argument to type_check() is the number of the argument.
path1 = 0, path2 = 1.

> +
> +try
> +gfc_check_rename_sub (gfc_expr * path1, gfc_expr * path2, gfc_expr * status)
> +{
> +  if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
> +    return FAILURE;
> +
> +  if (type_check (path2, 0, BT_CHARACTER) == FAILURE)
> +    return FAILURE;

Same as the above.


> +  if (status == NULL)
> +    return SUCCESS;
> +

>From a quick glance, the rest looks okay to me.
I assume you have tested your patch.

-- 
Steve


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]