diff options
author | brooks <brooks@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-15 03:52:03 +0000 |
---|---|---|
committer | brooks <brooks@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-11-15 03:52:03 +0000 |
commit | 40da2b01e4cc57a1cf890af8966a9fe49b748473 (patch) | |
tree | 48bf955c5a301ae0a43b653d35cd27e7c36b6821 /gcc/fortran/scanner.c | |
parent | 7259d37f5e5ba8188ae8649a4fe9c071c4b6b485 (diff) | |
download | gcc-40da2b01e4cc57a1cf890af8966a9fe49b748473.tar.gz |
* gfortran.h (GFC_MAX_LINE): Remove constant definition.
(gfc_option_t): Clarify comments.
* options.c: Set default line length limits to actual default
values, rather than flag values.
* scanner.c: Eliminate checking and handling of the
fixed/free_line_length flag values.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118842 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/scanner.c')
-rw-r--r-- | gcc/fortran/scanner.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index b05490409b1..92ee3661480 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -956,33 +956,25 @@ load_line (FILE * input, char **pbuf, int *pbuflen) int seen_printable = 0, seen_ampersand = 0; char *buffer; - /* Determine the maximum allowed line length. - The default for free-form is GFC_MAX_LINE, for fixed-form or for - unknown form it is 72. Refer to the documentation in gfc_option_t. */ + /* Determine the maximum allowed line length. */ if (gfc_current_form == FORM_FREE) - { - if (gfc_option.free_line_length == -1) - maxlen = GFC_MAX_LINE; - else - maxlen = gfc_option.free_line_length; - } + maxlen = gfc_option.free_line_length; else if (gfc_current_form == FORM_FIXED) - { - if (gfc_option.fixed_line_length == -1) - maxlen = 72; - else - maxlen = gfc_option.fixed_line_length; - } + maxlen = gfc_option.fixed_line_length; else maxlen = 72; if (*pbuf == NULL) { - /* Allocate the line buffer, storing its length into buflen. */ + /* Allocate the line buffer, storing its length into buflen. + Note that if maxlen==0, indicating that arbitrary-length lines + are allowed, the buffer will be reallocated if this length is + insufficient; since 132 characters is the length of a standard + free-form line, we use that as a starting guess. */ if (maxlen > 0) buflen = maxlen; else - buflen = GFC_MAX_LINE; + buflen = 132; *pbuf = gfc_getmem (buflen + 1); } |