Commit cf382a91 by Toon Moene Committed by Toon Moene

fio.h: Use off_t when appropriate.

2001-07-01  Toon Moene  <toon@moene.indiv.nluug.nl>
            Pedro Vazquez  <vazquez@penelope.iqm.unicamp.br>

	* libI77/fio.h: Use off_t when appropriate.
	* libI77/backspace.c (f_back): Ditto.
	* libI77/endfile.c (t_runc): Ditto.
	* libI77/err.c (f__nowreading): Ditto.
	* libI77/ftell_.c (unit_chk): Ditto.
	* libI77/sue.c (global f__recloc, s_wsue): Ditto.

Co-Authored-By: Pedro Vazquez <vazquez@penelope.iqm.unicamp.br>

From-SVN: r43670
parent e5149841
2001-07-01 Toon Moene <toon@moene.indiv.nluug.nl>
Pedro Vazquez <vazquez@penelope.iqm.unicamp.br>
* libI77/fio.h: Use off_t when appropriate.
* libI77/backspace.c (f_back): Ditto.
* libI77/endfile.c (t_runc): Ditto.
* libI77/err.c (f__nowreading): Ditto.
* libI77/ftell_.c (unit_chk): Ditto.
* libI77/sue.c (global f__recloc, s_wsue): Ditto.
2001-06-13 Toon Moene <toon@moene.indiv.nluug.nl> 2001-06-13 Toon Moene <toon@moene.indiv.nluug.nl>
* libI77/inquire.c: Include "config.h". * libI77/inquire.c: Include "config.h".
......
...@@ -8,7 +8,7 @@ integer f_back(a) alist *a; ...@@ -8,7 +8,7 @@ integer f_back(a) alist *a;
integer f_back(alist *a) integer f_back(alist *a)
#endif #endif
{ unit *b; { unit *b;
long v, w, x, y, z; off_t v, w, x, y, z;
uiolen n; uiolen n;
FILE *f; FILE *f;
......
...@@ -70,7 +70,7 @@ t_runc(a) alist *a; ...@@ -70,7 +70,7 @@ t_runc(a) alist *a;
t_runc(alist *a) t_runc(alist *a)
#endif #endif
{ {
long loc, len; off_t loc, len;
unit *b; unit *b;
int rc; int rc;
FILE *bf; FILE *bf;
...@@ -131,10 +131,7 @@ done: ...@@ -131,10 +131,7 @@ done:
f__cf = b->ufd = bf; f__cf = b->ufd = bf;
#else /* !defined(HAVE_FTRUNCATE) */ #else /* !defined(HAVE_FTRUNCATE) */
fflush(b->ufd); fflush(b->ufd);
/* The cast of loc is helpful on FreeBSD. It helps rc = ftruncate(fileno(b->ufd), loc);
in any case where ftruncate() prototype is somehow missing
even though autoconf test found it properly. */
rc = ftruncate(fileno(b->ufd), (off_t)loc);
#endif /* !defined(HAVE_FTRUNCATE) */ #endif /* !defined(HAVE_FTRUNCATE) */
if (rc) if (rc)
err(a->aerr,111,"endfile"); err(a->aerr,111,"endfile");
......
...@@ -210,7 +210,7 @@ f__nowreading(x) unit *x; ...@@ -210,7 +210,7 @@ f__nowreading(x) unit *x;
f__nowreading(unit *x) f__nowreading(unit *x)
#endif #endif
{ {
long loc; off_t loc;
int ufmt, urw; int ufmt, urw;
extern char *f__r_mode[], *f__w_mode[]; extern char *f__r_mode[], *f__w_mode[];
......
...@@ -34,7 +34,7 @@ typedef struct ...@@ -34,7 +34,7 @@ typedef struct
long uinode; long uinode;
int udev; int udev;
#endif #endif
int url; /*0=sequential*/ off_t url; /*0=sequential*/
flag useek; /*true=can backspace, use dir, ...*/ flag useek; /*true=can backspace, use dir, ...*/
flag ufmt; flag ufmt;
flag urw; /* (1 for can read) | (2 for can write) */ flag urw; /* (1 for can read) | (2 for can write) */
......
...@@ -14,7 +14,7 @@ unit_chk(integer Unit, char *who) ...@@ -14,7 +14,7 @@ unit_chk(integer Unit, char *who)
return f__units[Unit].ufd; return f__units[Unit].ufd;
} }
integer off_t
#ifdef KR_headers #ifdef KR_headers
G77_ftell_0 (Unit) integer *Unit; G77_ftell_0 (Unit) integer *Unit;
#else #else
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include "f2c.h" #include "f2c.h"
#include "fio.h" #include "fio.h"
extern uiolen f__reclen; extern uiolen f__reclen;
long f__recloc; off_t f__recloc;
#ifdef KR_headers #ifdef KR_headers
c_sue(a) cilist *a; c_sue(a) cilist *a;
...@@ -67,7 +67,7 @@ integer s_wsue(cilist *a) ...@@ -67,7 +67,7 @@ integer s_wsue(cilist *a)
return(0); return(0);
} }
integer e_wsue(Void) integer e_wsue(Void)
{ long loc; { off_t loc;
f__init = 1; f__init = 1;
fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf); fwrite((char *)&f__reclen,sizeof(uiolen),1,f__cf);
#ifdef ALWAYS_FLUSH #ifdef ALWAYS_FLUSH
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment