Drop old K&R style function declarations

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/24/head
Michele Calgaro 1 month ago
parent 9f8bda51db
commit 4dabefbee0
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -1,15 +1,9 @@
#include "stdio.h" #include "stdio.h"
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern VOID sig_die();
int abort_()
#else
extern void sig_die(char*,int); extern void sig_die(char*,int);
int abort_(void) int abort_(void)
#endif
{ {
sig_die("Fortran abort routine called", 1); sig_die("Fortran abort routine called", 1);
return 0; /* not reached */ return 0; /* not reached */

@ -1,8 +1,5 @@
#include "f2c.h" #include "f2c.h"
#include "fio.h" #include "fio.h"
#ifdef KR_headers
integer f_clos(a) cllist *a;
#else
#undef abs #undef abs
#undef min #undef min
#undef max #undef max
@ -24,7 +21,6 @@ extern int unlink(const char*);
#endif #endif
integer f_clos(cllist *a) integer f_clos(cllist *a)
#endif
{ unit *b; { unit *b;
if(a->cunit >= MXUNIT) return(0); if(a->cunit >= MXUNIT) return(0);
@ -62,12 +58,7 @@ integer f_clos(cllist *a)
b->ufnm=NULL; b->ufnm=NULL;
return(0); return(0);
} }
void void f_exit(void)
#ifdef KR_headers
f_exit()
#else
f_exit(void)
#endif
{ int i; { int i;
static cllist xx; static cllist xx;
if (!xx.cerr) { if (!xx.cerr) {
@ -80,12 +71,7 @@ f_exit(void)
} }
} }
} }
int int flush_(void)
#ifdef KR_headers
flush_()
#else
flush_(void)
#endif
{ int i; { int i;
for(i=0;i<MXUNIT;i++) for(i=0;i<MXUNIT;i++)
if(f__units[i].ufd != NULL && f__units[i].uwrt) if(f__units[i].ufd != NULL && f__units[i].uwrt)

@ -1,24 +1,15 @@
#include "f2c.h" #include "f2c.h"
#include "fio.h" #include "fio.h"
#ifdef KR_headers
extern char *strcpy();
extern FILE *tmpfile();
#else
#undef abs #undef abs
#undef min #undef min
#undef max #undef max
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#endif
extern char *f__r_mode[], *f__w_mode[]; extern char *f__r_mode[], *f__w_mode[];
#ifdef KR_headers
integer f_end(a) alist *a;
#else
integer f_end(alist *a) integer f_end(alist *a)
#endif
{ {
unit *b; unit *b;
FILE *tf; FILE *tf;
@ -36,12 +27,7 @@ integer f_end(alist *a)
return(b->useek ? t_runc(a) : 0); return(b->useek ? t_runc(a) : 0);
} }
static int static int copy(FILE *from, long len, FILE *to)
#ifdef KR_headers
copy(from, len, to) FILE *from, *to; long len;
#else
copy(FILE *from, long len, FILE *to)
#endif
{ {
int len1; int len1;
char buf[BUFSIZ]; char buf[BUFSIZ];
@ -55,12 +41,7 @@ copy(FILE *from, long len, FILE *to)
return 0; return 0;
} }
int int t_runc(alist *a)
#ifdef KR_headers
t_runc(a) alist *a;
#else
t_runc(alist *a)
#endif
{ {
long loc, len; long loc, len;
unit *b; unit *b;

@ -5,14 +5,10 @@
#include "sys/stat.h" #include "sys/stat.h"
#endif #endif
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern char *malloc();
#else
#undef abs #undef abs
#undef min #undef min
#undef max #undef max
#include "stdlib.h" #include "stdlib.h"
#endif
#include "fio.h" #include "fio.h"
#include "fmt.h" /* for struct syl */ #include "fmt.h" /* for struct syl */
@ -25,17 +21,10 @@ flag f__reading; /*1 if reading, 0 if writing*/
flag f__cplus,f__cblank; flag f__cplus,f__cblank;
char *f__fmtbuf; char *f__fmtbuf;
flag f__external; /*1 if external io, 0 if internal */ flag f__external; /*1 if external io, 0 if internal */
#ifdef KR_headers
int (*f__doed)(),(*f__doned)();
int (*f__doend)(),(*f__donewrec)(),(*f__dorevert)();
int (*f__getn)(); /* for formatted input */
void (*f__putn)(); /* for formatted output */
#else
int (*f__getn)(void); /* for formatted input */ int (*f__getn)(void); /* for formatted input */
void (*f__putn)(int); /* for formatted output */ void (*f__putn)(int); /* for formatted output */
int (*f__doed)(struct syl*, char*, ftnlen),(*f__doned)(struct syl*); int (*f__doed)(struct syl*, char*, ftnlen),(*f__doned)(struct syl*);
int (*f__dorevert)(void),(*f__donewrec)(void),(*f__doend)(void); int (*f__dorevert)(void),(*f__donewrec)(void),(*f__doend)(void);
#endif
flag f__sequential; /*1 if sequential io, 0 if direct*/ flag f__sequential; /*1 if sequential io, 0 if direct*/
flag f__formatted; /*1 if formatted io, 0 if unformatted*/ flag f__formatted; /*1 if formatted io, 0 if unformatted*/
FILE *f__cf; /*current file*/ FILE *f__cf; /*current file*/
@ -81,11 +70,7 @@ char *F_err[] =
}; };
#define MAXERR (sizeof(F_err)/sizeof(char *)+100) #define MAXERR (sizeof(F_err)/sizeof(char *)+100)
#ifdef KR_headers
int f__canseek(f) FILE *f; /*SYSDEP*/
#else
int f__canseek(FILE *f) /*SYSDEP*/ int f__canseek(FILE *f) /*SYSDEP*/
#endif
{ {
#ifdef NON_UNIX_STDIO #ifdef NON_UNIX_STDIO
return !isatty(fileno(f)); return !isatty(fileno(f));
@ -135,12 +120,7 @@ int f__canseek(FILE *f) /*SYSDEP*/
#endif #endif
} }
void void f__fatal(int n, char *s)
#ifdef KR_headers
f__fatal(n,s) char *s;
#else
f__fatal(int n, char *s)
#endif
{ {
if(n<100 && n>=0) perror(s); /*SYSDEP*/ if(n<100 && n>=0) perror(s); /*SYSDEP*/
else if(n >= (int)MAXERR || n < -1) else if(n >= (int)MAXERR || n < -1)
@ -187,11 +167,7 @@ f_init(Void)
p->uwrt=1; p->uwrt=1;
} }
#ifdef KR_headers
int f__nowreading(x) unit *x;
#else
int f__nowreading(unit *x) int f__nowreading(unit *x)
#endif
{ {
long loc; long loc;
int ufmt, urw; int ufmt, urw;
@ -219,11 +195,7 @@ int f__nowreading(unit *x)
return 0; return 0;
} }
#ifdef KR_headers
int f__nowwriting(x) unit *x;
#else
int f__nowwriting(unit *x) int f__nowwriting(unit *x)
#endif
{ {
long loc; long loc;
int ufmt; int ufmt;
@ -258,12 +230,7 @@ int f__nowwriting(unit *x)
return 0; return 0;
} }
int int err__fl(int f, int m, char *s)
#ifdef KR_headers
err__fl(f, m, s) int f, m; char *s;
#else
err__fl(int f, int m, char *s)
#endif
{ {
if (!f) if (!f)
f__fatal(m, s); f__fatal(m, s);

@ -45,16 +45,6 @@ extern flag f__init;
extern cilist *f__elist; /*active external io list*/ extern cilist *f__elist; /*active external io list*/
extern flag f__reading,f__external,f__sequential,f__formatted; extern flag f__reading,f__external,f__sequential,f__formatted;
#undef Void #undef Void
#ifdef KR_headers
#define Void /*void*/
extern int (*f__getn)(); /* for formatted input */
extern void (*f__putn)(); /* for formatted output */
extern void x_putc();
extern long f__inode();
extern VOID sig_die();
extern int (*f__donewrec)(), t_putc(), x_wSL();
extern int c_sfe(), err__fl(), xrd_SL(), f__putbuf();
#else
#define Void void #define Void void
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -80,7 +70,6 @@ extern int f__putbuf(int);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif
extern int (*f__doend)(Void); extern int (*f__doend)(Void);
extern FILE *f__cf; /*current file*/ extern FILE *f__cf; /*current file*/
extern unit *f__curunit; /*current unit*/ extern unit *f__curunit; /*current unit*/

@ -21,12 +21,7 @@ extern flag f__cblank,f__cplus; /*blanks in I and compulsory plus*/
static struct syl f__syl[SYLMX]; static struct syl f__syl[SYLMX];
int f__parenlvl,f__pc,f__revloc; int f__parenlvl,f__pc,f__revloc;
static static char *ap_end(char *s)
#ifdef KR_headers
char *ap_end(s) char *s;
#else
char *ap_end(char *s)
#endif
{ char quote; { char quote;
quote= *s++; quote= *s++;
for(;*s;s++) for(;*s;s++)
@ -41,12 +36,7 @@ char *ap_end(char *s)
/*NOTREACHED*/ return 0; /*NOTREACHED*/ return 0;
} }
static static int op_gen(int a, int b, int c, int d)
#ifdef KR_headers
int op_gen(a,b,c,d)
#else
int op_gen(int a, int b, int c, int d)
#endif
{ struct syl *p= &f__syl[f__pc]; { struct syl *p= &f__syl[f__pc];
if(f__pc>=SYLMX) if(f__pc>=SYLMX)
{ fprintf(stderr,"format too complicated:\n"); { fprintf(stderr,"format too complicated:\n");
@ -59,13 +49,8 @@ int op_gen(int a, int b, int c, int d)
return(f__pc++); return(f__pc++);
} }
#ifdef KR_headers
static char *f_list();
static char *gt_num(s,n,n1) char *s; int *n, n1;
#else
static char *f_list(char*); static char *f_list(char*);
static char *gt_num(char *s, int *n, int n1) static char *gt_num(char *s, int *n, int n1)
#endif
{ int m=0,f__cnt=0; { int m=0,f__cnt=0;
char c; char c;
for(c= *s;;c = *s) for(c= *s;;c = *s)
@ -87,12 +72,7 @@ static char *gt_num(char *s, int *n, int n1)
return(s); return(s);
} }
static static char *f_s(char *s, int curloc)
#ifdef KR_headers
char *f_s(s,curloc) char *s;
#else
char *f_s(char *s, int curloc)
#endif
{ {
skip(s); skip(s);
if(*s++!='(') if(*s++!='(')
@ -109,12 +89,7 @@ char *f_s(char *s, int curloc)
return(s); return(s);
} }
static static int ne_d(char *s, char **p)
#ifdef KR_headers
int ne_d(s,p) char *s,**p;
#else
int ne_d(char *s, char **p)
#endif
{ int n,x,sign=0; { int n,x,sign=0;
struct syl *sp; struct syl *sp;
switch(*s) switch(*s)
@ -201,12 +176,7 @@ int ne_d(char *s, char **p)
return(1); return(1);
} }
static static int e_d(char *s, char **p)
#ifdef KR_headers
int e_d(s,p) char *s,**p;
#else
int e_d(char *s, char **p)
#endif
{ int i,im,n,w,d,e,found=0,x=0; { int i,im,n,w,d,e,found=0,x=0;
char *sv=s; char *sv=s;
s=gt_num(s,&n,1); s=gt_num(s,&n,1);
@ -321,12 +291,7 @@ int e_d(char *s, char **p)
return(1); return(1);
} }
static static char *i_tem(char *s)
#ifdef KR_headers
char *i_tem(s) char *s;
#else
char *i_tem(char *s)
#endif
{ char *t; { char *t;
int n,curloc; int n,curloc;
if(*s==')') return(s); if(*s==')') return(s);
@ -337,12 +302,7 @@ char *i_tem(char *s)
return(f_s(s,curloc)); return(f_s(s,curloc));
} }
static static char *f_list(char *s)
#ifdef KR_headers
char *f_list(s) char *s;
#else
char *f_list(char *s)
#endif
{ {
for(;*s!=0;) for(;*s!=0;)
{ skip(s); { skip(s);
@ -362,11 +322,7 @@ char *f_list(char *s)
return(NULL); return(NULL);
} }
#ifdef KR_headers
int pars_f(s) char *s;
#else
int pars_f(char *s) int pars_f(char *s)
#endif
{ {
f__parenlvl=f__revloc=f__pc=0; f__parenlvl=f__revloc=f__pc=0;
if(f_s(s,0) == NULL) if(f_s(s,0) == NULL)
@ -380,12 +336,7 @@ int pars_f(char *s)
int f__cnt[STKSZ],f__ret[STKSZ],f__cp,f__rp; int f__cnt[STKSZ],f__ret[STKSZ],f__cp,f__rp;
flag f__workdone, f__nonl; flag f__workdone, f__nonl;
static static int type_f(int n)
#ifdef KR_headers
int type_f(n)
#else
int type_f(int n)
#endif
{ {
switch(n) switch(n)
{ {
@ -414,11 +365,7 @@ int type_f(int n)
} }
} }
#ifdef KR_headers
integer do_fio(number,ptr,len) ftnint *number; ftnlen len; char *ptr;
#else
integer do_fio(ftnint *number, char *ptr, ftnlen len) integer do_fio(ftnint *number, char *ptr, ftnlen len)
#endif
{ struct syl *p; { struct syl *p;
int n,i; int n,i;
for(i=0;i<*number;i++,ptr+=len) for(i=0;i<*number;i++,ptr+=len)

@ -46,21 +46,12 @@ typedef union
} ufloat; } ufloat;
typedef union typedef union
{ short is; { short is;
#ifndef KR_headers signed char ic;
signed
#endif
char ic;
integer il; integer il;
#ifdef Allow_TYQUAD #ifdef Allow_TYQUAD
longint ili; longint ili;
#endif #endif
} Uint; } Uint;
#ifdef KR_headers
extern int (*f__doed)(),(*f__doned)();
extern int (*f__dorevert)();
extern int rd_ed(),rd_ned();
extern int w_ed(),w_ned();
#else
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -76,7 +67,6 @@ extern int wrt_L(Uint*, int, ftnlen);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif
extern flag f__cblank,f__cplus,f__workdone, f__nonl; extern flag f__cblank,f__cplus,f__workdone, f__nonl;
extern char *f__fmtbuf; extern char *f__fmtbuf;
extern int f__scale; extern int f__scale;
@ -93,8 +83,4 @@ extern int f__cursor;
#define TYQUAD 14 #define TYQUAD 14
#endif #endif
#ifdef KR_headers
extern char *f__icvt();
#else
extern char *f__icvt(longint, int*, int*, int); extern char *f__icvt(longint, int*, int*, int);
#endif

@ -9,12 +9,7 @@
#define ulongint unsigned long #define ulongint unsigned long
#endif #endif
#ifdef KR_headers
char *f__icvt(value,ndigit,sign, base) longint value; int *ndigit,*sign;
int base;
#else
char *f__icvt(longint value, int *ndigit, int *sign, int base) char *f__icvt(longint value, int *ndigit, int *sign, int base)
#endif
{ {
static char buf[MAXINTLENGTH+1]; static char buf[MAXINTLENGTH+1];
int i; int i;

@ -9,20 +9,12 @@
#endif #endif
#endif #endif
#ifdef KR_headers
extern char *malloc();
#ifdef NON_ANSI_STDIO
extern char *mktemp();
#endif
extern integer f_clos();
#else
#undef abs #undef abs
#undef min #undef min
#undef max #undef max
#include "stdlib.h" #include "stdlib.h"
extern int f__canseek(FILE*); extern int f__canseek(FILE*);
extern integer f_clos(cllist*); extern integer f_clos(cllist*);
#endif
#ifdef NON_ANSI_RW_MODES #ifdef NON_ANSI_RW_MODES
char *f__r_mode[2] = {"r", "r"}; char *f__r_mode[2] = {"r", "r"};
@ -32,15 +24,10 @@ char *f__r_mode[2] = {"rb", "r"};
char *f__w_mode[4] = {"wb", "w", "r+b", "r+"}; char *f__w_mode[4] = {"wb", "w", "r+b", "r+"};
#endif #endif
static char f__buf0[400], *f__buf = f__buf0; static char f__buf0[400], *f__buf = f__buf0;
int f__buflen = (int)sizeof(f__buf0); int f__buflen = (int)sizeof(f__buf0);
static void static void f__bufadj(int n, int c)
#ifdef KR_headers
f__bufadj(n, c) int n, c;
#else
f__bufadj(int n, int c)
#endif
{ {
unsigned int len; unsigned int len;
char *nbuf, *s, *t, *te; char *nbuf, *s, *t, *te;
@ -62,12 +49,7 @@ f__bufadj(int n, int c)
f__buf = nbuf; f__buf = nbuf;
} }
int int f__putbuf(int c)
#ifdef KR_headers
f__putbuf(c) int c;
#else
f__putbuf(int c)
#endif
{ {
char *s, *se; char *s, *se;
int n; int n;
@ -92,12 +74,7 @@ f__putbuf(int c)
return 0; return 0;
} }
void void x_putc(int c)
#ifdef KR_headers
x_putc(c)
#else
x_putc(int c)
#endif
{ {
if (f__recpos >= f__buflen) if (f__recpos >= f__buflen)
f__bufadj(f__recpos, f__buflen); f__bufadj(f__recpos, f__buflen);
@ -106,12 +83,7 @@ x_putc(int c)
#define opnerr(f,m,s) {if(f) errno= m; else opn_err(m,s,a); return(m);} #define opnerr(f,m,s) {if(f) errno= m; else opn_err(m,s,a); return(m);}
static void static void opn_err(int m, char *s, olist *a)
#ifdef KR_headers
opn_err(m, s, a) int m; char *s; olist *a;
#else
opn_err(int m, char *s, olist *a)
#endif
{ {
if (a->ofnm) { if (a->ofnm) {
/* supply file name to error message */ /* supply file name to error message */
@ -122,11 +94,7 @@ opn_err(int m, char *s, olist *a)
f__fatal(m, s); f__fatal(m, s);
} }
#ifdef KR_headers
integer f_open(a) olist *a;
#else
integer f_open(olist *a) integer f_open(olist *a)
#endif
{ unit *b; { unit *b;
integer rv; integer rv;
char buf[256], *s; char buf[256], *s;
@ -270,11 +238,8 @@ integer f_open(olist *a)
opnerr(a->oerr,129,"open"); opnerr(a->oerr,129,"open");
return(0); return(0);
} }
#ifdef KR_headers
int fk_open(seq,fmt,n) ftnint n;
#else
int fk_open(int seq, int fmt, ftnint n) int fk_open(int seq, int fmt, ftnint n)
#endif
{ char nbuf[10]; { char nbuf[10];
olist a; olist a;
(void) sprintf(nbuf,"fort.%ld",(long)n); (void) sprintf(nbuf,"fort.%ld",(long)n);

@ -2,11 +2,7 @@
/* compare two strings */ /* compare two strings */
#ifdef KR_headers
integer s_cmp(a0, b0, la, lb) char *a0, *b0; ftnlen la, lb;
#else
integer s_cmp(char *a0, char *b0, ftnlen la, ftnlen lb) integer s_cmp(char *a0, char *b0, ftnlen la, ftnlen lb)
#endif
{ {
unsigned char *a, *aend, *b, *bend; unsigned char *a, *aend, *b, *bend;
a = (unsigned char *)a0; a = (unsigned char *)a0;

@ -8,11 +8,7 @@
/* assign strings: a = b */ /* assign strings: a = b */
#ifdef KR_headers
VOID s_copy(a, b, la, lb) char *a, *b; ftnlen la, lb;
#else
void s_copy(char *a, char *b, ftnlen la, ftnlen lb) void s_copy(char *a, char *b, ftnlen la, ftnlen lb)
#endif
{ {
char *aend, *bend; char *aend, *bend;

@ -1,10 +1,6 @@
#include "stdio.h" #include "stdio.h"
#include "f2c.h" #include "f2c.h"
#ifdef KR_headers
extern void f_exit();
VOID s_stop(s, n) char *s; ftnlen n;
#else
#undef abs #undef abs
#undef min #undef min
#undef max #undef max
@ -15,7 +11,6 @@ extern "C" {
void f_exit(void); void f_exit(void);
int s_stop(char *s, ftnlen n) int s_stop(char *s, ftnlen n)
#endif
{ {
int i; int i;

@ -11,11 +11,7 @@ integer e_rsfe(Void)
return(n); return(n);
} }
#ifdef KR_headers
int c_sfe(a) cilist *a; /* check */
#else
int c_sfe(cilist *a) /* check */ int c_sfe(cilist *a) /* check */
#endif
{ unit *p; { unit *p;
f__curunit = p = &f__units[a->ciunit]; f__curunit = p = &f__units[a->ciunit];
if(a->ciunit >= MXUNIT || a->ciunit<0) if(a->ciunit >= MXUNIT || a->ciunit<0)

@ -7,9 +7,6 @@
#endif #endif
#endif #endif
#ifdef KR_headers
void sig_die(s, kill) char *s; int kill;
#else
#include "stdlib.h" #include "stdlib.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -17,7 +14,6 @@ extern "C" {
extern void f_exit(void); extern void f_exit(void);
void sig_die(char *s, int kill) void sig_die(char *s, int kill)
#endif
{ {
/* print error message, then clear buffers */ /* print error message, then clear buffers */
fprintf(stderr, "%s\n", s); fprintf(stderr, "%s\n", s);

@ -7,12 +7,7 @@
#include "f2c.h" #include "f2c.h"
#include "fio.h" #include "fio.h"
VOID void g_char(char *a, ftnlen alen, char *b)
#ifdef KR_headers
g_char(a,alen,b) char *a,*b; ftnlen alen;
#else
g_char(char *a, ftnlen alen, char *b)
#endif
{ {
char *x = a + alen, *y = b + alen; char *x = a + alen, *y = b + alen;
@ -29,22 +24,13 @@ g_char(char *a, ftnlen alen, char *b)
while(x-- > a); while(x-- > a);
} }
VOID void b_char(char *a, char *b, ftnlen blen)
#ifdef KR_headers
b_char(a,b,blen) char *a,*b; ftnlen blen;
#else
b_char(char *a, char *b, ftnlen blen)
#endif
{ int i; { int i;
for(i=0;i<blen && *a!=0;i++) *b++= *a++; for(i=0;i<blen && *a!=0;i++) *b++= *a++;
for(;i<blen;i++) *b++=' '; for(;i<blen;i++) *b++=' ';
} }
#ifndef NON_UNIX_STDIO #ifndef NON_UNIX_STDIO
#ifdef KR_headers
long f__inode(a, dev) char *a; int *dev;
#else
long f__inode(char *a, int *dev) long f__inode(char *a, int *dev)
#endif
{ struct stat x; { struct stat x;
if(stat(a,&x)<0) return(-1); if(stat(a,&x)<0) return(-1);
*dev = x.st_dev; *dev = x.st_dev;

@ -1,13 +1,11 @@
#include "f2c.h" #include "f2c.h"
#include "fio.h" #include "fio.h"
#ifndef KR_headers
#undef abs #undef abs
#undef min #undef min
#undef max #undef max
#include "stdlib.h" #include "stdlib.h"
#include "string.h" #include "string.h"
#endif
#include "fmt.h" #include "fmt.h"
#include "fp.h" #include "fp.h"
@ -15,11 +13,7 @@
#include "ctype.h" #include "ctype.h"
#endif #endif
#ifdef KR_headers
int wrt_E(p,w,d,e,len) ufloat *p; ftnlen len;
#else
int wrt_E(ufloat *p, int w, int d, int e, ftnlen len) int wrt_E(ufloat *p, int w, int d, int e, ftnlen len)
#endif
{ {
char buf[FMAX+EXPMAXDIGS+4], *s, *se; char buf[FMAX+EXPMAXDIGS+4], *s, *se;
int d1, delta, e1, i, sign, signspace; int d1, delta, e1, i, sign, signspace;
@ -191,11 +185,7 @@ nogood:
return 0; return 0;
} }
#ifdef KR_headers
int wrt_F(p,w,d,len) ufloat *p; ftnlen len;
#else
int wrt_F(ufloat *p, int w, int d, ftnlen len) int wrt_F(ufloat *p, int w, int d, ftnlen len)
#endif
{ {
int d1, sign, n; int d1, sign, n;
double x; double x;

@ -64,12 +64,7 @@ mv_cur(Void) /* shouldn't use fseek because it insists on calling fflush */
return(0); return(0);
} }
static int static int wrt_Z(Uint *n, int w, int minlen, ftnlen len)
#ifdef KR_headers
wrt_Z(n,w,minlen,len) Uint *n; int w, minlen; ftnlen len;
#else
wrt_Z(Uint *n, int w, int minlen, ftnlen len)
#endif
{ {
char *s, *se; char *s, *se;
int i, w1; int i, w1;
@ -119,12 +114,7 @@ wrt_Z(Uint *n, int w, int minlen, ftnlen len)
return 0; return 0;
} }
static int static int wrt_I(Uint *n, int w, ftnlen len, int base)
#ifdef KR_headers
wrt_I(n,w,len, base) Uint *n; ftnlen len; int base;
#else
wrt_I(Uint *n, int w, ftnlen len, int base)
#endif
{ int ndigit,sign,spare,i; { int ndigit,sign,spare,i;
longint x; longint x;
char *ans; char *ans;
@ -147,12 +137,8 @@ wrt_I(Uint *n, int w, ftnlen len, int base)
} }
return(0); return(0);
} }
static int
#ifdef KR_headers static int wrt_IM(Uint *n, int w, int m, ftnlen len, int base)
wrt_IM(n,w,m,len,base) Uint *n; ftnlen len; int base;
#else
wrt_IM(Uint *n, int w, int m, ftnlen len, int base)
#endif
{ int ndigit,sign,spare,i,xsign; { int ndigit,sign,spare,i,xsign;
longint x; longint x;
char *ans; char *ans;
@ -184,12 +170,8 @@ wrt_IM(Uint *n, int w, int m, ftnlen len, int base)
for(i=0;i<ndigit;i++) (*f__putn)(*ans++); for(i=0;i<ndigit;i++) (*f__putn)(*ans++);
return(0); return(0);
} }
static int
#ifdef KR_headers static int wrt_AP(char *s)
wrt_AP(s) char *s;
#else
wrt_AP(char *s)
#endif
{ char quote; { char quote;
int i; int i;
@ -203,12 +185,8 @@ wrt_AP(char *s)
} }
return(1); return(1);
} }
static int
#ifdef KR_headers static int wrt_H(int a, char *s)
wrt_H(a,s) char *s;
#else
wrt_H(int a, char *s)
#endif
{ {
int i; int i;
@ -217,11 +195,8 @@ wrt_H(int a, char *s)
while(a--) (*f__putn)(*s++); while(a--) (*f__putn)(*s++);
return(1); return(1);
} }
#ifdef KR_headers
int wrt_L(n,len, sz) Uint *n; ftnlen sz;
#else
int wrt_L(Uint *n, int len, ftnlen sz) int wrt_L(Uint *n, int len, ftnlen sz)
#endif
{ int i; { int i;
long x; long x;
if(sizeof(long)==sz) x=n->il; if(sizeof(long)==sz) x=n->il;
@ -233,22 +208,14 @@ int wrt_L(Uint *n, int len, ftnlen sz)
else (*f__putn)('F'); else (*f__putn)('F');
return(0); return(0);
} }
static int
#ifdef KR_headers static int wrt_A(char *p, ftnlen len)
wrt_A(p,len) char *p; ftnlen len;
#else
wrt_A(char *p, ftnlen len)
#endif
{ {
while(len-- > 0) (*f__putn)(*p++); while(len-- > 0) (*f__putn)(*p++);
return(0); return(0);
} }
static int
#ifdef KR_headers static int wrt_AW(char * p, int w, ftnlen len)
wrt_AW(p,w,len) char * p; ftnlen len;
#else
wrt_AW(char * p, int w, ftnlen len)
#endif
{ {
while(w>len) while(w>len)
{ w--; { w--;
@ -259,12 +226,7 @@ wrt_AW(char * p, int w, ftnlen len)
return(0); return(0);
} }
static int static int wrt_G(ufloat *p, int w, int d, int e, ftnlen len)
#ifdef KR_headers
wrt_G(p,w,d,e,len) ufloat *p; ftnlen len;
#else
wrt_G(ufloat *p, int w, int d, int e, ftnlen len)
#endif
{ double up = 1,x; { double up = 1,x;
int i=0,oldscale,n,j; int i=0,oldscale,n,j;
x = len==sizeof(real)?p->pf:p->pd; x = len==sizeof(real)?p->pf:p->pd;
@ -289,11 +251,8 @@ wrt_G(ufloat *p, int w, int d, int e, ftnlen len)
} }
return(wrt_E(p,w,d,e,len)); return(wrt_E(p,w,d,e,len));
} }
#ifdef KR_headers
int w_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len;
#else
int w_ed(struct syl *p, char *ptr, ftnlen len) int w_ed(struct syl *p, char *ptr, ftnlen len)
#endif
{ {
int i; int i;
@ -335,11 +294,8 @@ int w_ed(struct syl *p, char *ptr, ftnlen len)
return(wrt_Z((Uint *)ptr,p->p1,p->p2.i[0],len)); return(wrt_Z((Uint *)ptr,p->p1,p->p2.i[0],len));
} }
} }
#ifdef KR_headers
int w_ned(p) struct syl *p;
#else
int w_ned(struct syl *p) int w_ned(struct syl *p)
#endif
{ {
switch(p->op) switch(p->op)
{ {

@ -39,11 +39,7 @@ xw_rev(Void)
return n; return n;
} }
#ifdef KR_headers
integer s_wsfe(a) cilist *a; /*start*/
#else
integer s_wsfe(cilist *a) /*start*/ integer s_wsfe(cilist *a) /*start*/
#endif
{ int n; { int n;
if(!f__init) f_init(); if(!f__init) f_init();
f__reading=0; f__reading=0;

Loading…
Cancel
Save