diff options
author | Brooks Moses <brooks.moses@codesourcery.com> | 2006-11-15 03:52:03 +0000 |
---|---|---|
committer | Brooks Moses <brooks@gcc.gnu.org> | 2006-11-14 19:52:03 -0800 |
commit | 1dde868307b85e9be0f93c6e0483b4eb818ef3cf (patch) | |
tree | 48bf955c5a301ae0a43b653d35cd27e7c36b6821 /gcc/fortran/scanner.c | |
parent | 4887aa7174404d3fa35104ffba53ad4dc613b474 (diff) | |
download | gcc-1dde868307b85e9be0f93c6e0483b4eb818ef3cf.zip gcc-1dde868307b85e9be0f93c6e0483b4eb818ef3cf.tar.gz gcc-1dde868307b85e9be0f93c6e0483b4eb818ef3cf.tar.bz2 |
gfortran.h (GFC_MAX_LINE): Remove constant definition.
* 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.
From-SVN: r118842
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 b054904..92ee366 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); } |