diff options
author | jkh <jkh@FreeBSD.org> | 1996-07-12 18:57:58 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1996-07-12 18:57:58 +0000 |
commit | c4d4a99d31762beef936f34571330923e9300da9 (patch) | |
tree | c116431af8e1f042b25e0f70c63c437cf7ff8d63 /lib/libI77 | |
parent | 6657f01bfd009bbf4ec0481a17712259abf8ea77 (diff) | |
download | FreeBSD-src-c4d4a99d31762beef936f34571330923e9300da9.zip FreeBSD-src-c4d4a99d31762beef936f34571330923e9300da9.tar.gz |
General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
Diffstat (limited to 'lib/libI77')
-rw-r--r-- | lib/libI77/dfe.c | 17 | ||||
-rw-r--r-- | lib/libI77/due.c | 5 | ||||
-rw-r--r-- | lib/libI77/endfile.c | 4 | ||||
-rw-r--r-- | lib/libI77/err.c | 12 | ||||
-rw-r--r-- | lib/libI77/fio.h | 6 | ||||
-rw-r--r-- | lib/libI77/fmt.c | 22 | ||||
-rw-r--r-- | lib/libI77/iio.c | 17 | ||||
-rw-r--r-- | lib/libI77/inquire.c | 5 | ||||
-rw-r--r-- | lib/libI77/lread.c | 26 | ||||
-rw-r--r-- | lib/libI77/lwrite.c | 14 | ||||
-rw-r--r-- | lib/libI77/open.c | 15 | ||||
-rw-r--r-- | lib/libI77/rawio.h | 8 | ||||
-rw-r--r-- | lib/libI77/rdfmt.c | 16 | ||||
-rw-r--r-- | lib/libI77/rsfe.c | 9 | ||||
-rw-r--r-- | lib/libI77/rsne.c | 48 | ||||
-rw-r--r-- | lib/libI77/sfe.c | 4 | ||||
-rw-r--r-- | lib/libI77/sue.c | 8 | ||||
-rw-r--r-- | lib/libI77/uio.c | 5 | ||||
-rw-r--r-- | lib/libI77/wref.c | 14 | ||||
-rw-r--r-- | lib/libI77/wrtfmt.c | 14 | ||||
-rw-r--r-- | lib/libI77/wsfe.c | 12 | ||||
-rw-r--r-- | lib/libI77/wsle.c | 2 | ||||
-rw-r--r-- | lib/libI77/wsne.c | 2 |
23 files changed, 167 insertions, 118 deletions
diff --git a/lib/libI77/dfe.c b/lib/libI77/dfe.c index 86fbe8e..1135ffd 100644 --- a/lib/libI77/dfe.c +++ b/lib/libI77/dfe.c @@ -2,6 +2,7 @@ #include "fio.h" #include "fmt.h" +int y_rsk(Void) { if(f__curunit->uend || f__curunit->url <= f__recpos @@ -11,6 +12,8 @@ y_rsk(Void) } while(++f__recpos < f__curunit->url); return 0; } + +int y_getc(Void) { int ch; @@ -30,10 +33,10 @@ y_getc(Void) return(-1); } err(f__elist->cierr,errno,"readingd"); -#ifdef __cplusplus return 0; -#endif } + +int #ifdef KR_headers y_putc(c) #else @@ -47,6 +50,8 @@ y_putc(int c) err(f__elist->cierr,110,"dout"); return(0); } + +int y_rev(Void) { /*what about work done?*/ if(f__curunit->url==1 || f__recpos==f__curunit->url) @@ -56,6 +61,8 @@ y_rev(Void) f__recpos=0; return(0); } + +int y_err(Void) { err(f__elist->cierr, 110, "dfe"); @@ -64,6 +71,7 @@ y_err(Void) #endif } +int y_newrec(Void) { if(f__curunit->url == 1 || f__recpos == f__curunit->url) { @@ -77,6 +85,7 @@ y_newrec(Void) return(1); } +int #ifdef KR_headers c_dfe(a) cilist *a; #else @@ -108,7 +117,7 @@ integer s_rdfe(cilist *a) { int n; if(!f__init) f_init(); - if(n=c_dfe(a))return(n); + if( (n=c_dfe(a)) )return(n); f__reading=1; if(f__curunit->uwrt && f__nowreading(f__curunit)) err(a->cierr,errno,"read start"); @@ -130,7 +139,7 @@ integer s_wdfe(cilist *a) { int n; if(!f__init) f_init(); - if(n=c_dfe(a)) return(n); + if( (n=c_dfe(a)) ) return(n); f__reading=0; if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit)) err(a->cierr,errno,"startwrt"); diff --git a/lib/libI77/due.c b/lib/libI77/due.c index d5ade7a..ff9ce55 100644 --- a/lib/libI77/due.c +++ b/lib/libI77/due.c @@ -1,6 +1,7 @@ #include "f2c.h" #include "fio.h" +int #ifdef KR_headers c_due(a) cilist *a; #else @@ -30,7 +31,7 @@ integer s_rdue(cilist *a) #endif { int n; - if(n=c_due(a)) return(n); + if( (n=c_due(a)) ) return(n); f__reading=1; if(f__curunit->uwrt && f__nowreading(f__curunit)) err(a->cierr,errno,"read start"); @@ -43,7 +44,7 @@ integer s_wdue(cilist *a) #endif { int n; - if(n=c_due(a)) return(n); + if( (n=c_due(a)) ) return(n); f__reading=0; if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit)) err(a->cierr,errno,"write start"); diff --git a/lib/libI77/endfile.c b/lib/libI77/endfile.c index f5990e3..8425a29 100644 --- a/lib/libI77/endfile.c +++ b/lib/libI77/endfile.c @@ -43,7 +43,7 @@ integer f_end(alist *a) (void) sprintf(nbuf,"fort.%ld",a->aunit); #ifdef NON_UNIX_STDIO { FILE *tf; - if (tf = fopen(nbuf, f__w_mode[0])) + if ( (tf = fopen(nbuf, f__w_mode[0])) ) fclose(tf); } #else @@ -63,7 +63,7 @@ copy(from, len, to) char *from, *to; register long len; copy(FILE *from, register long len, FILE *to) #endif { - int k, len1; + int len1; char buf[BUFSIZ]; while(fread(buf, len1 = len > BUFSIZ ? BUFSIZ : (int)len, 1, from)) { diff --git a/lib/libI77/err.c b/lib/libI77/err.c index 0777159..923a667 100644 --- a/lib/libI77/err.c +++ b/lib/libI77/err.c @@ -78,9 +78,9 @@ char *F_err[] = #define MAXERR (sizeof(F_err)/sizeof(char *)+100) #ifdef KR_headers -f__canseek(f) FILE *f; /*SYSDEP*/ +int f__canseek(f) FILE *f; /*SYSDEP*/ #else -f__canseek(FILE *f) /*SYSDEP*/ +int f__canseek(FILE *f) /*SYSDEP*/ #endif { #ifdef NON_UNIX_STDIO @@ -187,9 +187,9 @@ f_init(Void) p->uwrt=1; } #ifdef KR_headers -f__nowreading(x) unit *x; +int f__nowreading(x) unit *x; #else -f__nowreading(unit *x) +int f__nowreading(unit *x) #endif { long loc; @@ -210,9 +210,9 @@ f__nowreading(unit *x) return(0); } #ifdef KR_headers -f__nowwriting(x) unit *x; +int f__nowwriting(x) unit *x; #else -f__nowwriting(unit *x) +int f__nowwriting(unit *x) #endif { long loc; diff --git a/lib/libI77/fio.h b/lib/libI77/fio.h index e8c693b..17e5593 100644 --- a/lib/libI77/fio.h +++ b/lib/libI77/fio.h @@ -80,8 +80,8 @@ extern int (*f__doend)(Void); extern FILE *f__cf; /*current file*/ extern unit *f__curunit; /*current unit*/ extern unit f__units[]; -#define err(f,m,s) {if(f) errno= m; else f__fatal(m,s); return(m);} -#define errfl(f,m,s) return err__fl((int)f,m,s) +#define err(f,m,s) {if( (f) ) errno=(m); else f__fatal((m),(s)); return((m));} +#define errfl(f,m,s) return err__fl((int)(f),(m),(s)) /*Table sizes*/ #define MXUNIT 100 @@ -99,4 +99,4 @@ extern int f__hiwater; /* so TL doesn't confuse us */ #define EXT 7 #define INT 8 -#define buf_end(x) (x->_flag & _IONBF ? x->_ptr : x->_base + BUFSIZ) +#define buf_end(x) ((x)->_flag & _IONBF ? (x)->_ptr : (x)->_base + BUFSIZ) diff --git a/lib/libI77/fmt.c b/lib/libI77/fmt.c index 12792fc..8689ef5 100644 --- a/lib/libI77/fmt.c +++ b/lib/libI77/fmt.c @@ -40,9 +40,9 @@ char *ap_end(char *s) /*NOTREACHED*/ return 0; } #ifdef KR_headers -op_gen(a,b,c,d) +int op_gen(a,b,c,d) #else -op_gen(int a, int b, int c, int d) +int op_gen(int a, int b, int c, int d) #endif { struct syl *p= &f__syl[f__pc]; if(f__pc>=SYLMX) @@ -99,9 +99,9 @@ char *f_s(char *s, int curloc) return(s); } #ifdef KR_headers -ne_d(s,p) char *s,**p; +int ne_d(s,p) char *s,**p; #else -ne_d(char *s, char **p) +int ne_d(char *s, char **p) #endif { int n,x,sign=0; struct syl *sp; @@ -185,9 +185,9 @@ ne_d(char *s, char **p) return(1); } #ifdef KR_headers -e_d(s,p) char *s,**p; +int e_d(s,p) char *s,**p; #else -e_d(char *s, char **p) +int e_d(char *s, char **p) #endif { int i,im,n,w,d,e,found=0,x=0; char *sv=s; @@ -333,9 +333,9 @@ char *f_list(char *s) } #ifdef KR_headers -pars_f(s) char *s; +int pars_f(s) char *s; #else -pars_f(char *s) +int pars_f(char *s) #endif { f__parenlvl=f__revloc=f__pc=0; @@ -350,9 +350,9 @@ int f__cnt[STKSZ],f__ret[STKSZ],f__cp,f__rp; flag f__workdone, f__nonl; #ifdef KR_headers -type_f(n) +int type_f(n) #else -type_f(int n) +int type_f(int n) #endif { switch(n) @@ -476,6 +476,8 @@ loop: switch(type_f((p= &f__syl[f__pc])->op)) } return(0); } + +int en_fio(Void) { ftnint one=1; return(do_fio(&one,(char *)NULL,(ftnint)0)); diff --git a/lib/libI77/iio.c b/lib/libI77/iio.c index 4c8eb9d..dff9e3f 100644 --- a/lib/libI77/iio.c +++ b/lib/libI77/iio.c @@ -6,6 +6,8 @@ char *f__icend; extern icilist *f__svic; int f__icnum; extern int f__hiwater; + +int z_getc(Void) { if(f__recpos++ < f__svic->icirlen) { @@ -15,9 +17,9 @@ z_getc(Void) return '\n'; } #ifdef KR_headers -z_putc(c) +int z_putc(c) #else -z_putc(int c) +int z_putc(int c) #endif { if(f__icptr >= f__icend) err(f__svic->icierr,110,"inwrite"); @@ -26,6 +28,8 @@ z_putc(int c) else err(f__svic->icierr,110,"recend"); return 0; } + +int z_rnew(Void) { f__icptr = f__svic->iciunit + (++f__icnum)*f__svic->icirlen; @@ -43,9 +47,9 @@ z_endp(Void) } #ifdef KR_headers -c_si(a) icilist *a; +int c_si(a) icilist *a; #else -c_si(icilist *a) +int c_si(icilist *a) #endif { f__elist = (cilist *)a; @@ -82,7 +86,7 @@ integer s_rsfi(a) icilist *a; integer s_rsfi(icilist *a) #endif { int n; - if(n=c_si(a)) return(n); + if( (n=c_si(a)) ) return(n); f__reading=1; f__doed=rd_ed; f__doned=rd_ned; @@ -93,6 +97,7 @@ integer s_rsfi(icilist *a) return(0); } +int z_wnew(Void) { if (f__recpos < f__hiwater) { @@ -113,7 +118,7 @@ integer s_wsfi(a) icilist *a; integer s_wsfi(icilist *a) #endif { int n; - if(n=c_si(a)) return(n); + if( (n=c_si(a)) ) return(n); f__reading=0; f__doed=w_ed; f__doned=w_ned; diff --git a/lib/libI77/inquire.c b/lib/libI77/inquire.c index ec98b22..c28e367 100644 --- a/lib/libI77/inquire.c +++ b/lib/libI77/inquire.c @@ -1,3 +1,4 @@ +#include <unistd.h> #include "f2c.h" #include "fio.h" #ifdef KR_headers @@ -53,7 +54,7 @@ integer f_inqu(inlist *a) } } if(a->inex!=NULL) - if(byfile && x != -1 || !byfile && p!=NULL) + if((byfile && x != -1) || (!byfile && p!=NULL)) *a->inex=1; else *a->inex=0; if(a->inopen!=NULL) @@ -61,7 +62,7 @@ integer f_inqu(inlist *a) else *a->inopen=(p!=NULL && p->ufd!=NULL); if(a->innum!=NULL) *a->innum= p-f__units; if(a->innamed!=NULL) - if(byfile || p!=NULL && p->ufnm!=NULL) + if(byfile || (p!=NULL && p->ufnm!=NULL)) *a->innamed=1; else *a->innamed=0; if(a->inname!=NULL) diff --git a/lib/libI77/lread.c b/lib/libI77/lread.c index c14fd5b..74f6f49 100644 --- a/lib/libI77/lread.c +++ b/lib/libI77/lread.c @@ -67,6 +67,7 @@ extern int ungetc(int, FILE*); /* for systems with a buggy stdio.h */ #endif #endif +int t_getc(Void) { int ch; if(f__curunit->uend) return(EOF); @@ -87,14 +88,14 @@ flag f__lquit; int f__lcount,f__ltype,nml_read; char *f__lchar; double f__lx,f__ly; -#define ERR(x) if(n=(x)) return(n) +#define ERR(x) if( (n=(x)) ) return(n) #define GETC(x) (x=(*l_getc)()) #define Ungetc(x,y) (*l_ungetc)(x,y) #ifdef KR_headers -l_R(poststar) int poststar; +int l_R(poststar) int poststar; #else -l_R(int poststar) +int l_R(int poststar) #endif { char s[FMAX+EXPMAXDIGS+4]; @@ -249,6 +250,7 @@ rd_count(register int ch) return f__lcount <= 0; } +int l_C(Void) { int ch, nml_save; double lz; @@ -285,7 +287,7 @@ l_C(Void) Ungetc(ch,f__cf); nml_save = nml_read; nml_read = 0; - if (ch = l_R(1)) + if ( (ch = l_R(1)) ) return ch; if (!f__ltype) errfl(f__elist->cierr,112,"no real part"); @@ -297,7 +299,7 @@ l_C(Void) } while(iswhit(GETC(ch))); (void) Ungetc(ch,f__cf); - if (ch = l_R(1)) + if ( (ch = l_R(1)) ) return ch; if (!f__ltype) errfl(f__elist->cierr,112,"no imaginary part"); @@ -311,6 +313,8 @@ l_C(Void) nml_read = nml_save; return(0); } + +int l_L(Void) { int ch; @@ -357,6 +361,8 @@ l_L(Void) return(0); } #define BUFSIZE 128 + +int l_CHAR(Void) { int ch,size,i; static char rafail[] = "realloc failure"; @@ -479,9 +485,9 @@ l_CHAR(Void) } } #ifdef KR_headers -c_le(a) cilist *a; +int c_le(a) cilist *a; #else -c_le(cilist *a) +int c_le(cilist *a) #endif { if(!f__init) @@ -499,9 +505,9 @@ c_le(cilist *a) return(0); } #ifdef KR_headers -l_read(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len; +int l_read(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len; #else -l_read(ftnint *number, char *ptr, ftnlen len, ftnint type) +int l_read(ftnint *number, char *ptr, ftnlen len, ftnint type) #endif { #define Ptr ((flex *)ptr) @@ -639,7 +645,7 @@ integer s_rsle(cilist *a) { int n; - if(n=c_le(a)) return(n); + if( (n=c_le(a)) ) return(n); f__reading=1; f__external=1; f__formatted=1; diff --git a/lib/libI77/lwrite.c b/lib/libI77/lwrite.c index 5da7dfb..0d323ec 100644 --- a/lib/libI77/lwrite.c +++ b/lib/libI77/lwrite.c @@ -14,9 +14,9 @@ donewrec(Void) } #ifdef KR_headers -t_putc(c) +int t_putc(c) #else -t_putc(int c) +int t_putc(int c) #endif { f__recpos++; @@ -141,7 +141,7 @@ l_g(char *buf, double n) switch(*b) { #ifndef WANT_LEAD_0 case '0': - while(b[0] = b[1]) + while( (b[0] = b[1]) ) b++; break; #endif @@ -166,7 +166,7 @@ l_g(char *buf, double n) while(*++b); goto f__ret; case 'E': - for(c1 = '.', c = 'E'; *b = c1; + for(c1 = '.', c = 'E'; (*b = c1); c1 = c, c = *++b); goto f__ret; } @@ -188,7 +188,7 @@ l_put(register char *s) #else register int c, (*pn)(int) = f__putn; #endif - while(c = *s++) + while( (c = *s++) ) (*pn)(c); } @@ -240,9 +240,9 @@ lwrt_C(double a, double b) PUT(')'); } #ifdef KR_headers -l_write(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len; +int l_write(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len; #else -l_write(ftnint *number, char *ptr, ftnlen len, ftnint type) +int l_write(ftnint *number, char *ptr, ftnlen len, ftnint type) #endif { #define Ptr ((flex *)ptr) diff --git a/lib/libI77/open.c b/lib/libI77/open.c index 75386b9..beb525e 100644 --- a/lib/libI77/open.c +++ b/lib/libI77/open.c @@ -1,3 +1,4 @@ +#include <unistd.h> #ifndef NON_UNIX_STDIO #include "sys/types.h" #include "sys/stat.h" @@ -28,9 +29,9 @@ char *f__w_mode[4] = {"wb", "w", "r+b", "r+"}; #endif #ifdef KR_headers -f__isdev(s) char *s; +int f__isdev(s) char *s; #else -f__isdev(char *s) +int f__isdev(char *s) #endif { #ifdef NON_UNIX_STDIO @@ -164,7 +165,7 @@ integer f_open(olist *a) case 'R': replace: #ifdef NON_UNIX_STDIO - if (tf = fopen(buf,f__w_mode[0])) + if ( (tf = fopen(buf,f__w_mode[0])) ) fclose(tf); #else (void) close(creat(buf, 0666)); @@ -187,9 +188,9 @@ integer f_open(olist *a) else { if(!(b->ufd = fopen(buf, f__r_mode[ufmt]))) { #ifdef NON_UNIX_STDIO - if (b->ufd = fopen(buf, f__w_mode[ufmt|2])) + if ( (b->ufd = fopen(buf, f__w_mode[ufmt|2])) ) b->uwrt = 2; - else if (b->ufd = fopen(buf, f__w_mode[ufmt])) + else if ( (b->ufd = fopen(buf, f__w_mode[ufmt])) ) b->uwrt = 1; else #else @@ -219,9 +220,9 @@ integer f_open(olist *a) return(0); } #ifdef KR_headers -fk_open(seq,fmt,n) ftnint n; +int fk_open(seq,fmt,n) ftnint n; #else -fk_open(int seq, int fmt, ftnint n) +int fk_open(int seq, int fmt, ftnint n) #endif { char nbuf[10]; olist a; diff --git a/lib/libI77/rawio.h b/lib/libI77/rawio.h index 59181d7..3e2c750 100644 --- a/lib/libI77/rawio.h +++ b/lib/libI77/rawio.h @@ -1,5 +1,7 @@ #ifdef KR_headers +#ifndef __FreeBSD__ extern FILE *fdopen(); +#endif #else #ifdef MSDOS #include "io.h" @@ -14,17 +16,23 @@ extern "C" { #endif #ifndef MSDOS #ifdef OPEN_DECL +#ifndef __FreeBSD__ extern int creat(const char*,int), open(const char*,int); #endif +#endif +#ifndef __FreeBSD__ extern int close(int); extern int read(int,void*,size_t), write(int,void*,size_t); extern int unlink(const char*); +#endif #ifndef _POSIX_SOURCE #ifndef NON_UNIX_STDIO +#ifndef __FreeBSD__ extern FILE *fdopen(int, const char*); #endif #endif #endif +#endif extern char *mktemp(char*); diff --git a/lib/libI77/rdfmt.c b/lib/libI77/rdfmt.c index eef745b..3878dd9 100644 --- a/lib/libI77/rdfmt.c +++ b/lib/libI77/rdfmt.c @@ -29,10 +29,10 @@ rd_Z(Uint *n, int w, ftnlen len) if (!hex['0']) { s = "0123456789"; - while(ch = *s++) + while( (ch = *s++) ) hex[ch] = ch - '0' + 1; s = "ABCDEF"; - while(ch = *s++) + while( (ch = *s++) ) hex[ch] = hex[ch + 'a' - 'A'] = ch - 'A' + 11; } s = s0 = (char *)x; @@ -61,7 +61,7 @@ rd_Z(Uint *n, int w, ftnlen len) return errno = 115; w = (int)len; w1 = s - s0; - w2 = w1+1 >> 1; + w2 = (w1+1) >> 1; t = (char *)n; if (*(char *)&one) { /* little endian */ @@ -83,7 +83,7 @@ rd_Z(Uint *n, int w, ftnlen len) t += i; } do { - *t = hex[*s0 & 0xff]-1 << 4 | hex[s0[1] & 0xff]-1; + *t = ((hex[*s0 & 0xff]-1) << 4) | (hex[s0[1] & 0xff]-1); t += i; s0 += 2; } @@ -387,9 +387,9 @@ rd_POS(char *s) return(1); } #ifdef KR_headers -rd_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len; +int rd_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len; #else -rd_ed(struct syl *p, char *ptr, ftnlen len) +int rd_ed(struct syl *p, char *ptr, ftnlen len) #endif { int ch; for(;f__cursor>0;f__cursor--) if((ch=(*f__getn)())<0) return(ch); @@ -450,9 +450,9 @@ rd_ed(struct syl *p, char *ptr, ftnlen len) return(errno); } #ifdef KR_headers -rd_ned(p) struct syl *p; +int rd_ned(p) struct syl *p; #else -rd_ned(struct syl *p) +int rd_ned(struct syl *p) #endif { switch(p->op) diff --git a/lib/libI77/rsfe.c b/lib/libI77/rsfe.c index 5ff0a33..24ecafc 100644 --- a/lib/libI77/rsfe.c +++ b/lib/libI77/rsfe.c @@ -3,6 +3,7 @@ #include "fio.h" #include "fmt.h" +int xrd_SL(Void) { int ch; if(!f__curunit->uend) @@ -14,6 +15,8 @@ xrd_SL(Void) f__cursor=f__recpos=0; return(1); } + +int x_getc(Void) { int ch; if(f__curunit->uend) return(EOF); @@ -33,11 +36,15 @@ x_getc(Void) } return(-1); } + +int x_endp(Void) { (void) xrd_SL(); return(0); } + +int x_rev(Void) { (void) xrd_SL(); @@ -50,7 +57,7 @@ integer s_rsfe(cilist *a) /* start */ #endif { int n; if(!f__init) f_init(); - if(n=c_sfe(a)) return(n); + if( (n=c_sfe(a)) ) return(n); f__reading=1; f__sequential=1; f__formatted=1; diff --git a/lib/libI77/rsne.c b/lib/libI77/rsne.c index ad7ad26..9378717 100644 --- a/lib/libI77/rsne.c +++ b/lib/libI77/rsne.c @@ -78,7 +78,7 @@ hash(hashtab *ht, register char *s) register hashentry *h; char *s0 = s; - for(x = 0; c = *s++; x = x & 0x4000 ? ((x << 1) & 0x7fff) + 1 : x << 1) + for(x = 0; (c = *s++); x = x & 0x4000 ? ((x << 1) & 0x7fff) + 1 : x << 1) x += c; for(h = *(zot = ht->tab + x % ht->htsize); h; h = h->next) if (!strcmp(s0, h->name)) @@ -99,7 +99,7 @@ mk_hashtab(Namelist *nl) hashentry *he; hashtab **x, **x0, *y; - for(x = &nl_cache; y = *x; x0 = x, x = &y->next) + for(x = &nl_cache; (y = *x); x0 = x, x = &y->next) if (nl == y->nl) return y; if (n_nlcache >= MAX_NL_CACHE) { @@ -151,13 +151,13 @@ nl_init(Void) { if(!f__init) f_init(); - for(s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; c = *s++; ) + for(s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; (c = *s++); ) Alpha[c] = Alphanum[c] = Alpha[c + 'a' - 'A'] = Alphanum[c + 'a' - 'A'] = c; - for(s = "0123456789_"; c = *s++; ) + for(s = "0123456789_"; (c = *s++); ) Alphanum[c] = c; } @@ -180,7 +180,7 @@ getname(register char *s, int slen) ch = 115; errfl(f__elist->cierr, ch, "namelist read"); } - while(*s = Alphanum[GETC(ch) & 0xff]) + while( (*s = Alphanum[GETC(ch) & 0xff]) ) if (s < se) s++; if (ch == EOF) @@ -235,15 +235,15 @@ getdimen(int *chp, dimen *d, ftnlen delta, ftnlen extent, ftnlen *x1) register int k; ftnlen x2, x3; - if (k = getnum(chp, x1)) + if ( (k = getnum(chp, x1)) ) return k; x3 = 1; if (*chp == ':') { - if (k = getnum(chp, &x2)) + if ( (k = getnum(chp, &x2)) ) return k; x2 -= *x1; if (*chp == ':') { - if (k = getnum(chp, &x3)) + if ( (k = getnum(chp, &x3)) ) return k; if (!x3) return 123; @@ -291,9 +291,9 @@ print_ne(cilist *a) static char where0[] = "namelist read start "; #ifdef KR_headers -x_rsne(a) cilist *a; +int x_rsne(a) cilist *a; #else -x_rsne(cilist *a) +int x_rsne(cilist *a) #endif { int ch, got1, k, n, nd, quote, readall; @@ -340,7 +340,7 @@ x_rsne(cilist *a) #endif } have_amp: - if (ch = getname(buf,sizeof(buf))) + if ( (ch = getname(buf,sizeof(buf))) ) return ch; nl = (Namelist *)a->cifmt; if (strcmp(buf, nl->name)) @@ -392,10 +392,10 @@ x_rsne(cilist *a) case '&': return 0; default: - if (ch <= ' ' && ch >= 0 || ch == ',') + if ((ch <= ' ' && ch >= 0) || (ch == ',')) continue; Ungetc(ch,f__cf); - if (ch = getname(buf,sizeof(buf))) + if ( (ch = getname(buf,sizeof(buf))) ) return ch; goto havename; } @@ -419,8 +419,8 @@ x_rsne(cilist *a) if (!(dims = v->dims)) { if (type != TYCHAR) errfl(a->cierr, 122, where); - if (k = getdimen(&ch, dn, (ftnlen)size, - (ftnlen)size, &b)) + if ( (k = getdimen(&ch, dn, (ftnlen)size, + (ftnlen)size, &b)) ) errfl(a->cierr, k, where); if (ch != ')') errfl(a->cierr, 115, where); @@ -436,7 +436,7 @@ x_rsne(cilist *a) nomax = span = dims[1]; ivae = iva + size*nomax; colonseen = 0; - if (k = getdimen(&ch, dn, size, nomax, &b)) + if ( (k = getdimen(&ch, dn, size, nomax, &b)) ) errfl(a->cierr, k, where); no = dn->extent; b0 = dims[2]; @@ -447,8 +447,8 @@ x_rsne(cilist *a) errfl(a->cierr, 115, where); dn1 = dn + 1; span /= *dims; - if (k = getdimen(&ch, dn1, dn->delta**dims, - span, &b1)) + if ( (k = getdimen(&ch, dn1, dn->delta**dims, + span, &b1)) ) errfl(a->cierr, k, where); ex *= *dims; b += b1*ex; @@ -467,7 +467,7 @@ x_rsne(cilist *a) no1 = 1; dn0 = dimens; if (type == TYCHAR && ch == '(' /*)*/) { - if (k = getdimen(&ch, &substr, size, size, &b)) + if ( (k = getdimen(&ch, &substr, size, size, &b)) ) errfl(a->cierr, k, where); if (ch != ')') errfl(a->cierr, 115, where); @@ -502,7 +502,7 @@ x_rsne(cilist *a) dn1->delta -= ex; } } - else if (dims = v->dims) { + else if ( (dims = v->dims) ) { no = no1 = dims[1]; ivae = iva + no*size; } @@ -522,7 +522,7 @@ x_rsne(cilist *a) else if (iva + no1*size > ivae) no1 = (ivae - iva)/size; f__lquit = 0; - if (k = l_read(&no1, vaddr + iva, size, type)) + if ( (k = l_read(&no1, vaddr + iva, size, type)) ) return k; if (f__lquit == 1) return 0; @@ -533,8 +533,8 @@ x_rsne(cilist *a) if (no1 > f__lcount) no1 = f__lcount; iva += no1 * dn0->delta; - if (k = l_read(&no1, vaddr + iva, - size, type)) + if ( (k = l_read(&no1, vaddr + iva, + size, type)) ) return k; } } @@ -594,7 +594,7 @@ s_rsne(cilist *a) f__external=1; l_eof = 0; - if(n = c_le(a)) + if( (n = c_le(a)) ) return n; if(f__curunit->uwrt && f__nowreading(f__curunit)) err(a->cierr,errno,where0); diff --git a/lib/libI77/sfe.c b/lib/libI77/sfe.c index eea9078..6fe9aa0 100644 --- a/lib/libI77/sfe.c +++ b/lib/libI77/sfe.c @@ -15,9 +15,9 @@ integer e_rsfe(Void) return(n); } #ifdef KR_headers -c_sfe(a) cilist *a; /* check */ +int c_sfe(a) cilist *a; /* check */ #else -c_sfe(cilist *a) /* check */ +int c_sfe(cilist *a) /* check */ #endif { unit *p; if(a->ciunit >= MXUNIT || a->ciunit<0) diff --git a/lib/libI77/sue.c b/lib/libI77/sue.c index b1b8bc3..a179169 100644 --- a/lib/libI77/sue.c +++ b/lib/libI77/sue.c @@ -4,9 +4,9 @@ extern uiolen f__reclen; long f__recloc; #ifdef KR_headers -c_sue(a) cilist *a; +int c_sue(a) cilist *a; #else -c_sue(cilist *a) +int c_sue(cilist *a) #endif { if(a->ciunit >= MXUNIT || a->ciunit < 0) @@ -31,7 +31,7 @@ integer s_rsue(cilist *a) int n; if(!f__init) f_init(); f__reading=1; - if(n=c_sue(a)) return(n); + if( (n=c_sue(a)) ) return(n); f__recpos=0; if(f__curunit->uwrt && f__nowreading(f__curunit)) err(a->cierr, errno, "read start"); @@ -54,7 +54,7 @@ integer s_wsue(cilist *a) { int n; if(!f__init) f_init(); - if(n=c_sue(a)) return(n); + if( (n=c_sue(a)) ) return(n); f__reading=0; f__reclen=0; if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit)) diff --git a/lib/libI77/uio.c b/lib/libI77/uio.c index e40875e..6bceb27 100644 --- a/lib/libI77/uio.c +++ b/lib/libI77/uio.c @@ -3,9 +3,9 @@ uiolen f__reclen; #ifdef KR_headers -do_us(number,ptr,len) ftnint *number; char *ptr; ftnlen len; +int do_us(number,ptr,len) ftnint *number; char *ptr; ftnlen len; #else -do_us(ftnint *number, char *ptr, ftnlen len) +int do_us(ftnint *number, char *ptr, ftnlen len) #endif { if(f__reading) @@ -23,6 +23,7 @@ do_us(ftnint *number, char *ptr, ftnlen len) (void) fwrite(ptr,(int)len,(int)(*number),f__cf); return(0); } + return (0); } #ifdef KR_headers integer do_ud(number,ptr,len) ftnint *number; char *ptr; ftnlen len; diff --git a/lib/libI77/wref.c b/lib/libI77/wref.c index eda9a8f..21485a4 100644 --- a/lib/libI77/wref.c +++ b/lib/libI77/wref.c @@ -15,9 +15,9 @@ #endif #ifdef KR_headers -wrt_E(p,w,d,e,len) ufloat *p; ftnlen len; +int wrt_E(p,w,d,e,len) ufloat *p; ftnlen len; #else -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; @@ -127,7 +127,7 @@ nogood: /* exponent field if it fits. */ #else if (!e0) { - for(s -= 2, e1 = 2; s[0] = s[1]; s++) + for(s -= 2, e1 = 2; (s[0] = s[1]); s++) #ifdef CRAY delta--; if ((delta += 4) < 0) @@ -191,9 +191,9 @@ nogood: } #ifdef KR_headers -wrt_F(p,w,d,len) ufloat *p; ftnlen len; +int wrt_F(p,w,d,len) ufloat *p; ftnlen len; #else -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; @@ -217,7 +217,7 @@ wrt_F(ufloat *p, int w, int d, ftnlen len) #endif } - if (n = f__scale) + if ( (n = f__scale) ) if (n > 0) do x *= 10.; while(--n > 0); else @@ -267,7 +267,7 @@ wrt_F(ufloat *p, int w, int d, ftnlen len) PUT('-'); else if (f__cplus) PUT('+'); - while(n = *b++) + while( (n = *b++) ) PUT(n); while(--d1 >= 0) PUT('0'); diff --git a/lib/libI77/wrtfmt.c b/lib/libI77/wrtfmt.c index 545dcb9..077db71 100644 --- a/lib/libI77/wrtfmt.c +++ b/lib/libI77/wrtfmt.c @@ -6,6 +6,8 @@ extern int f__cursor; int f__hiwater; icilist *f__svic; char *f__icptr; + +int mv_cur(Void) /* shouldn't use fseek because it insists on calling fflush */ /* instead we know too much about stdio */ { @@ -233,9 +235,9 @@ wrt_H(int a, char *s) return(1); } #ifdef KR_headers -wrt_L(n,len, sz) Uint *n; ftnlen sz; +int wrt_L(n,len, sz) Uint *n; ftnlen sz; #else -wrt_L(Uint *n, int len, ftnlen sz) +int wrt_L(Uint *n, int len, ftnlen sz) #endif { int i; long x; @@ -307,9 +309,9 @@ wrt_G(ufloat *p, int w, int d, int e, ftnlen len) return(wrt_E(p,w,d,e,len)); } #ifdef KR_headers -w_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len; +int w_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len; #else -w_ed(struct syl *p, char *ptr, ftnlen len) +int w_ed(struct syl *p, char *ptr, ftnlen len) #endif { if(f__cursor && mv_cur()) return(mv_cur()); @@ -350,9 +352,9 @@ w_ed(struct syl *p, char *ptr, ftnlen len) } } #ifdef KR_headers -w_ned(p) struct syl *p; +int w_ned(p) struct syl *p; #else -w_ned(struct syl *p) +int w_ned(struct syl *p) #endif { switch(p->op) diff --git a/lib/libI77/wsfe.c b/lib/libI77/wsfe.c index 7c7f014..d69f9af 100644 --- a/lib/libI77/wsfe.c +++ b/lib/libI77/wsfe.c @@ -5,9 +5,9 @@ extern int f__hiwater; #ifdef KR_headers -x_putc(c) +int x_putc(c) #else -x_putc(int c) +int x_putc(int c) #endif { /* this uses \n as an indicator of record-end */ @@ -27,6 +27,8 @@ x_putc(int c) #endif return putc(c,f__cf); } + +int x_wSL(Void) { (*f__putn)('\n'); @@ -35,6 +37,8 @@ x_wSL(Void) f__hiwater = 0; return(1); } + +int xw_end(Void) { if(f__nonl == 0) @@ -42,6 +46,8 @@ xw_end(Void) f__hiwater = f__recpos = f__cursor = 0; return(0); } + +int xw_rev(Void) { if(f__workdone) (*f__putn)('\n'); @@ -56,7 +62,7 @@ integer s_wsfe(cilist *a) /*start*/ #endif { int n; if(!f__init) f_init(); - if(n=c_sfe(a)) return(n); + if( (n=c_sfe(a)) ) return(n); f__reading=0; f__sequential=1; f__formatted=1; diff --git a/lib/libI77/wsle.c b/lib/libI77/wsle.c index 44b6972..1e47d5d 100644 --- a/lib/libI77/wsle.c +++ b/lib/libI77/wsle.c @@ -10,7 +10,7 @@ integer s_wsle(cilist *a) #endif { int n; - if(n=c_le(a)) return(n); + if( (n=c_le(a)) ) return(n); f__reading=0; f__external=1; f__formatted=1; diff --git a/lib/libI77/wsne.c b/lib/libI77/wsne.c index 0febd52..9b7f9b6 100644 --- a/lib/libI77/wsne.c +++ b/lib/libI77/wsne.c @@ -11,7 +11,7 @@ s_wsne(cilist *a) { int n; - if(n=c_le(a)) + if( (n=c_le(a)) ) return(n); f__reading=0; f__external=1; |