mirror of git://gcc.gnu.org/git/gcc.git
close.c: Fix white space in pointer declarations and comment formats where applicable.
2017-04-11 Jerry DeLisle <jvdelisle@gcc.gnu.org> * close.c: Fix white space in pointer declarations and comment formats where applicable. * fbuf.c: Likewise. * fbuf.h: Likewise. * format.c: Likewise. * inquire.c: Likewise. * intrinsics.c: Likewise. * list_read.c: Likewise. * lock.c: Likewise. * open.c: Likewise. * read.c: Likewise. * transfer.c: Likewise. * unit.c: Likewise. * unix.c: Likewise. * unix.h: Likewise. * write.c: Likewise. From-SVN: r246842
This commit is contained in:
parent
276ebde7b1
commit
f29876bba0
|
|
@ -1,3 +1,22 @@
|
|||
2017-04-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
* close.c: Fix white space in pointer declarations and comment
|
||||
formats where applicable.
|
||||
* fbuf.c: Likewise.
|
||||
* fbuf.h: Likewise.
|
||||
* format.c: Likewise.
|
||||
* inquire.c: Likewise.
|
||||
* intrinsics.c: Likewise.
|
||||
* list_read.c: Likewise.
|
||||
* lock.c: Likewise.
|
||||
* open.c: Likewise.
|
||||
* read.c: Likewise.
|
||||
* transfer.c: Likewise.
|
||||
* unit.c: Likewise.
|
||||
* unix.c: Likewise.
|
||||
* unix.h: Likewise.
|
||||
* write.c: Likewise.
|
||||
|
||||
2017-03-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libgfortran/78670
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
|||
|
||||
|
||||
/* format.c-- parse a FORMAT string into a binary format suitable for
|
||||
* interpretation during I/O statements */
|
||||
interpretation during I/O statements. */
|
||||
|
||||
#include "io.h"
|
||||
#include "format.h"
|
||||
|
|
@ -179,8 +179,8 @@ find_parsed_format (st_parameter_dt *dtp)
|
|||
|
||||
|
||||
/* next_char()-- Return the next character in the format string.
|
||||
* Returns -1 when the string is done. If the literal flag is set,
|
||||
* spaces are significant, otherwise they are not. */
|
||||
Returns -1 when the string is done. If the literal flag is set,
|
||||
spaces are significant, otherwise they are not. */
|
||||
|
||||
static int
|
||||
next_char (format_data *fmt, int literal)
|
||||
|
|
@ -209,8 +209,8 @@ next_char (format_data *fmt, int literal)
|
|||
|
||||
|
||||
/* get_fnode()-- Allocate a new format node, inserting it into the
|
||||
* current singly linked list. These are initially allocated from the
|
||||
* static buffer. */
|
||||
current singly linked list. These are initially allocated from the
|
||||
static buffer. */
|
||||
|
||||
static fnode *
|
||||
get_fnode (format_data *fmt, fnode **head, fnode **tail, format_token t)
|
||||
|
|
@ -286,8 +286,8 @@ free_format_data (format_data *fmt)
|
|||
|
||||
|
||||
/* format_lex()-- Simple lexical analyzer for getting the next token
|
||||
* in a FORMAT string. We support a one-level token pushback in the
|
||||
* fmt->saved_token variable. */
|
||||
in a FORMAT string. We support a one-level token pushback in the
|
||||
fmt->saved_token variable. */
|
||||
|
||||
static format_token
|
||||
format_lex (format_data *fmt)
|
||||
|
|
@ -605,8 +605,8 @@ format_lex (format_data *fmt)
|
|||
|
||||
|
||||
/* parse_format_list()-- Parse a format list. Assumes that a left
|
||||
* paren has already been seen. Returns a list representing the
|
||||
* parenthesis node which contains the rest of the list. */
|
||||
paren has already been seen. Returns a list representing the
|
||||
parenthesis node which contains the rest of the list. */
|
||||
|
||||
static fnode *
|
||||
parse_format_list (st_parameter_dt *dtp, bool *seen_dd)
|
||||
|
|
@ -1196,13 +1196,13 @@ parse_format_list (st_parameter_dt *dtp, bool *seen_dd)
|
|||
|
||||
|
||||
/* format_error()-- Generate an error message for a format statement.
|
||||
* If the node that gives the location of the error is NULL, the error
|
||||
* is assumed to happen at parse time, and the current location of the
|
||||
* parser is shown.
|
||||
*
|
||||
* We generate a message showing where the problem is. We take extra
|
||||
* care to print only the relevant part of the format if it is longer
|
||||
* than a standard 80 column display. */
|
||||
If the node that gives the location of the error is NULL, the error
|
||||
is assumed to happen at parse time, and the current location of the
|
||||
parser is shown.
|
||||
|
||||
We generate a message showing where the problem is. We take extra
|
||||
care to print only the relevant part of the format if it is longer
|
||||
than a standard 80 column display. */
|
||||
|
||||
void
|
||||
format_error (st_parameter_dt *dtp, const fnode *f, const char *message)
|
||||
|
|
@ -1254,11 +1254,11 @@ format_error (st_parameter_dt *dtp, const fnode *f, const char *message)
|
|||
|
||||
|
||||
/* revert()-- Do reversion of the format. Control reverts to the left
|
||||
* parenthesis that matches the rightmost right parenthesis. From our
|
||||
* tree structure, we are looking for the rightmost parenthesis node
|
||||
* at the second level, the first level always being a single
|
||||
* parenthesis node. If this node doesn't exit, we use the top
|
||||
* level. */
|
||||
parenthesis that matches the rightmost right parenthesis. From our
|
||||
tree structure, we are looking for the rightmost parenthesis node
|
||||
at the second level, the first level always being a single
|
||||
parenthesis node. If this node doesn't exit, we use the top
|
||||
level. */
|
||||
|
||||
static void
|
||||
revert (st_parameter_dt *dtp)
|
||||
|
|
@ -1360,9 +1360,9 @@ parse_format (st_parameter_dt *dtp)
|
|||
|
||||
|
||||
/* next_format0()-- Get the next format node without worrying about
|
||||
* reversion. Returns NULL when we hit the end of the list.
|
||||
* Parenthesis nodes are incremented after the list has been
|
||||
* exhausted, other nodes are incremented before they are returned. */
|
||||
reversion. Returns NULL when we hit the end of the list.
|
||||
Parenthesis nodes are incremented after the list has been
|
||||
exhausted, other nodes are incremented before they are returned. */
|
||||
|
||||
static const fnode *
|
||||
next_format0 (fnode *f)
|
||||
|
|
@ -1418,11 +1418,11 @@ next_format0 (fnode * f)
|
|||
|
||||
|
||||
/* next_format()-- Return the next format node. If the format list
|
||||
* ends up being exhausted, we do reversion. Reversion is only
|
||||
* allowed if we've seen a data descriptor since the
|
||||
* initialization or the last reversion. We return NULL if there
|
||||
* are no more data descriptors to return (which is an error
|
||||
* condition). */
|
||||
ends up being exhausted, we do reversion. Reversion is only
|
||||
allowed if we've seen a data descriptor since the
|
||||
initialization or the last reversion. We return NULL if there
|
||||
are no more data descriptors to return (which is an error
|
||||
condition). */
|
||||
|
||||
const fnode *
|
||||
next_format (st_parameter_dt *dtp)
|
||||
|
|
@ -1455,7 +1455,7 @@ next_format (st_parameter_dt *dtp)
|
|||
}
|
||||
|
||||
/* Push the first reverted token and return a colon node in case
|
||||
* there are no more data items. */
|
||||
there are no more data items. */
|
||||
|
||||
fmt->saved_format = f;
|
||||
return &colon_node;
|
||||
|
|
@ -1475,11 +1475,11 @@ next_format (st_parameter_dt *dtp)
|
|||
|
||||
|
||||
/* unget_format()-- Push the given format back so that it will be
|
||||
* returned on the next call to next_format() without affecting
|
||||
* counts. This is necessary when we've encountered a data
|
||||
* descriptor, but don't know what the data item is yet. The format
|
||||
* node is pushed back, and we return control to the main program,
|
||||
* which calls the library back with the data item (or not). */
|
||||
returned on the next call to next_format() without affecting
|
||||
counts. This is necessary when we've encountered a data
|
||||
descriptor, but don't know what the data item is yet. The format
|
||||
node is pushed back, and we return control to the main program,
|
||||
which calls the library back with the data item (or not). */
|
||||
|
||||
void
|
||||
unget_format (st_parameter_dt *dtp, const fnode *f)
|
||||
|
|
|
|||
|
|
@ -631,7 +631,7 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u)
|
|||
|
||||
|
||||
/* inquire_via_filename()-- Inquiry via filename. This subroutine is
|
||||
* only used if the filename is *not* connected to a unit number. */
|
||||
only used if the filename is *not* connected to a unit number. */
|
||||
|
||||
static void
|
||||
inquire_via_filename (st_parameter_inquire *iqp)
|
||||
|
|
|
|||
|
|
@ -565,7 +565,7 @@ read_a_char4 (st_parameter_dt *dtp, const fnode *f, char *p, int length)
|
|||
}
|
||||
|
||||
/* eat_leading_spaces()-- Given a character pointer and a width,
|
||||
* ignore the leading spaces. */
|
||||
ignore the leading spaces. */
|
||||
|
||||
static char *
|
||||
eat_leading_spaces (int *width, char *p)
|
||||
|
|
@ -617,7 +617,7 @@ next_char (st_parameter_dt *dtp, char **p, int *w)
|
|||
|
||||
|
||||
/* read_decimal()-- Read a decimal integer value. The values here are
|
||||
* signed values. */
|
||||
signed values. */
|
||||
|
||||
void
|
||||
read_decimal (st_parameter_dt *dtp, const fnode *f, char *dest, int length)
|
||||
|
|
@ -722,9 +722,9 @@ read_decimal (st_parameter_dt *dtp, const fnode *f, char *dest, int length)
|
|||
|
||||
|
||||
/* read_radix()-- This function reads values for non-decimal radixes.
|
||||
* The difference here is that we treat the values here as unsigned
|
||||
* values for the purposes of overflow. If minus sign is present and
|
||||
* the top bit is set, the value will be incorrect. */
|
||||
The difference here is that we treat the values here as unsigned
|
||||
values for the purposes of overflow. If minus sign is present and
|
||||
the top bit is set, the value will be incorrect. */
|
||||
|
||||
void
|
||||
read_radix (st_parameter_dt *dtp, const fnode *f, char *dest, int length,
|
||||
|
|
@ -1227,7 +1227,7 @@ bad_float:
|
|||
|
||||
|
||||
/* read_x()-- Deal with the X/TR descriptor. We just read some data
|
||||
* and never look at it. */
|
||||
and never look at it. */
|
||||
|
||||
void
|
||||
read_x (st_parameter_dt *dtp, int n)
|
||||
|
|
|
|||
|
|
@ -141,11 +141,11 @@ __gthread_mutex_t old_locale_lock;
|
|||
|
||||
|
||||
/* This implementation is based on Stefan Nilsson's article in the
|
||||
* July 1997 Doctor Dobb's Journal, "Treaps in Java". */
|
||||
July 1997 Doctor Dobb's Journal, "Treaps in Java". */
|
||||
|
||||
/* pseudo_random()-- Simple linear congruential pseudorandom number
|
||||
* generator. The period of this generator is 44071, which is plenty
|
||||
* for our purposes. */
|
||||
generator. The period of this generator is 44071, which is plenty
|
||||
for our purposes. */
|
||||
|
||||
static int
|
||||
pseudo_random (void)
|
||||
|
|
@ -290,9 +290,9 @@ delete_root (gfc_unit * t)
|
|||
|
||||
|
||||
/* delete_treap()-- Delete an element from a tree. The 'old' value
|
||||
* does not necessarily have to point to the element to be deleted, it
|
||||
* must just point to a treap structure with the key to be deleted.
|
||||
* Returns the new root node of the tree. */
|
||||
does not necessarily have to point to the element to be deleted, it
|
||||
must just point to a treap structure with the key to be deleted.
|
||||
Returns the new root node of the tree. */
|
||||
|
||||
static gfc_unit *
|
||||
delete_treap (gfc_unit *old, gfc_unit *t)
|
||||
|
|
@ -325,8 +325,8 @@ delete_unit (gfc_unit * old)
|
|||
|
||||
|
||||
/* get_gfc_unit()-- Given an integer, return a pointer to the unit
|
||||
* structure. Returns NULL if the unit does not exist,
|
||||
* otherwise returns a locked unit. */
|
||||
structure. Returns NULL if the unit does not exist,
|
||||
otherwise returns a locked unit. */
|
||||
|
||||
static gfc_unit *
|
||||
get_gfc_unit (int n, int do_create)
|
||||
|
|
|
|||
|
|
@ -212,11 +212,11 @@ unix_stream;
|
|||
|
||||
|
||||
/* fix_fd()-- Given a file descriptor, make sure it is not one of the
|
||||
* standard descriptors, returning a non-standard descriptor. If the
|
||||
* user specifies that system errors should go to standard output,
|
||||
* then closes standard output, we don't want the system errors to a
|
||||
* file that has been given file descriptor 1 or 0. We want to send
|
||||
* the error to the invalid descriptor. */
|
||||
standard descriptors, returning a non-standard descriptor. If the
|
||||
user specifies that system errors should go to standard output,
|
||||
then closes standard output, we don't want the system errors to a
|
||||
file that has been given file descriptor 1 or 0. We want to send
|
||||
the error to the invalid descriptor. */
|
||||
|
||||
static int
|
||||
fix_fd (int fd)
|
||||
|
|
@ -1039,7 +1039,7 @@ open_internal4 (char *base, int length, gfc_offset offset)
|
|||
|
||||
|
||||
/* fd_to_stream()-- Given an open file descriptor, build a stream
|
||||
* around it. */
|
||||
around it. */
|
||||
|
||||
static stream *
|
||||
fd_to_stream (int fd, bool unformatted)
|
||||
|
|
@ -1220,11 +1220,11 @@ tempfile_open (const char *tempdir, char **fname)
|
|||
|
||||
|
||||
/* tempfile()-- Generate a temporary filename for a scratch file and
|
||||
* open it. mkstemp() opens the file for reading and writing, but the
|
||||
* library mode prevents anything that is not allowed. The descriptor
|
||||
* is returned, which is -1 on error. The template is pointed to by
|
||||
* opp->file, which is copied into the unit structure
|
||||
* and freed later. */
|
||||
open it. mkstemp() opens the file for reading and writing, but the
|
||||
library mode prevents anything that is not allowed. The descriptor
|
||||
is returned, which is -1 on error. The template is pointed to by
|
||||
opp->file, which is copied into the unit structure
|
||||
and freed later. */
|
||||
|
||||
static int
|
||||
tempfile (st_parameter_open *opp)
|
||||
|
|
@ -1273,9 +1273,9 @@ tempfile (st_parameter_open *opp)
|
|||
|
||||
|
||||
/* regular_file2()-- Open a regular file.
|
||||
* Change flags->action if it is ACTION_UNSPECIFIED on entry,
|
||||
* unless an error occurs.
|
||||
* Returns the descriptor, which is less than zero on error. */
|
||||
Change flags->action if it is ACTION_UNSPECIFIED on entry,
|
||||
unless an error occurs.
|
||||
Returns the descriptor, which is less than zero on error. */
|
||||
|
||||
static int
|
||||
regular_file2 (const char *path, st_parameter_open *opp, unit_flags *flags)
|
||||
|
|
@ -1486,8 +1486,8 @@ regular_file (st_parameter_open *opp, unit_flags *flags)
|
|||
}
|
||||
|
||||
/* open_external()-- Open an external file, unix specific version.
|
||||
* Change flags->action if it is ACTION_UNSPECIFIED on entry.
|
||||
* Returns NULL on operating system error. */
|
||||
Change flags->action if it is ACTION_UNSPECIFIED on entry.
|
||||
Returns NULL on operating system error. */
|
||||
|
||||
stream *
|
||||
open_external (st_parameter_open *opp, unit_flags *flags)
|
||||
|
|
@ -1509,7 +1509,7 @@ open_external (st_parameter_open *opp, unit_flags *flags)
|
|||
else
|
||||
{
|
||||
/* regular_file resets flags->action if it is ACTION_UNSPECIFIED and
|
||||
* if it succeeds */
|
||||
if it succeeds */
|
||||
fd = regular_file (opp, flags);
|
||||
#ifndef O_CLOEXEC
|
||||
set_close_on_exec (fd);
|
||||
|
|
@ -1528,7 +1528,7 @@ open_external (st_parameter_open *opp, unit_flags *flags)
|
|||
|
||||
|
||||
/* input_stream()-- Return a stream pointer to the default input stream.
|
||||
* Called on initialization. */
|
||||
Called on initialization. */
|
||||
|
||||
stream *
|
||||
input_stream (void)
|
||||
|
|
@ -1538,7 +1538,7 @@ input_stream (void)
|
|||
|
||||
|
||||
/* output_stream()-- Return a stream pointer to the default output stream.
|
||||
* Called on initialization. */
|
||||
Called on initialization. */
|
||||
|
||||
stream *
|
||||
output_stream (void)
|
||||
|
|
@ -1555,7 +1555,7 @@ output_stream (void)
|
|||
|
||||
|
||||
/* error_stream()-- Return a stream pointer to the default error stream.
|
||||
* Called on initialization. */
|
||||
Called on initialization. */
|
||||
|
||||
stream *
|
||||
error_stream (void)
|
||||
|
|
@ -1572,8 +1572,8 @@ error_stream (void)
|
|||
|
||||
|
||||
/* compare_file_filename()-- Given an open stream and a fortran string
|
||||
* that is a filename, figure out if the file is the same as the
|
||||
* filename. */
|
||||
that is a filename, figure out if the file is the same as the
|
||||
filename. */
|
||||
|
||||
int
|
||||
compare_file_filename (gfc_unit *u, const char *name, int len)
|
||||
|
|
@ -1591,7 +1591,7 @@ compare_file_filename (gfc_unit *u, const char *name, int len)
|
|||
char *path = fc_strdup (name, len);
|
||||
|
||||
/* If the filename doesn't exist, then there is no match with the
|
||||
* existing file. */
|
||||
existing file. */
|
||||
|
||||
if (TEMP_FAILURE_RETRY (stat (path, &st)) < 0)
|
||||
{
|
||||
|
|
@ -1682,7 +1682,7 @@ find_file0 (gfc_unit *u, FIND_FILE0_DECL)
|
|||
|
||||
|
||||
/* find_file()-- Take the current filename and see if there is a unit
|
||||
* that has the file already open. Returns a pointer to the unit if so. */
|
||||
that has the file already open. Returns a pointer to the unit if so. */
|
||||
|
||||
gfc_unit *
|
||||
find_file (const char *file, gfc_charlen_type file_len)
|
||||
|
|
@ -1838,7 +1838,7 @@ close_share (gfc_unit *u __attribute__ ((unused)))
|
|||
|
||||
|
||||
/* file_exists()-- Returns nonzero if the current filename exists on
|
||||
* the system */
|
||||
the system */
|
||||
|
||||
int
|
||||
file_exists (const char *file, gfc_charlen_type file_len)
|
||||
|
|
@ -1868,8 +1868,8 @@ file_size (const char *file, gfc_charlen_type file_len)
|
|||
static const char yes[] = "YES", no[] = "NO", unknown[] = "UNKNOWN";
|
||||
|
||||
/* inquire_sequential()-- Given a fortran string, determine if the
|
||||
* file is suitable for sequential access. Returns a C-style
|
||||
* string. */
|
||||
file is suitable for sequential access. Returns a C-style
|
||||
string. */
|
||||
|
||||
const char *
|
||||
inquire_sequential (const char *string, int len)
|
||||
|
|
@ -1898,7 +1898,7 @@ inquire_sequential (const char *string, int len)
|
|||
|
||||
|
||||
/* inquire_direct()-- Given a fortran string, determine if the file is
|
||||
* suitable for direct access. Returns a C-style string. */
|
||||
suitable for direct access. Returns a C-style string. */
|
||||
|
||||
const char *
|
||||
inquire_direct (const char *string, int len)
|
||||
|
|
@ -1927,7 +1927,7 @@ inquire_direct (const char *string, int len)
|
|||
|
||||
|
||||
/* inquire_formatted()-- Given a fortran string, determine if the file
|
||||
* is suitable for formatted form. Returns a C-style string. */
|
||||
is suitable for formatted form. Returns a C-style string. */
|
||||
|
||||
const char *
|
||||
inquire_formatted (const char *string, int len)
|
||||
|
|
@ -1957,7 +1957,7 @@ inquire_formatted (const char *string, int len)
|
|||
|
||||
|
||||
/* inquire_unformatted()-- Given a fortran string, determine if the file
|
||||
* is suitable for unformatted form. Returns a C-style string. */
|
||||
is suitable for unformatted form. Returns a C-style string. */
|
||||
|
||||
const char *
|
||||
inquire_unformatted (const char *string, int len)
|
||||
|
|
@ -1967,7 +1967,7 @@ inquire_unformatted (const char *string, int len)
|
|||
|
||||
|
||||
/* inquire_access()-- Given a fortran string, determine if the file is
|
||||
* suitable for access. */
|
||||
suitable for access. */
|
||||
|
||||
static const char *
|
||||
inquire_access (const char *string, int len, int mode)
|
||||
|
|
@ -1985,7 +1985,7 @@ inquire_access (const char *string, int len, int mode)
|
|||
|
||||
|
||||
/* inquire_read()-- Given a fortran string, determine if the file is
|
||||
* suitable for READ access. */
|
||||
suitable for READ access. */
|
||||
|
||||
const char *
|
||||
inquire_read (const char *string, int len)
|
||||
|
|
@ -1995,7 +1995,7 @@ inquire_read (const char *string, int len)
|
|||
|
||||
|
||||
/* inquire_write()-- Given a fortran string, determine if the file is
|
||||
* suitable for READ access. */
|
||||
suitable for READ access. */
|
||||
|
||||
const char *
|
||||
inquire_write (const char *string, int len)
|
||||
|
|
@ -2005,7 +2005,7 @@ inquire_write (const char *string, int len)
|
|||
|
||||
|
||||
/* inquire_readwrite()-- Given a fortran string, determine if the file is
|
||||
* suitable for read and write access. */
|
||||
suitable for read and write access. */
|
||||
|
||||
const char *
|
||||
inquire_readwrite (const char *string, int len)
|
||||
|
|
|
|||
Loading…
Reference in New Issue