diff --git a/lib/dfe.c b/lib/dfe.c index 9b4476f..2ea78af 100644 --- a/lib/dfe.c +++ b/lib/dfe.c @@ -91,7 +91,7 @@ integer s_rdfe(cilist *a) int n; if(!f__init) f_init(); f__reading=1; - if(n=c_dfe(a))return(n); + if((n=c_dfe(a)))return(n); if(f__curunit->uwrt && f__nowreading(f__curunit)) err(a->cierr,errno,"read start"); f__getn = y_getc; @@ -110,7 +110,7 @@ integer s_wdfe(cilist *a) int n; if(!f__init) f_init(); f__reading=0; - if(n=c_dfe(a)) return(n); + if((n=c_dfe(a))) return(n); if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit)) err(a->cierr,errno,"startwrt"); f__putn = x_putc; diff --git a/lib/due.c b/lib/due.c index d42f014..133d459 100644 --- a/lib/due.c +++ b/lib/due.c @@ -27,7 +27,7 @@ integer s_rdue(cilist *a) { int n; f__reading=1; - if(n=c_due(a)) return(n); + if((n=c_due(a))) return(n); if(f__curunit->uwrt && f__nowreading(f__curunit)) err(a->cierr,errno,"read start"); return(0); @@ -37,7 +37,7 @@ integer s_wdue(cilist *a) { int n; f__reading=0; - if(n=c_due(a)) return(n); + if((n=c_due(a))) return(n); if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit)) err(a->cierr,errno,"write start"); return(0); diff --git a/lib/endfile.c b/lib/endfile.c index 63964db..fbe134c 100644 --- a/lib/endfile.c +++ b/lib/endfile.c @@ -22,7 +22,7 @@ integer f_end(alist *a) if(b->ufd==NULL) { char nbuf[10]; sprintf(nbuf,"fort.%ld",(long)a->aunit); - if (tf = fopen(nbuf, f__w_mode[0])) + if ((tf = fopen(nbuf, f__w_mode[0]))) fclose(tf); return(0); } diff --git a/lib/iio.c b/lib/iio.c index 6ef8644..a3a0211 100644 --- a/lib/iio.c +++ b/lib/iio.c @@ -70,7 +70,7 @@ static int iw_rev(void) integer s_rsfi(icilist *a) { 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; @@ -99,7 +99,7 @@ z_wnew(void) integer s_wsfi(icilist *a) { 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/inquire.c b/lib/inquire.c index e867f31..d6803a1 100644 --- a/lib/inquire.c +++ b/lib/inquire.c @@ -47,7 +47,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) @@ -55,7 +55,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/lbitbits.c b/lib/lbitbits.c index 4f2ec5e..d379718 100644 --- a/lib/lbitbits.c +++ b/lib/lbitbits.c @@ -30,11 +30,11 @@ integer lbit_cshift(integer a, integer b, integer len) full_len: if (b >= 0) { b %= F2C_LONG_BITS; - return (integer)(x << b | x >> F2C_LONG_BITS -b ); + return (integer)(x << b | x >> (F2C_LONG_BITS - b) ); } b = -b; b %= F2C_LONG_BITS; - return (integer)(x << F2C_LONG_BITS - b | x >> b); + return (integer)(x << (F2C_LONG_BITS - b) | x >> b); } y = z = (unsigned long)-1; y <<= len; @@ -43,9 +43,9 @@ integer lbit_cshift(integer a, integer b, integer len) x &= z; if (b >= 0) { b %= len; - return (integer)(y | z & (x << b | x >> len - b)); + return (integer)(y | (z & (x << b | x >> (len - b)))); } b = -b; b %= len; - return (integer)(y | z & (x >> b | x << len - b)); + return (integer)(y | (z & (x >> b | x << (len - b)))); } diff --git a/lib/lread.c b/lib/lread.c index 6e72ab5..9a9b1e8 100644 --- a/lib/lread.c +++ b/lib/lread.c @@ -87,7 +87,7 @@ 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) @@ -284,7 +284,7 @@ static int l_C(void) Ungetc(ch,f__cf); nml_save = nml_read; nml_read = 0; - if (ch = l_R(1,0)) + if ((ch = l_R(1,0))) return ch; if (!f__ltype) errfl(f__elist->cierr,112,"no real part"); @@ -296,7 +296,7 @@ static int l_C(void) } while(iswhit(GETC(ch))); (void) Ungetc(ch,f__cf); - if (ch = l_R(1,0)) + if ((ch = l_R(1,0))) return ch; if (!f__ltype) errfl(f__elist->cierr,112,"no imaginary part"); @@ -318,7 +318,7 @@ static int (*nmL_ungetc_save)(int, FILE*); static int nmL_getc(void) { int rv; - if (rv = *nmL_next++) + if ((rv = *nmL_next++)) return rv; l_getc = nmL_getc_save; l_ungetc = nmL_ungetc_save; @@ -727,7 +727,7 @@ integer s_rsle(cilist *a) f__reading=1; f__external=1; f__formatted=1; - if(n=c_le(a)) return(n); + if((n=c_le(a))) return(n); f__lioproc = l_read; f__lquit = 0; f__lcount = 0; diff --git a/lib/lwrite.c b/lib/lwrite.c index 79e7f47..3bdb9f1 100644 --- a/lib/lwrite.c +++ b/lib/lwrite.c @@ -103,7 +103,7 @@ static int 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 @@ -128,7 +128,7 @@ static int 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; } @@ -146,7 +146,7 @@ static void l_put(register char *s) #endif register int c; - while(c = *s++) + while((c = *s++)) (*pn)(c); } diff --git a/lib/open.c b/lib/open.c index c004421..8b2d838 100644 --- a/lib/open.c +++ b/lib/open.c @@ -182,7 +182,7 @@ integer f_open(olist *a) #ifndef HAVE_TMPFILE replace: #endif - if (tf = fopen(buf,f__w_mode[0])) + if ((tf = fopen(buf,f__w_mode[0]))) fclose(tf); } @@ -192,9 +192,9 @@ integer f_open(olist *a) if ((s = a->oacc) && b->url) ufmt = 0; if(!(tf = fopen(buf, f__w_mode[ufmt|2]))) { - if (tf = fopen(buf, f__r_mode[ufmt])) + if ((tf = fopen(buf, f__r_mode[ufmt]))) b->urw = 1; - else if (tf = fopen(buf, f__w_mode[ufmt])) { + else if ((tf = fopen(buf, f__w_mode[ufmt]))) { b->uwrt = 1; b->urw = 2; } diff --git a/lib/qbitbits.c b/lib/qbitbits.c index d16c313..16c6928 100644 --- a/lib/qbitbits.c +++ b/lib/qbitbits.c @@ -31,11 +31,11 @@ longint qbit_cshift(longint a, integer b, integer len) full_len: if (b >= 0) { b %= F2C_LONG_LONG_BITS; - return (longint)(x << b | x >> F2C_LONG_LONG_BITS - b ); + return (longint)(x << b | x >> (F2C_LONG_LONG_BITS - b) ); } b = -b; b %= F2C_LONG_LONG_BITS; - return (longint)(x << F2C_LONG_LONG_BITS - b | x >> b); + return (longint)(x << (F2C_LONG_LONG_BITS - b) | x >> b); } y = z = (unsigned long)-1; y <<= len; @@ -44,11 +44,11 @@ longint qbit_cshift(longint a, integer b, integer len) x &= z; if (b >= 0) { b %= len; - return (longint)(y | z & (x << b | x >> len - b)); + return (longint)(y | (z & (x << b | x >> (len - b)))); } b = -b; b %= len; - return (longint)(y | z & (x >> b | x << len - b)); + return (longint)(y | (z & (x >> b | x << (len - b)))); } #endif /* INTEGER_STAR_8 */ diff --git a/lib/rdfmt.c b/lib/rdfmt.c index 9e6566d..b247163 100644 --- a/lib/rdfmt.c +++ b/lib/rdfmt.c @@ -19,10 +19,10 @@ static int rd_Z(Uint *n, int w, ftnlen len) if (!hex['0']) { sc = "0123456789"; - while(ch = *sc++) + while((ch = *sc++)) hex[ch] = ch - '0' + 1; sc = "ABCDEF"; - while(ch = *sc++) + while((ch = *sc++)) hex[ch] = hex[ch + 'a' - 'A'] = ch - 'A' + 11; } s = s0 = (char *)x; @@ -51,7 +51,7 @@ static int 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 */ @@ -73,7 +73,7 @@ static int 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; } diff --git a/lib/rsfe.c b/lib/rsfe.c index 199c07e..c823663 100644 --- a/lib/rsfe.c +++ b/lib/rsfe.c @@ -59,7 +59,7 @@ integer s_rsfe(cilist *a) /* start */ f__sequential=1; f__formatted=1; f__external=1; - if(n=c_sfe(a)) return n; + if((n=c_sfe(a))) return n; f__elist=a; f__cursor=f__recpos=0; f__scale=0; diff --git a/lib/rsne.c b/lib/rsne.c index cc39c38..762eec3 100644 --- a/lib/rsne.c +++ b/lib/rsne.c @@ -50,7 +50,7 @@ static Vardesc * 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)) @@ -66,7 +66,7 @@ static hashtab *mk_hashtab(Namelist *nl) hashentry *he; hashtab **x, **x0 = 0, *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) { @@ -118,13 +118,13 @@ static void 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; } @@ -142,7 +142,7 @@ static int 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) @@ -186,15 +186,15 @@ static int 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; @@ -282,7 +282,7 @@ int 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)) @@ -334,10 +334,10 @@ int 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; } @@ -361,8 +361,8 @@ int 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); @@ -378,7 +378,7 @@ int 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]; @@ -389,8 +389,8 @@ int 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; @@ -409,7 +409,7 @@ int 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); @@ -444,7 +444,7 @@ int 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; } @@ -464,7 +464,7 @@ int 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; @@ -474,8 +474,8 @@ int x_rsne(cilist *a) no2 = (ivae - iva)/size; if (no2 > f__lcount) no2 = f__lcount; - if (k = l_read(&no2, vaddr + iva, - size, type)) + if ((k = l_read(&no2, vaddr + iva, + size, type))) return k; iva += no2 * dn0->delta; } @@ -531,7 +531,7 @@ integer 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/sue.c b/lib/sue.c index 04c6253..5dda8aa 100644 --- a/lib/sue.c +++ b/lib/sue.c @@ -26,7 +26,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"); @@ -46,7 +46,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/uninit.c b/lib/uninit.c index fab6752..dfe1920 100644 --- a/lib/uninit.c +++ b/lib/uninit.c @@ -32,7 +32,7 @@ static void fill_noise(unsigned char *x, size_t len) { size_t n; - for (n= len >> 2; n--; x) { + for (n= len >> 2; n--;) { *(x++) = 0xa7; *(x++) = 0xa7; *(x++) = 0xa7; diff --git a/lib/wref.c b/lib/wref.c index a3dd373..5095115 100644 --- a/lib/wref.c +++ b/lib/wref.c @@ -116,7 +116,7 @@ int wrt_E(ufloat *p, int w, int d, int e, ftnlen len) /* 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) @@ -204,7 +204,7 @@ int wrt_F(ufloat *p, int w, int d, ftnlen len) } } - if (n = f__scale) + if ((n = f__scale)) if (n > 0) do x *= 10.; while(--n > 0); else @@ -249,7 +249,7 @@ int 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/wsfe.c b/lib/wsfe.c index aa6e4a0..3353421 100644 --- a/lib/wsfe.c +++ b/lib/wsfe.c @@ -43,7 +43,7 @@ integer s_wsfe(cilist *a) /*start*/ f__sequential=1; f__formatted=1; f__external=1; - if(n=c_sfe(a)) return(n); + if((n=c_sfe(a))) return(n); f__elist=a; f__hiwater = f__cursor=f__recpos=0; f__nonl = 0; diff --git a/lib/wsle.c b/lib/wsle.c index 35deeca..58571d6 100644 --- a/lib/wsle.c +++ b/lib/wsle.c @@ -8,7 +8,7 @@ integer s_wsle(cilist *a) { 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/wsne.c b/lib/wsne.c index f0db808..a1b9c36 100644 --- a/lib/wsne.c +++ b/lib/wsne.c @@ -7,7 +7,7 @@ integer s_wsne(cilist *a) { int n; - if(n=c_le(a)) + if((n=c_le(a))) return(n); f__reading=0; f__external=1;