aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-04-11 08:29:34 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-04-11 08:29:34 +0000
commit3a2b2c7a2062986f770f9860da7499850a5539cf (patch)
tree93c98a7c646d78b47d835793796c2fccda85d151 /gcc/cpphash.c
parent6d8c68df389affd52c1bee1f5d7da04b423dfc7b (diff)
downloadgcc-3a2b2c7a2062986f770f9860da7499850a5539cf.zip
gcc-3a2b2c7a2062986f770f9860da7499850a5539cf.tar.gz
gcc-3a2b2c7a2062986f770f9860da7499850a5539cf.tar.bz2
cppexp.c, [...]: Replace cpp_token with cpp_ttype everywhere.
* cppexp.c, cpphash.c, cpphash.h, cpplex.c, cpplib.c, cpplib.h, cppmain.c, fix-header.c, scan-decls.c: Replace cpp_token with cpp_ttype everywhere. * cpperror.c, cpphash.c, cpplex.c, cpplib.c, scan-decls.c: Replace cpp_buf_line_and_col with CPP_BUF_LINE and/or CPP_BUF_COL. Line and column numbers are unsigned int, not long. * cpplex.c (cpp_buf_line_and_col): Delete. * cpplib.h (struct cpp_buffer, struct cpp_reader): Change 'long lineno' to 'unsigned int lineno'. (CPP_BUF_LINE, CPP_BUF_COL): New macros. From-SVN: r33076
Diffstat (limited to 'gcc/cpphash.c')
-rw-r--r--gcc/cpphash.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/gcc/cpphash.c b/gcc/cpphash.c
index c4cf5f4..e9d20b3 100644
--- a/gcc/cpphash.c
+++ b/gcc/cpphash.c
@@ -41,7 +41,7 @@ static void push_macro_expansion PARAMS ((cpp_reader *,
U_CHAR *, int, HASHNODE *));
static int unsafe_chars PARAMS ((cpp_reader *, int, int));
static int macro_cleanup PARAMS ((cpp_buffer *, cpp_reader *));
-static enum cpp_token macarg PARAMS ((cpp_reader *, int));
+static enum cpp_ttype macarg PARAMS ((cpp_reader *, int));
static void special_symbol PARAMS ((HASHNODE *, cpp_reader *));
/* Initial hash table size. (It can grow if necessary - see hashtab.c.) */
@@ -287,7 +287,7 @@ collect_expansion (pfile, arglist)
{
DEFINITION *defn;
struct reflist *pat = 0, *endpat = 0;
- enum cpp_token token;
+ enum cpp_ttype token;
long start, here, last;
int i;
int argc;
@@ -569,7 +569,7 @@ collect_formal_parameters (pfile)
int len;
int argc = 0;
int i;
- enum cpp_token token;
+ enum cpp_ttype token;
long old_written;
old_written = CPP_WRITTEN (pfile);
@@ -718,11 +718,12 @@ _cpp_create_definition (pfile, funlike)
int funlike;
{
struct arglist *args = 0;
- long line, col;
+ unsigned int line, col;
const char *file;
DEFINITION *defn;
- cpp_buf_line_and_col (CPP_BUFFER (pfile), &line, &col);
+ line = CPP_BUF_LINE (CPP_BUFFER (pfile));
+ col = CPP_BUF_COL (CPP_BUFFER (pfile));
file = CPP_BUFFER (pfile)->nominal_fname;
if (funlike)
@@ -748,13 +749,13 @@ _cpp_create_definition (pfile, funlike)
* Return nonzero to indicate a syntax error.
*/
-static enum cpp_token
+static enum cpp_ttype
macarg (pfile, rest_args)
cpp_reader *pfile;
int rest_args;
{
int paren = 0;
- enum cpp_token token;
+ enum cpp_ttype token;
/* Try to parse as much of the argument as exists at this
input stack level. */
@@ -908,15 +909,11 @@ special_symbol (hp, pfile)
return;
case T_SPECLINE:
- {
- long line;
- cpp_buf_line_and_col (cpp_file_buffer (pfile), &line, NULL);
-
- CPP_RESERVE (pfile, 10);
- sprintf (CPP_PWRITTEN (pfile), "%ld", line);
- CPP_ADJUST_WRITTEN (pfile, strlen (CPP_PWRITTEN (pfile)));
- return;
- }
+ ip = cpp_file_buffer (pfile);
+ CPP_RESERVE (pfile, 10);
+ sprintf (CPP_PWRITTEN (pfile), "%u", CPP_BUF_LINE (pfile));
+ CPP_ADJUST_WRITTEN (pfile, strlen (CPP_PWRITTEN (pfile)));
+ return;
case T_DATE:
case T_TIME:
@@ -977,14 +974,17 @@ _cpp_macroexpand (pfile, hp)
int nargs;
DEFINITION *defn;
register U_CHAR *xbuf;
- long start_line, start_column;
+ unsigned int start_line, start_column;
+ cpp_buffer *ip;
int xbuf_len;
struct argdata *args = 0;
long old_written = CPP_WRITTEN (pfile);
int rest_args, rest_zero = 0;
register int i;
- cpp_buf_line_and_col (cpp_file_buffer (pfile), &start_line, &start_column);
+ ip = cpp_file_buffer (pfile);
+ start_line = CPP_BUF_LINE (ip);
+ start_column = CPP_BUF_COL (ip);
/* Check for and handle special symbols. */
if (hp->type != T_MACRO)
@@ -1005,7 +1005,7 @@ _cpp_macroexpand (pfile, hp)
if (nargs >= 0)
{
- enum cpp_token token;
+ enum cpp_ttype token;
args = (struct argdata *) alloca ((nargs + 1) * sizeof (struct argdata));