summaryrefslogtreecommitdiffstats
path: root/gcc/cppfiles.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-18 14:54:35 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-18 14:54:35 +0000
commit871af18deb15ae88c72a8a978284813cd8db0231 (patch)
treebf4861c84f50c41cdf1c064033be8e3af0f9aa4e /gcc/cppfiles.c
parentb3b67b7c9289a06fb681ce2264335e5a891366a5 (diff)
downloadppe42-gcc-871af18deb15ae88c72a8a978284813cd8db0231.tar.gz
ppe42-gcc-871af18deb15ae88c72a8a978284813cd8db0231.zip
1999-04-18 17:46 -0400 Zack Weinberg <zack@rabi.columbia.edu>
* cppfiles.c (find_position, read_and_prescan): Use `unsigned long' variables consistently to count line and column numbers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26539 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppfiles.c')
-rw-r--r--gcc/cppfiles.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index 6fd240787fd..e2305c6ad6c 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -764,10 +764,10 @@ static void
find_position (start, limit, linep, colp)
U_CHAR *start;
U_CHAR *limit;
- long *linep;
- long *colp;
+ unsigned long *linep;
+ unsigned long *colp;
{
- long line = *linep, col = 0;
+ unsigned long line = *linep, col = 0;
while (start < limit)
{
U_CHAR ch = *start++;
@@ -818,7 +818,8 @@ read_and_prescan (pfile, fp, desc, len)
U_CHAR *buf = (U_CHAR *) xmalloc (len);
U_CHAR *ip, *op, *line_base;
U_CHAR *ibase;
- unsigned int line, deferred_newlines;
+ unsigned long line;
+ unsigned int deferred_newlines;
int count;
size_t offset;
/* PIPE_BUF bytes of buffer proper, 2 to detect running off the end
@@ -1014,7 +1015,7 @@ read_and_prescan (pfile, fp, desc, len)
if (CPP_OPTIONS (pfile)->warn_trigraphs)
{
- long col;
+ unsigned long col;
find_position (line_base, op, &line, &col);
line_base = op - col;
cpp_warning_with_line (pfile, line, col,
@@ -1066,7 +1067,7 @@ read_and_prescan (pfile, fp, desc, len)
if (op[-1] != '\n')
{
- long col;
+ unsigned long col;
find_position (line_base, op, &line, &col);
cpp_warning_with_line (pfile, line, col, "no newline at end of file\n");
if (offset + 1 > len)
OpenPOWER on IntegriCloud