c-pch.c (asm_file_startpos): Change to `long'.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Sun, 12 Jan 2003 16:44:09 +0000 (16:44 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Sun, 12 Jan 2003 16:44:09 +0000 (16:44 +0000)
* c-pch.c (asm_file_startpos): Change to `long'.
(pch_init): Use ftell, not ftello.
(c_common_write_pch): Use ftell/fseek, not ftello/fseeko.
Use `long' instead of `off_t'.
(c_common_read_pch): Likewise.
* ggc-common.c (gt_pch_save): Use long/ftell instead of
off_t/ftello.

From-SVN: r61233

gcc/ChangeLog
gcc/c-pch.c
gcc/ggc-common.c

index 1facc1c8b481cad79da0b1754e5a200f4972d284..7f04cf60572cf119fea7550abaf3f29e741fa491 100644 (file)
@@ -1,3 +1,13 @@
+2003-01-12  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * c-pch.c (asm_file_startpos): Change to `long'.
+       (pch_init): Use ftell, not ftello.
+       (c_common_write_pch): Use ftell/fseek, not ftello/fseeko.
+       Use `long' instead of `off_t'.
+       (c_common_read_pch): Likewise.
+       * ggc-common.c (gt_pch_save): Use long/ftell instead of
+       off_t/ftello.
+
 2003-01-12  Alan Modra  <amodra@bigpond.net.au>
 
        * expr.c (expand_expr <RDIV_EXPR>): Correct recursive call args.
index 616e002a8284cbeb9d4a35f1255f8c6255ddc095..13dc7631798db247ab93a7824ac7808c541546d1 100644 (file)
@@ -40,7 +40,7 @@ static const char pch_ident[8] = "gpchC010";
 static FILE *pch_outfile;
 
 extern char *asm_file_name;
-static off_t asm_file_startpos;
+static long asm_file_startpos;
 
 void
 pch_init ()
@@ -67,7 +67,7 @@ pch_init ()
          || strcmp (asm_file_name, "-") == 0)
        fatal_error ("`%s' is not a valid output file", asm_file_name);
 
-      asm_file_startpos = ftello (asm_out_file);
+      asm_file_startpos = ftell (asm_out_file);
       
       cpp_save_state (parse_in, f);
     }
@@ -77,13 +77,13 @@ void
 c_common_write_pch ()
 {
   char *buf;
-  off_t asm_file_end;
-  off_t written;
+  long asm_file_end;
+  long written;
   struct c_pch_header h;
 
   cpp_write_pch_deps (parse_in, pch_outfile);
 
-  asm_file_end = ftello (asm_out_file);
+  asm_file_end = ftell (asm_out_file);
   h.asm_size = asm_file_end - asm_file_startpos;
   
   if (fwrite (&h, sizeof (h), 1, pch_outfile) != 1)
@@ -92,12 +92,12 @@ c_common_write_pch ()
   buf = xmalloc (16384);
   fflush (asm_out_file);
 
-  if (fseeko (asm_out_file, asm_file_startpos, SEEK_SET) != 0)
+  if (fseek (asm_out_file, asm_file_startpos, SEEK_SET) != 0)
     fatal_io_error ("can't seek in %s", asm_file_name);
 
   for (written = asm_file_startpos; written < asm_file_end; )
     {
-      off_t size = asm_file_end - written;
+      long size = asm_file_end - written;
       if (size > 16384)
        size = 16384;
       if (fread (buf, size, 1, asm_out_file) != 1)
@@ -203,7 +203,7 @@ c_common_read_pch (pfile, name, fd, orig_name)
   buf = xmalloc (16384);
   for (written = 0; written < h.asm_size; )
     {
-      off_t size = h.asm_size - written;
+      long size = h.asm_size - written;
       if (size > 16384)
        size = 16384;
       if (fread (buf, size, 1, f) != 1
index ed6d3b45a851313dc914cb0adf2b37bde3a0e385..e9c2f020668e95a8f1d912aaebfbe4ecf8fbd8ec 100644 (file)
@@ -495,9 +495,9 @@ gt_pch_save (f)
   
   /* Pad the PCH file so that the mmaped area starts on a page boundary.  */
   {
-    off_t o;
-    o = ftello (state.f) + sizeof (mmi);
-    if (o == (off_t) -1)
+    long o;
+    o = ftell (state.f) + sizeof (mmi);
+    if (o == -1)
       fatal_io_error ("can't get position in PCH file");
     mmi.offset = page_size - o % page_size;
     if (mmi.offset == page_size)