From: Jerry DeLisle Date: Tue, 11 Apr 2017 14:51:25 +0000 (+0000) Subject: close.c: Fix white space in pointer declarations and comment formats where applicable. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f29876bba06c24d6fe543941ad6f683c61910555;p=gcc.git close.c: Fix white space in pointer declarations and comment formats where applicable. 2017-04-11 Jerry DeLisle * 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 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 897c2573ec1..ad8d95c1b19 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,22 @@ +2017-04-11 Jerry DeLisle + + * 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 PR libgfortran/78670 diff --git a/libgfortran/io/close.c b/libgfortran/io/close.c index 8771d6ac6b3..e40fd92b8bf 100644 --- a/libgfortran/io/close.c +++ b/libgfortran/io/close.c @@ -46,7 +46,7 @@ st_close (st_parameter_close *clp) close_status status; gfc_unit *u; #if !HAVE_UNLINK_OPEN_FILE - char * path; + char *path; path = NULL; #endif diff --git a/libgfortran/io/fbuf.c b/libgfortran/io/fbuf.c index 931558c852f..944469d8cec 100644 --- a/libgfortran/io/fbuf.c +++ b/libgfortran/io/fbuf.c @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see void -fbuf_init (gfc_unit * u, int len) +fbuf_init (gfc_unit *u, int len) { if (len == 0) len = 512; /* Default size. */ @@ -46,7 +46,7 @@ fbuf_init (gfc_unit * u, int len) void -fbuf_destroy (gfc_unit * u) +fbuf_destroy (gfc_unit *u) { if (u->fbuf == NULL) return; @@ -58,7 +58,7 @@ fbuf_destroy (gfc_unit * u) static void #ifdef FBUF_DEBUG -fbuf_debug (gfc_unit * u, const char * format, ...) +fbuf_debug (gfc_unit *u, const char *format, ...) { va_list args; va_start(args, format); @@ -73,8 +73,8 @@ fbuf_debug (gfc_unit * u, const char * format, ...) fprintf (stderr, "''\n"); } #else -fbuf_debug (gfc_unit * u __attribute__ ((unused)), - const char * format __attribute__ ((unused)), +fbuf_debug (gfc_unit *u __attribute__ ((unused)), + const char *format __attribute__ ((unused)), ...) {} #endif @@ -85,7 +85,7 @@ fbuf_debug (gfc_unit * u __attribute__ ((unused)), modified. */ int -fbuf_reset (gfc_unit * u) +fbuf_reset (gfc_unit *u) { int seekval = 0; @@ -111,7 +111,7 @@ fbuf_reset (gfc_unit * u) reallocating if necessary. */ char * -fbuf_alloc (gfc_unit * u, int len) +fbuf_alloc (gfc_unit *u, int len) { int newlen; char *dest; @@ -119,7 +119,7 @@ fbuf_alloc (gfc_unit * u, int len) if (u->fbuf->pos + len > u->fbuf->len) { /* Round up to nearest multiple of the current buffer length. */ - newlen = ((u->fbuf->pos + len) / u->fbuf->len + 1) * u->fbuf->len; + newlen = ((u->fbuf->pos + len) / u->fbuf->len + 1) *u->fbuf->len; u->fbuf->buf = xrealloc (u->fbuf->buf, newlen); u->fbuf->len = newlen; } @@ -136,7 +136,7 @@ fbuf_alloc (gfc_unit * u, int len) mode. Return value is 0 for success, -1 on failure. */ int -fbuf_flush (gfc_unit * u, unit_mode mode) +fbuf_flush (gfc_unit *u, unit_mode mode) { int nwritten; @@ -175,7 +175,7 @@ fbuf_flush (gfc_unit * u, unit_mode mode) Return value is 0 for success, -1 on failure. */ int -fbuf_flush_list (gfc_unit * u, unit_mode mode) +fbuf_flush_list (gfc_unit *u, unit_mode mode) { int nwritten; @@ -207,7 +207,7 @@ fbuf_flush_list (gfc_unit * u, unit_mode mode) int -fbuf_seek (gfc_unit * u, int off, int whence) +fbuf_seek (gfc_unit *u, int off, int whence) { if (!u->fbuf) return -1; @@ -248,7 +248,7 @@ fbuf_seek (gfc_unit * u, int off, int whence) of bytes actually processed. */ char * -fbuf_read (gfc_unit * u, int * len) +fbuf_read (gfc_unit *u, int *len) { char *ptr; int oldact, oldpos; @@ -279,7 +279,7 @@ fbuf_read (gfc_unit * u, int * len) reading. Never call this function directly. */ int -fbuf_getc_refill (gfc_unit * u) +fbuf_getc_refill (gfc_unit *u) { int nread; char *p; diff --git a/libgfortran/io/fbuf.h b/libgfortran/io/fbuf.h index 94a947b7f97..a0c571338b4 100644 --- a/libgfortran/io/fbuf.h +++ b/libgfortran/io/fbuf.h @@ -53,7 +53,7 @@ internal_proto(fbuf_destroy); extern int fbuf_reset (gfc_unit *); internal_proto(fbuf_reset); -extern char * fbuf_alloc (gfc_unit *, int); +extern char *fbuf_alloc (gfc_unit *, int); internal_proto(fbuf_alloc); extern int fbuf_flush (gfc_unit *, unit_mode); @@ -65,7 +65,7 @@ internal_proto(fbuf_flush_list); extern int fbuf_seek (gfc_unit *, int, int); internal_proto(fbuf_seek); -extern char * fbuf_read (gfc_unit *, int *); +extern char *fbuf_read (gfc_unit *, int *); internal_proto(fbuf_read); /* Never call this function, only use fbuf_getc(). */ @@ -73,7 +73,7 @@ extern int fbuf_getc_refill (gfc_unit *); internal_proto(fbuf_getc_refill); static inline int -fbuf_getc (gfc_unit * u) +fbuf_getc (gfc_unit *u) { if (u->fbuf->pos < u->fbuf->act) return (unsigned char) u->fbuf->buf[u->fbuf->pos++]; @@ -81,7 +81,7 @@ fbuf_getc (gfc_unit * u) } static inline char * -fbuf_getptr (gfc_unit * u) +fbuf_getptr (gfc_unit *u) { return (char*) (u->fbuf->buf + u->fbuf->pos); } diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c index 77d668d971d..bd14ac37bb3 100644 --- a/libgfortran/io/format.c +++ b/libgfortran/io/format.c @@ -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,12 +1360,12 @@ 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) +next_format0 (fnode *f) { const fnode *r; @@ -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) diff --git a/libgfortran/io/inquire.c b/libgfortran/io/inquire.c index b59b5c8d73c..4cf87d339a7 100644 --- a/libgfortran/io/inquire.c +++ b/libgfortran/io/inquire.c @@ -36,7 +36,7 @@ static const char yes[] = "YES", no[] = "NO", undefined[] = "UNDEFINED"; /* inquire_via_unit()-- Inquiry via unit number. The unit might not exist. */ static void -inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u) +inquire_via_unit (st_parameter_inquire *iqp, gfc_unit *u) { const char *p; GFC_INTEGER_4 cf = iqp->common.flags; @@ -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) diff --git a/libgfortran/io/intrinsics.c b/libgfortran/io/intrinsics.c index 7b01ba68962..adf489c2abd 100644 --- a/libgfortran/io/intrinsics.c +++ b/libgfortran/io/intrinsics.c @@ -36,10 +36,10 @@ extern int PREFIX(fgetc) (const int *, char *, gfc_charlen_type); export_proto_np(PREFIX(fgetc)); int -PREFIX(fgetc) (const int * unit, char * c, gfc_charlen_type c_len) +PREFIX(fgetc) (const int *unit, char *c, gfc_charlen_type c_len) { int ret; - gfc_unit * u = find_unit (*unit); + gfc_unit *u = find_unit (*unit); if (u == NULL) return -1; @@ -70,7 +70,7 @@ PREFIX(fgetc) (const int * unit, char * c, gfc_charlen_type c_len) (const int *, char *, GFC_INTEGER_ ## kind *, gfc_charlen_type); \ export_proto(fgetc_i ## kind ## _sub); \ void fgetc_i ## kind ## _sub \ - (const int * unit, char * c, GFC_INTEGER_ ## kind * st, gfc_charlen_type c_len) \ + (const int *unit, char *c, GFC_INTEGER_ ## kind *st, gfc_charlen_type c_len) \ { if (st != NULL) \ *st = PREFIX(fgetc) (unit, c, c_len); \ else \ @@ -86,7 +86,7 @@ extern int PREFIX(fget) (char *, gfc_charlen_type); export_proto_np(PREFIX(fget)); int -PREFIX(fget) (char * c, gfc_charlen_type c_len) +PREFIX(fget) (char *c, gfc_charlen_type c_len) { return PREFIX(fgetc) (&five, c, c_len); } @@ -97,7 +97,7 @@ PREFIX(fget) (char * c, gfc_charlen_type c_len) (char *, GFC_INTEGER_ ## kind *, gfc_charlen_type); \ export_proto(fget_i ## kind ## _sub); \ void fget_i ## kind ## _sub \ - (char * c, GFC_INTEGER_ ## kind * st, gfc_charlen_type c_len) \ + (char *c, GFC_INTEGER_ ## kind *st, gfc_charlen_type c_len) \ { if (st != NULL) \ *st = PREFIX(fgetc) (&five, c, c_len); \ else \ @@ -114,11 +114,11 @@ extern int PREFIX(fputc) (const int *, char *, gfc_charlen_type); export_proto_np(PREFIX(fputc)); int -PREFIX(fputc) (const int * unit, char * c, +PREFIX(fputc) (const int *unit, char *c, gfc_charlen_type c_len __attribute__((unused))) { ssize_t s; - gfc_unit * u = find_unit (*unit); + gfc_unit *u = find_unit (*unit); if (u == NULL) return -1; @@ -143,7 +143,7 @@ PREFIX(fputc) (const int * unit, char * c, (const int *, char *, GFC_INTEGER_ ## kind *, gfc_charlen_type); \ export_proto(fputc_i ## kind ## _sub); \ void fputc_i ## kind ## _sub \ - (const int * unit, char * c, GFC_INTEGER_ ## kind * st, gfc_charlen_type c_len) \ + (const int *unit, char *c, GFC_INTEGER_ ## kind *st, gfc_charlen_type c_len) \ { if (st != NULL) \ *st = PREFIX(fputc) (unit, c, c_len); \ else \ @@ -159,7 +159,7 @@ extern int PREFIX(fput) (char *, gfc_charlen_type); export_proto_np(PREFIX(fput)); int -PREFIX(fput) (char * c, gfc_charlen_type c_len) +PREFIX(fput) (char *c, gfc_charlen_type c_len) { return PREFIX(fputc) (&six, c, c_len); } @@ -170,7 +170,7 @@ PREFIX(fput) (char * c, gfc_charlen_type c_len) (char *, GFC_INTEGER_ ## kind *, gfc_charlen_type); \ export_proto(fput_i ## kind ## _sub); \ void fput_i ## kind ## _sub \ - (char * c, GFC_INTEGER_ ## kind * st, gfc_charlen_type c_len) \ + (char *c, GFC_INTEGER_ ## kind *st, gfc_charlen_type c_len) \ { if (st != NULL) \ *st = PREFIX(fputc) (&six, c, c_len); \ else \ @@ -236,9 +236,9 @@ extern void fseek_sub (int *, GFC_IO_INT *, int *, int *); export_proto(fseek_sub); void -fseek_sub (int * unit, GFC_IO_INT * offset, int * whence, int * status) +fseek_sub (int *unit, GFC_IO_INT *offset, int *whence, int *status) { - gfc_unit * u = find_unit (*unit); + gfc_unit *u = find_unit (*unit); ssize_t result = -1; if (u != NULL) @@ -259,7 +259,7 @@ fseek_sub (int * unit, GFC_IO_INT * offset, int * whence, int * status) static gfc_offset gf_ftell (int unit) { - gfc_unit * u = find_unit (unit); + gfc_unit *u = find_unit (unit); if (u == NULL) return -1; int pos = fbuf_reset (u); @@ -275,7 +275,7 @@ extern GFC_IO_INT PREFIX(ftell) (int *); export_proto_np(PREFIX(ftell)); GFC_IO_INT -PREFIX(ftell) (int * unit) +PREFIX(ftell) (int *unit) { return gf_ftell (*unit); } @@ -285,7 +285,7 @@ PREFIX(ftell) (int * unit) extern void ftell_i ## kind ## _sub (int *, GFC_INTEGER_ ## kind *); \ export_proto(ftell_i ## kind ## _sub); \ void \ - ftell_i ## kind ## _sub (int * unit, GFC_INTEGER_ ## kind * offset) \ + ftell_i ## kind ## _sub (int *unit, GFC_INTEGER_ ## kind *offset) \ { \ *offset = gf_ftell (*unit); \ } @@ -346,7 +346,7 @@ extern void ttynam_sub (int *, char *, gfc_charlen_type); export_proto(ttynam_sub); void -ttynam_sub (int *unit, char * name, gfc_charlen_type name_len) +ttynam_sub (int *unit, char *name, gfc_charlen_type name_len) { gfc_unit *u; int nlen; @@ -373,7 +373,7 @@ extern void ttynam (char **, gfc_charlen_type *, int); export_proto(ttynam); void -ttynam (char ** name, gfc_charlen_type * name_len, int unit) +ttynam (char **name, gfc_charlen_type *name_len, int unit) { gfc_unit *u; diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 76eafa80626..9175a6bb677 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -1506,7 +1506,7 @@ parse_real (st_parameter_dt *dtp, void *buffer, int length) what it is right away. */ static void -read_complex (st_parameter_dt *dtp, void * dest, int kind, size_t size) +read_complex (st_parameter_dt *dtp, void *dest, int kind, size_t size) { char message[MSGLEN]; int c; @@ -1615,7 +1615,7 @@ eol_4: /* Parse a real number with a possible repeat count. */ static void -read_real (st_parameter_dt *dtp, void * dest, int length) +read_real (st_parameter_dt *dtp, void *dest, int length) { char message[MSGLEN]; int c; @@ -2382,11 +2382,11 @@ calls: namelist_info **prev_nl, char *, size_t) calls: static void nml_untouch_nodes (st_parameter_dt *dtp) - static namelist_info * find_nml_node (st_parameter_dt *dtp, - char * var_name) - static int nml_parse_qualifier(descriptor_dimension * ad, - array_loop_spec * ls, int rank, char *) - static void nml_touch_nodes (namelist_info * nl) + static namelist_info *find_nml_node (st_parameter_dt *dtp, + char *var_name) + static int nml_parse_qualifier(descriptor_dimension *ad, + array_loop_spec *ls, int rank, char *) + static void nml_touch_nodes (namelist_info *nl) static int nml_read_obj (namelist_info *nl, index_type offset, namelist_info **prev_nl, char *, size_t, index_type clow, index_type chigh) @@ -2671,9 +2671,9 @@ strcmp_extended_type (char *p, char *q) static namelist_info * -find_nml_node (st_parameter_dt *dtp, char * var_name) +find_nml_node (st_parameter_dt *dtp, char *var_name) { - namelist_info * t = dtp->u.p.ionml; + namelist_info *t = dtp->u.p.ionml; while (t != NULL) { if (strcmp (var_name, t->var_name) == 0) @@ -2697,11 +2697,11 @@ find_nml_node (st_parameter_dt *dtp, char * var_name) to default values */ static void -nml_touch_nodes (namelist_info * nl) +nml_touch_nodes (namelist_info *nl) { index_type len = strlen (nl->var_name) + 1; int dim; - char * ext_name = xmalloc (len + 1); + char *ext_name = xmalloc (len + 1); memcpy (ext_name, nl->var_name, len-1); memcpy (ext_name + len - 1, "%", 2); for (nl = nl->next; nl; nl = nl->next) @@ -2730,7 +2730,7 @@ nml_touch_nodes (namelist_info * nl) static void nml_untouch_nodes (st_parameter_dt *dtp) { - namelist_info * t; + namelist_info *t; for (t = dtp->u.p.ionml; t; t = t->next) t->touched = 0; return; @@ -2765,10 +2765,10 @@ nml_match_name (st_parameter_dt *dtp, const char *name, index_type len) static void nml_query (st_parameter_dt *dtp, char c) { - gfc_unit * temp_unit; - namelist_info * nl; + gfc_unit *temp_unit; + namelist_info *nl; index_type len; - char * p; + char *p; #ifdef HAVE_CRLF static const index_type endlen = 2; static const char endl[] = "\r\n"; @@ -2858,19 +2858,19 @@ query_return: error. */ static bool -nml_read_obj (st_parameter_dt *dtp, namelist_info * nl, index_type offset, +nml_read_obj (st_parameter_dt *dtp, namelist_info *nl, index_type offset, namelist_info **pprev_nl, char *nml_err_msg, size_t nml_err_msg_size, index_type clow, index_type chigh) { - namelist_info * cmp; - char * obj_name; + namelist_info *cmp; + char *obj_name; int nml_carry; int len; int dim; index_type dlen; index_type m; size_t obj_name_len; - void * pdata; + void *pdata; /* If we have encountered a previous read error or this object has not been touched in name parsing, just return. */ @@ -3191,9 +3191,9 @@ nml_get_obj_data (st_parameter_dt *dtp, namelist_info **pprev_nl, char *nml_err_msg, size_t nml_err_msg_size) { int c; - namelist_info * nl; - namelist_info * first_nl = NULL; - namelist_info * root_nl = NULL; + namelist_info *nl; + namelist_info *first_nl = NULL; + namelist_info *root_nl = NULL; int dim, parsed_rank; int component_flag, qualifier_flag; index_type clow, chigh; diff --git a/libgfortran/io/lock.c b/libgfortran/io/lock.c index 5f91c86c7da..8df7e7b3495 100644 --- a/libgfortran/io/lock.c +++ b/libgfortran/io/lock.c @@ -41,7 +41,7 @@ library_start (st_parameter_common *cmp) void free_ionml (st_parameter_dt *dtp) { - namelist_info * t1, *t2; + namelist_info *t1, *t2; /* Delete the namelist, if it exists. */ diff --git a/libgfortran/io/open.c b/libgfortran/io/open.c index c57e64a5081..9d3988a7c21 100644 --- a/libgfortran/io/open.c +++ b/libgfortran/io/open.c @@ -168,7 +168,7 @@ static const st_option async_opt[] = AT_ENDFILE. */ static void -test_endfile (gfc_unit * u) +test_endfile (gfc_unit *u) { if (u->endfile == NO_ENDFILE) { @@ -183,7 +183,7 @@ test_endfile (gfc_unit * u) changed. */ static void -edit_modes (st_parameter_open *opp, gfc_unit * u, unit_flags * flags) +edit_modes (st_parameter_open *opp, gfc_unit *u, unit_flags *flags) { /* Complain about attempts to change the unchangeable. */ @@ -329,7 +329,7 @@ edit_modes (st_parameter_open *opp, gfc_unit * u, unit_flags * flags) /* Open an unused unit. */ gfc_unit * -new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags * flags) +new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags *flags) { gfc_unit *u2; stream *s; @@ -671,7 +671,7 @@ new_unit (st_parameter_open *opp, gfc_unit *u, unit_flags * flags) modes or closing what is there now and opening the new file. */ static void -already_open (st_parameter_open *opp, gfc_unit * u, unit_flags * flags) +already_open (st_parameter_open *opp, gfc_unit *u, unit_flags *flags) { if ((opp->common.flags & IOPARM_OPEN_HAS_FILE) == 0) { diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c index beda2ec7b58..9eb21968079 100644 --- a/libgfortran/io/read.c +++ b/libgfortran/io/read.c @@ -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) diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c index 1e56b5de136..f16d8c55f6d 100644 --- a/libgfortran/io/transfer.c +++ b/libgfortran/io/transfer.c @@ -223,7 +223,7 @@ current_mode (st_parameter_dt *dtp) /* Read sequential file - internal unit */ static char * -read_sf_internal (st_parameter_dt *dtp, int * length) +read_sf_internal (st_parameter_dt *dtp, int *length) { static char *empty_string[0]; char *base = NULL; @@ -303,7 +303,7 @@ read_sf_internal (st_parameter_dt *dtp, int * length) /* Read sequential file - external unit */ static char * -read_sf (st_parameter_dt *dtp, int * length) +read_sf (st_parameter_dt *dtp, int *length) { static char *empty_string[0]; int q, q2; @@ -445,7 +445,7 @@ read_sf (st_parameter_dt *dtp, int * length) short reads. */ void * -read_block_form (st_parameter_dt *dtp, int * nbytes) +read_block_form (st_parameter_dt *dtp, int *nbytes) { char *source; int norig; @@ -527,7 +527,7 @@ read_block_form (st_parameter_dt *dtp, int * nbytes) a character(kind=4) variable. Note: Portions of this code borrowed from read_sf_internal. */ void * -read_block_form4 (st_parameter_dt *dtp, int * nbytes) +read_block_form4 (st_parameter_dt *dtp, int *nbytes) { static gfc_char4_t *empty_string[0]; gfc_char4_t *source; @@ -3584,7 +3584,7 @@ next_record_w_unf (st_parameter_dt *dtp, int next_subrecord) value is same as for POSIX write(). */ static ssize_t -sset (stream * s, int c, ssize_t nbyte) +sset (stream *s, int c, ssize_t nbyte) { #define WRITE_CHUNK 256 char p[WRITE_CHUNK]; @@ -3622,7 +3622,7 @@ next_record_cc (st_parameter_dt *dtp) fbuf_seek (dtp->u.p.current_unit, 0, SEEK_END); if (dtp->u.p.cc.len > 0) { - char * p = fbuf_alloc (dtp->u.p.current_unit, dtp->u.p.cc.len); + char *p = fbuf_alloc (dtp->u.p.current_unit, dtp->u.p.cc.len); if (!p) generate_error (&dtp->common, LIBERROR_OS, NULL); @@ -3795,7 +3795,7 @@ next_record_w (st_parameter_dt *dtp, int done) fbuf_seek (dtp->u.p.current_unit, 0, SEEK_END); if (dtp->u.p.current_unit->flags.cc != CC_NONE) { - char * p = fbuf_alloc (dtp->u.p.current_unit, len); + char *p = fbuf_alloc (dtp->u.p.current_unit, len); if (!p) goto io_error; #ifdef HAVE_CRLF @@ -4182,7 +4182,7 @@ st_wait (st_parameter_wait *wtp __attribute__((unused))) in a linked list of namelist_info types. */ static void -set_nml_var (st_parameter_dt *dtp, void * var_addr, char * var_name, +set_nml_var (st_parameter_dt *dtp, void *var_addr, char *var_name, GFC_INTEGER_4 len, gfc_charlen_type string_length, GFC_INTEGER_4 dtype, void *dtio_sub, void *vtable) { @@ -4239,7 +4239,7 @@ extern void st_set_nml_var (st_parameter_dt *dtp, void *, char *, export_proto(st_set_nml_var); void -st_set_nml_var (st_parameter_dt *dtp, void * var_addr, char * var_name, +st_set_nml_var (st_parameter_dt *dtp, void *var_addr, char *var_name, GFC_INTEGER_4 len, gfc_charlen_type string_length, GFC_INTEGER_4 dtype) { @@ -4257,7 +4257,7 @@ export_proto(st_set_nml_dtio_var); void -st_set_nml_dtio_var (st_parameter_dt *dtp, void * var_addr, char * var_name, +st_set_nml_dtio_var (st_parameter_dt *dtp, void *var_addr, char *var_name, GFC_INTEGER_4 len, gfc_charlen_type string_length, GFC_INTEGER_4 dtype, void *dtio_sub, void *vtable) { @@ -4276,7 +4276,7 @@ st_set_nml_var_dim (st_parameter_dt *dtp, GFC_INTEGER_4 n_dim, index_type stride, index_type lbound, index_type ubound) { - namelist_info * nml; + namelist_info *nml; int n; n = (int)n_dim; @@ -4295,7 +4295,7 @@ st_set_nml_var_dim (st_parameter_dt *dtp, GFC_INTEGER_4 n_dim, 9.10.2 in F2003. */ void -hit_eof (st_parameter_dt * dtp) +hit_eof (st_parameter_dt *dtp) { dtp->u.p.current_unit->flags.position = POSITION_APPEND; diff --git a/libgfortran/io/unit.c b/libgfortran/io/unit.c index b733b939b69..bcc1e37e2e3 100644 --- a/libgfortran/io/unit.c +++ b/libgfortran/io/unit.c @@ -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) @@ -160,7 +160,7 @@ pseudo_random (void) /* rotate_left()-- Rotate the treap left */ static gfc_unit * -rotate_left (gfc_unit * t) +rotate_left (gfc_unit *t) { gfc_unit *temp; @@ -175,7 +175,7 @@ rotate_left (gfc_unit * t) /* rotate_right()-- Rotate the treap right */ static gfc_unit * -rotate_right (gfc_unit * t) +rotate_right (gfc_unit *t) { gfc_unit *temp; @@ -257,7 +257,7 @@ insert_unit (int n) /* destroy_unit_mutex()-- Destroy the mutex and free memory of unit. */ static void -destroy_unit_mutex (gfc_unit * u) +destroy_unit_mutex (gfc_unit *u) { __gthread_mutex_destroy (&u->lock); free (u); @@ -265,7 +265,7 @@ destroy_unit_mutex (gfc_unit * u) static gfc_unit * -delete_root (gfc_unit * t) +delete_root (gfc_unit *t) { gfc_unit *temp; @@ -290,12 +290,12 @@ 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) +delete_treap (gfc_unit *old, gfc_unit *t) { int c; @@ -318,15 +318,15 @@ delete_treap (gfc_unit * old, gfc_unit * t) /* delete_unit()-- Delete a unit from a tree */ static void -delete_unit (gfc_unit * old) +delete_unit (gfc_unit *old) { unit_root = delete_treap (old, unit_root); } /* 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) @@ -560,7 +560,7 @@ stash_internal_unit (st_parameter_dt *dtp) gfc_unit * get_unit (st_parameter_dt *dtp, int do_create) { - gfc_unit * unit; + gfc_unit *unit; if ((dtp->common.flags & IOPARM_DT_HAS_INTERNAL_UNIT) != 0) { @@ -852,7 +852,7 @@ close_units (void) ftruncate, returns 0 on success, -1 on failure. */ int -unit_truncate (gfc_unit * u, gfc_offset pos, st_parameter_common * common) +unit_truncate (gfc_unit *u, gfc_offset pos, st_parameter_common *common) { int ret; diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index a30153bac82..c76b427387a 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -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) @@ -260,7 +260,7 @@ fix_fd (int fd) corresponding C stream. This is bugware for mixed C-Fortran codes where the C code doesn't flush I/O before returning. */ void -flush_if_preconnected (stream * s) +flush_if_preconnected (stream *s) { int fd; @@ -287,13 +287,13 @@ than size_t as for POSIX read/write. *********************************************************************/ static int -raw_flush (unix_stream * s __attribute__ ((unused))) +raw_flush (unix_stream *s __attribute__ ((unused))) { return 0; } static ssize_t -raw_read (unix_stream * s, void * buf, ssize_t nbyte) +raw_read (unix_stream *s, void *buf, ssize_t nbyte) { /* For read we can't do I/O in a loop like raw_write does, because that will break applications that wait for interactive I/O. We @@ -308,7 +308,7 @@ raw_read (unix_stream * s, void * buf, ssize_t nbyte) } static ssize_t -raw_write (unix_stream * s, const void * buf, ssize_t nbyte) +raw_write (unix_stream *s, const void *buf, ssize_t nbyte) { ssize_t trans, bytes_left; char *buf_st; @@ -336,7 +336,7 @@ raw_write (unix_stream * s, const void * buf, ssize_t nbyte) } static gfc_offset -raw_seek (unix_stream * s, gfc_offset offset, int whence) +raw_seek (unix_stream *s, gfc_offset offset, int whence) { while (true) { @@ -348,7 +348,7 @@ raw_seek (unix_stream * s, gfc_offset offset, int whence) } static gfc_offset -raw_tell (unix_stream * s) +raw_tell (unix_stream *s) { while (true) { @@ -360,7 +360,7 @@ raw_tell (unix_stream * s) } static gfc_offset -raw_size (unix_stream * s) +raw_size (unix_stream *s) { struct stat statbuf; if (TEMP_FAILURE_RETRY (fstat (s->fd, &statbuf)) == -1) @@ -372,7 +372,7 @@ raw_size (unix_stream * s) } static int -raw_truncate (unix_stream * s, gfc_offset length) +raw_truncate (unix_stream *s, gfc_offset length) { #ifdef __MINGW32__ HANDLE h; @@ -418,7 +418,7 @@ raw_truncate (unix_stream * s, gfc_offset length) } static int -raw_close (unix_stream * s) +raw_close (unix_stream *s) { int retval; @@ -445,7 +445,7 @@ raw_close (unix_stream * s) } static int -raw_markeor (unix_stream * s __attribute__ ((unused))) +raw_markeor (unix_stream *s __attribute__ ((unused))) { return 0; } @@ -463,7 +463,7 @@ static const struct stream_vtable raw_vtable = { }; static int -raw_init (unix_stream * s) +raw_init (unix_stream *s) { s->st.vptr = &raw_vtable; @@ -480,7 +480,7 @@ reading to writing and vice versa. *********************************************************************/ static int -buf_flush (unix_stream * s) +buf_flush (unix_stream *s) { int writelen; @@ -509,7 +509,7 @@ buf_flush (unix_stream * s) } static ssize_t -buf_read (unix_stream * s, void * buf, ssize_t nbyte) +buf_read (unix_stream *s, void *buf, ssize_t nbyte) { if (s->active == 0) s->buffer_offset = s->logical_offset; @@ -580,7 +580,7 @@ buf_read (unix_stream * s, void * buf, ssize_t nbyte) } static ssize_t -buf_write (unix_stream * s, const void * buf, ssize_t nbyte) +buf_write (unix_stream *s, const void *buf, ssize_t nbyte) { if (s->ndirty == 0) s->buffer_offset = s->logical_offset; @@ -640,7 +640,7 @@ buf_write (unix_stream * s, const void * buf, ssize_t nbyte) when writing sequential unformatted. */ static int -buf_markeor (unix_stream * s) +buf_markeor (unix_stream *s) { if (s->unbuffered || s->ndirty >= BUFFER_SIZE / 2) return buf_flush (s); @@ -648,7 +648,7 @@ buf_markeor (unix_stream * s) } static gfc_offset -buf_seek (unix_stream * s, gfc_offset offset, int whence) +buf_seek (unix_stream *s, gfc_offset offset, int whence) { switch (whence) { @@ -673,19 +673,19 @@ buf_seek (unix_stream * s, gfc_offset offset, int whence) } static gfc_offset -buf_tell (unix_stream * s) +buf_tell (unix_stream *s) { return buf_seek (s, 0, SEEK_CUR); } static gfc_offset -buf_size (unix_stream * s) +buf_size (unix_stream *s) { return s->file_length; } static int -buf_truncate (unix_stream * s, gfc_offset length) +buf_truncate (unix_stream *s, gfc_offset length) { int r; @@ -698,7 +698,7 @@ buf_truncate (unix_stream * s, gfc_offset length) } static int -buf_close (unix_stream * s) +buf_close (unix_stream *s) { if (buf_flush (s) != 0) return -1; @@ -719,7 +719,7 @@ static const struct stream_vtable buf_vtable = { }; static int -buf_init (unix_stream * s) +buf_init (unix_stream *s) { s->st.vptr = &buf_vtable; @@ -739,9 +739,9 @@ buf_init (unix_stream * s) *********************************************************************/ char * -mem_alloc_r (stream * strm, int * len) +mem_alloc_r (stream *strm, int *len) { - unix_stream * s = (unix_stream *) strm; + unix_stream *s = (unix_stream *) strm; gfc_offset n; gfc_offset where = s->logical_offset; @@ -759,9 +759,9 @@ mem_alloc_r (stream * strm, int * len) char * -mem_alloc_r4 (stream * strm, int * len) +mem_alloc_r4 (stream *strm, int *len) { - unix_stream * s = (unix_stream *) strm; + unix_stream *s = (unix_stream *) strm; gfc_offset n; gfc_offset where = s->logical_offset; @@ -779,9 +779,9 @@ mem_alloc_r4 (stream * strm, int * len) char * -mem_alloc_w (stream * strm, int * len) +mem_alloc_w (stream *strm, int *len) { - unix_stream * s = (unix_stream *) strm; + unix_stream *s = (unix_stream *)strm; gfc_offset m; gfc_offset where = s->logical_offset; @@ -800,9 +800,9 @@ mem_alloc_w (stream * strm, int * len) gfc_char4_t * -mem_alloc_w4 (stream * strm, int * len) +mem_alloc_w4 (stream *strm, int *len) { - unix_stream * s = (unix_stream *) strm; + unix_stream *s = (unix_stream *)strm; gfc_offset m; gfc_offset where = s->logical_offset; gfc_char4_t *result = (gfc_char4_t *) s->buffer; @@ -823,7 +823,7 @@ mem_alloc_w4 (stream * strm, int * len) /* Stream read function for character(kind=1) internal units. */ static ssize_t -mem_read (stream * s, void * buf, ssize_t nbytes) +mem_read (stream *s, void *buf, ssize_t nbytes) { void *p; int nb = nbytes; @@ -842,7 +842,7 @@ mem_read (stream * s, void * buf, ssize_t nbytes) /* Stream read function for chracter(kind=4) internal units. */ static ssize_t -mem_read4 (stream * s, void * buf, ssize_t nbytes) +mem_read4 (stream *s, void *buf, ssize_t nbytes) { void *p; int nb = nbytes; @@ -861,7 +861,7 @@ mem_read4 (stream * s, void * buf, ssize_t nbytes) /* Stream write function for character(kind=1) internal units. */ static ssize_t -mem_write (stream * s, const void * buf, ssize_t nbytes) +mem_write (stream *s, const void *buf, ssize_t nbytes) { void *p; int nb = nbytes; @@ -880,7 +880,7 @@ mem_write (stream * s, const void * buf, ssize_t nbytes) /* Stream write function for character(kind=4) internal units. */ static ssize_t -mem_write4 (stream * s, const void * buf, ssize_t nwords) +mem_write4 (stream *s, const void *buf, ssize_t nwords) { gfc_char4_t *p; int nw = nwords; @@ -898,9 +898,9 @@ mem_write4 (stream * s, const void * buf, ssize_t nwords) static gfc_offset -mem_seek (stream * strm, gfc_offset offset, int whence) +mem_seek (stream *strm, gfc_offset offset, int whence) { - unix_stream * s = (unix_stream *) strm; + unix_stream *s = (unix_stream *)strm; switch (whence) { case SEEK_SET: @@ -935,14 +935,14 @@ mem_seek (stream * strm, gfc_offset offset, int whence) static gfc_offset -mem_tell (stream * s) +mem_tell (stream *s) { return ((unix_stream *)s)->logical_offset; } static int -mem_truncate (unix_stream * s __attribute__ ((unused)), +mem_truncate (unix_stream *s __attribute__ ((unused)), gfc_offset length __attribute__ ((unused))) { return 0; @@ -950,14 +950,14 @@ mem_truncate (unix_stream * s __attribute__ ((unused)), static int -mem_flush (unix_stream * s __attribute__ ((unused))) +mem_flush (unix_stream *s __attribute__ ((unused))) { return 0; } static int -mem_close (unix_stream * s) +mem_close (unix_stream *s) { free (s); @@ -1034,12 +1034,12 @@ open_internal4 (char *base, int length, gfc_offset offset) s->st.vptr = &mem4_vtable; - return (stream *) s; + return (stream *)s; } /* fd_to_stream()-- Given an open file descriptor, build a stream - * around it. */ + around it. */ static stream * fd_to_stream (int fd, bool unformatted) @@ -1150,7 +1150,7 @@ tempfile_open (const char *tempdir, char **fname) slash = ""; /* Take care that the template is longer in the mktemp() branch. */ - char * template = xmalloc (tempdirlen + 23); + char *template = xmalloc (tempdirlen + 23); #ifdef HAVE_MKSTEMP snprintf (template, tempdirlen + 23, "%s%sgfortrantmpXXXXXX", @@ -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,12 +1538,12 @@ input_stream (void) /* output_stream()-- Return a stream pointer to the default output stream. - * Called on initialization. */ + Called on initialization. */ stream * output_stream (void) { - stream * s; + stream *s; #if defined(HAVE_CRLF) && defined(HAVE_SETMODE) setmode (STDOUT_FILENO, O_BINARY); @@ -1555,12 +1555,12 @@ output_stream (void) /* error_stream()-- Return a stream pointer to the default error stream. - * Called on initialization. */ + Called on initialization. */ stream * error_stream (void) { - stream * s; + stream *s; #if defined(HAVE_CRLF) && defined(HAVE_SETMODE) setmode (STDERR_FILENO, O_BINARY); @@ -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) @@ -2022,15 +2022,15 @@ stream_isatty (stream *s) int stream_ttyname (stream *s __attribute__ ((unused)), - char * buf __attribute__ ((unused)), + char *buf __attribute__ ((unused)), size_t buflen __attribute__ ((unused))) { #ifdef HAVE_TTYNAME_R - return ttyname_r (((unix_stream *) s)->fd, buf, buflen); + return ttyname_r (((unix_stream *)s)->fd, buf, buflen); #elif defined HAVE_TTYNAME char *p; size_t plen; - p = ttyname (((unix_stream *) s)->fd); + p = ttyname (((unix_stream *)s)->fd); if (!p) return errno; plen = strlen (p); diff --git a/libgfortran/io/unix.h b/libgfortran/io/unix.h index 6f97d3b567d..4ac92ee7cbf 100644 --- a/libgfortran/io/unix.h +++ b/libgfortran/io/unix.h @@ -48,55 +48,55 @@ struct stream /* Inline functions for doing file I/O given a stream. */ static inline ssize_t -sread (stream * s, void * buf, ssize_t nbyte) +sread (stream *s, void *buf, ssize_t nbyte) { return s->vptr->read (s, buf, nbyte); } static inline ssize_t -swrite (stream * s, const void * buf, ssize_t nbyte) +swrite (stream *s, const void *buf, ssize_t nbyte) { return s->vptr->write (s, buf, nbyte); } static inline gfc_offset -sseek (stream * s, gfc_offset offset, int whence) +sseek (stream *s, gfc_offset offset, int whence) { return s->vptr->seek (s, offset, whence); } static inline gfc_offset -stell (stream * s) +stell (stream *s) { return s->vptr->tell (s); } static inline gfc_offset -ssize (stream * s) +ssize (stream *s) { return s->vptr->size (s); } static inline int -struncate (stream * s, gfc_offset length) +struncate (stream *s, gfc_offset length) { return s->vptr->trunc (s, length); } static inline int -sflush (stream * s) +sflush (stream *s) { return s->vptr->flush (s); } static inline int -sclose (stream * s) +sclose (stream *s) { return s->vptr->close (s); } static inline int -smarkeor (stream * s) +smarkeor (stream *s) { return s->vptr->markeor (s); } @@ -114,16 +114,16 @@ internal_proto(open_internal); extern stream *open_internal4 (char *, int, gfc_offset); internal_proto(open_internal4); -extern char * mem_alloc_w (stream *, int *); +extern char *mem_alloc_w (stream *, int *); internal_proto(mem_alloc_w); -extern char * mem_alloc_r (stream *, int *); +extern char *mem_alloc_r (stream *, int *); internal_proto(mem_alloc_r); -extern gfc_char4_t * mem_alloc_w4 (stream *, int *); +extern gfc_char4_t *mem_alloc_w4 (stream *, int *); internal_proto(mem_alloc_w4); -extern char * mem_alloc_r4 (stream *, int *); +extern char *mem_alloc_r4 (stream *, int *); internal_proto(mem_alloc_r4); extern stream *input_stream (void); diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c index af46fe8e623..8dbbb0912e3 100644 --- a/libgfortran/io/write.c +++ b/libgfortran/io/write.c @@ -863,7 +863,7 @@ write_decimal (st_parameter_dt *dtp, const fnode *f, const char *source, if (unlikely (is_char4_unit (dtp))) { - gfc_char4_t * p4 = (gfc_char4_t *) p; + gfc_char4_t *p4 = (gfc_char4_t *)p; if (nblank < 0) { memset4 (p4, '*', w); @@ -2040,8 +2040,8 @@ namelist_write_newline (st_parameter_dt *dtp) static namelist_info * -nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset, - namelist_info * base, char * base_name) +nml_write_obj (st_parameter_dt *dtp, namelist_info *obj, index_type offset, + namelist_info *base, char *base_name) { int rep_ctr; int num; @@ -2053,15 +2053,15 @@ nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset, size_t clen; index_type elem_ctr; size_t obj_name_len; - void * p; + void *p; char cup; - char * obj_name; - char * ext_name; - char * q; + char *obj_name; + char *ext_name; + char *q; size_t ext_name_len; char rep_buff[NML_DIGITS]; - namelist_info * cmp; - namelist_info * retval = obj->next; + namelist_info *cmp; + namelist_info *retval = obj->next; size_t base_name_len; size_t base_var_name_len; size_t tot_len; @@ -2156,7 +2156,7 @@ nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset, if ((elem_ctr < (nelem - 1)) && (obj->type != BT_DERIVED) && - !memcmp (p, (void*)(p + obj_size ), obj_size )) + !memcmp (p, (void *)(p + obj_size ), obj_size )) { rep_ctr++; } @@ -2393,11 +2393,11 @@ obj_loop: void namelist_write (st_parameter_dt *dtp) { - namelist_info * t1, *t2, *dummy = NULL; + namelist_info *t1, *t2, *dummy = NULL; index_type i; index_type dummy_offset = 0; char c; - char * dummy_name = NULL; + char *dummy_name = NULL; /* Set the delimiter for namelist output. */ switch (dtp->u.p.current_unit->delim_status)