Commit 7fcb1804 by Tobias Schlüter

io.h, [...]: Fix formatting issues, update copyright years.

* io/io.h, io/list_read.c, io/open.c, io/transfer.c, io/write.c:
Fix formatting issues, update copyright years.

From-SVN: r86425
parent b3d1f5b4
/* Copyright (C) 2002-2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of the GNU Fortran 95 runtime library (libgfortran).
......
/* Copyright (C) 2002-2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of the GNU Fortran 95 runtime library (libgfortran).
......@@ -134,10 +133,10 @@ static st_option access_opt[] = {
};
/* test_endfile()-- Given a unit, test to see if the file is
* positioned at the terminal point, and if so, change state from
* NO_ENDFILE flag to AT_ENDFILE. This prevents us from changing the
* state from AFTER_ENDFILE to AT_ENDFILE. */
/* Given a unit, test to see if the file is positioned at the terminal
point, and if so, change state from NO_ENDFILE flag to AT_ENDFILE.
This prevents us from changing the state from AFTER_ENDFILE to
AT_ENDFILE. */
void
test_endfile (gfc_unit * u)
......@@ -148,14 +147,14 @@ test_endfile (gfc_unit * u)
}
/* edit_modes()-- Change the modes of a file, those that are allowed
* to be changed. */
/* Change the modes of a file, those that are allowed * to be
changed. */
static void
edit_modes (gfc_unit * u, unit_flags * flags)
{
/* Complain about attempts to change the unchangeable */
/* Complain about attempts to change the unchangeable. */
if (flags->status != STATUS_UNSPECIFIED &&
u->flags.status != flags->position)
......@@ -178,7 +177,7 @@ edit_modes (gfc_unit * u, unit_flags * flags)
generate_error (ERROR_BAD_OPTION,
"Cannot change ACTION parameter in OPEN statement");
/* Status must be OLD if present */
/* Status must be OLD if present. */
if (flags->status != STATUS_UNSPECIFIED && flags->status != STATUS_OLD)
generate_error (ERROR_BAD_OPTION,
......@@ -203,7 +202,8 @@ edit_modes (gfc_unit * u, unit_flags * flags)
}
if (ioparm.library_return == LIBRARY_OK)
{ /* Change the changeable */
{
/* Change the changeable: */
if (flags->blank != BLANK_UNSPECIFIED)
u->flags.blank = flags->blank;
if (flags->delim != DELIM_UNSPECIFIED)
......@@ -212,7 +212,7 @@ edit_modes (gfc_unit * u, unit_flags * flags)
u->flags.pad = flags->pad;
}
/* Reposition the file if necessary. */
/* Reposition the file if necessary. */
switch (flags->position)
{
......@@ -227,7 +227,7 @@ edit_modes (gfc_unit * u, unit_flags * flags)
u->current_record = 0;
u->last_record = 0;
test_endfile (u); /* We might be at the end */
test_endfile (u); /* We might be at the end. */
break;
case POSITION_APPEND:
......@@ -235,7 +235,7 @@ edit_modes (gfc_unit * u, unit_flags * flags)
goto seek_error;
u->current_record = 0;
u->endfile = AT_ENDFILE; /* We are at the end */
u->endfile = AT_ENDFILE; /* We are at the end. */
break;
seek_error:
......@@ -245,7 +245,7 @@ edit_modes (gfc_unit * u, unit_flags * flags)
}
/* new_unit()-- Open an unused unit */
/* Open an unused unit. */
void
new_unit (unit_flags * flags)
......@@ -254,13 +254,13 @@ new_unit (unit_flags * flags)
stream *s;
char tmpname[5 /* fort. */ + 10 /* digits of unit number */ + 1 /* 0 */];
/* Change unspecifieds to defaults */
/* Change unspecifieds to defaults. */
if (flags->access == ACCESS_UNSPECIFIED)
flags->access = ACCESS_SEQUENTIAL;
if (flags->action == ACTION_UNSPECIFIED)
flags->action = ACTION_READWRITE; /* Processor dependent */
flags->action = ACTION_READWRITE; /* Processor dependent. */
if (flags->form == FORM_UNSPECIFIED)
flags->form = (flags->access == ACCESS_SEQUENTIAL)
......@@ -321,7 +321,7 @@ new_unit (unit_flags * flags)
if (flags->status == STATUS_UNSPECIFIED)
flags->status = STATUS_UNKNOWN;
/* Checks */
/* Checks. */
if (flags->access == ACCESS_DIRECT && ioparm.recl_in == 0)
{
......@@ -362,7 +362,7 @@ new_unit (unit_flags * flags)
internal_error ("new_unit(): Bad status");
}
/* Make sure the file isn't already open someplace else */
/* Make sure the file isn't already open someplace else. */
if (find_file () != NULL)
{
......@@ -370,7 +370,7 @@ new_unit (unit_flags * flags)
goto cleanup;
}
/* Open file */
/* Open file. */
s = open_external (flags->action, flags->status);
if (s == NULL)
......@@ -382,7 +382,7 @@ new_unit (unit_flags * flags)
if (flags->status == STATUS_NEW || flags->status == STATUS_REPLACE)
flags->status = STATUS_OLD;
/* Create the unit structure */
/* Create the unit structure. */
u = get_mem (sizeof (gfc_unit) + ioparm.file_len);
......@@ -390,15 +390,15 @@ new_unit (unit_flags * flags)
u->s = s;
u->flags = *flags;
/* Unspecified recl ends up with a processor dependent value */
/* Unspecified recl ends up with a processor dependent value. */
u->recl = (ioparm.recl_in != 0) ? ioparm.recl_in : DEFAULT_RECL;
u->last_record = 0;
u->current_record = 0;
/* If the file is direct access, calculate the maximum record number
* via a division now instead of letting the multiplication overflow
* later. */
via a division now instead of letting the multiplication overflow
later. */
if (flags->access == ACCESS_DIRECT)
u->maxrec = g.max_offset / u->recl;
......@@ -409,25 +409,24 @@ new_unit (unit_flags * flags)
insert_unit (u);
/* The file is now connected. Errors after this point leave the
* file connected. Curiously, the standard requires that the
* position specifier be ignored for new files so a newly connected
* file starts out that the initial point. We still need to figure
* out if the file is at the end or not. */
file connected. Curiously, the standard requires that the
position specifier be ignored for new files so a newly connected
file starts out that the initial point. We still need to figure
out if the file is at the end or not. */
test_endfile (u);
cleanup:
/* Free memory associated with a temporary filename */
/* Free memory associated with a temporary filename. */
if (flags->status == STATUS_SCRATCH)
free_mem (ioparm.file);
}
/* already_open()-- Open a unit which is already open. This involves
* changing the modes or closing what is there now and opening the new
* file. */
/* Open a unit which is already open. This involves changing the
modes or closing what is there now and opening the new file. */
static void
already_open (gfc_unit * u, unit_flags * flags)
......@@ -440,7 +439,7 @@ already_open (gfc_unit * u, unit_flags * flags)
}
/* If the file is connected to something else, close it and open a
* new unit */
new unit. */
if (!compare_file_filename (u->s, ioparm.file, ioparm.file_len))
{
......@@ -458,8 +457,7 @@ already_open (gfc_unit * u, unit_flags * flags)
}
/*************/
/* open file */
/* Open file. */
void
st_open (void)
......@@ -469,7 +467,7 @@ st_open (void)
library_start ();
/* Decode options */
/* Decode options. */
flags.access = (ioparm.access == NULL) ? ACCESS_UNSPECIFIED :
find_option (ioparm.access, ioparm.access_len, access_opt,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment