gcc/libf2c/libI77/sfe.c
Toon Moene 6973bf5482 configure.in: Define IEEE_COMPLEX_DIVIDE.
* libF77/configure.in: Define IEEE_COMPLEX_DIVIDE.
	* libF77/[cz]_div.c: Arrange for compilation under
	-DIEEE_COMPLEX_DIVIDE to make these routines
	avoid calling sig_die when the denominator vanishes.
	* libF77/s_rnge.c: Add casts for the case of
	sizeof(ftnint) == sizeof(int) < sizeof(long).
	* libI77/endfile.c: Set state to writing (b->uwrt = 1) when an
	endfile statement requires copying the file
	Also, supply a missing (long) cast in the sprintf call.
	* libI77/sfe.c: Add #ifdef ALWAYS_FLUSH logic, for formatted I/O.

From-SVN: r32496
2000-03-12 19:20:47 +00:00

39 lines
713 B
C

/* sequential formatted external common routines*/
#include "f2c.h"
#include "fio.h"
extern char *f__fmtbuf;
integer e_rsfe(Void)
{ int n;
f__init = 1;
n=en_fio();
f__fmtbuf=NULL;
return(n);
}
#ifdef KR_headers
c_sfe(a) cilist *a; /* check */
#else
c_sfe(cilist *a) /* check */
#endif
{ unit *p;
if(a->ciunit >= MXUNIT || a->ciunit<0)
err(a->cierr,101,"startio");
p = &f__units[a->ciunit];
if(p->ufd==NULL && fk_open(SEQ,FMT,a->ciunit)) err(a->cierr,114,"sfe");
if(!p->ufmt) err(a->cierr,102,"sfe");
return(0);
}
integer e_wsfe(Void)
{
int n;
f__init = 1;
n = en_fio();
f__fmtbuf=NULL;
#ifdef ALWAYS_FLUSH
if (!n && fflush(f__cf))
err(f__elist->cierr, errno, "write end");
#endif
return n;
}