Commit e403d80d by Kaveh R. Ghazi Committed by Kaveh Ghazi

dfe.c (s_rdfe, s_wdfe): Wrap parentheses around assignment used as truth value.

	* libI77/dfe.c (s_rdfe, s_wdfe): Wrap parentheses around
	assignment used as truth value.
	* libI77/due.c (s_rdue, s_wdue): Likewise.
	* libI77/endfile.c (f_end): Likewise.
	* libI77/iio.c (s_rsfi, s_wsfi): Likewise.
	* libI77/lread.c (ERR, l_C, nmL_getc, s_rsle): Likewise.
	* libI77/lwrite.c (l_g, l_put): Likewise.
	* libI77/open.c (f_open): Likewise.
	* libI77/rdfmt.c (rd_Z): Likewise.
	* libI77/rsfe.c (s_rsfe): Likewise.
	* libI77/rsne.c (hash, mk_hashtab, nl_init, getname, getdimen,
	x_rsne, s_rsne): Likewise.
	* libI77/sue.c (s_rsue, s_wsue): Likewise.
	* libI77/wref.c (wrt_E, wrt_F): Likewise.
	* libI77/wsfe.c (s_wsfe): Likewise.
	* libI77/wsle.c (s_wsle): Likewise.
	* libI77/wsne.c (s_wsne): Likewise.

From-SVN: r54172
parent 9eb404a0
Sun Jun 2 10:32:35 2002 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* libI77/dfe.c (s_rdfe, s_wdfe): Wrap parentheses around
assignment used as truth value.
* libI77/due.c (s_rdue, s_wdue): Likewise.
* libI77/endfile.c (f_end): Likewise.
* libI77/iio.c (s_rsfi, s_wsfi): Likewise.
* libI77/lread.c (ERR, l_C, nmL_getc, s_rsle): Likewise.
* libI77/lwrite.c (l_g, l_put): Likewise.
* libI77/open.c (f_open): Likewise.
* libI77/rdfmt.c (rd_Z): Likewise.
* libI77/rsfe.c (s_rsfe): Likewise.
* libI77/rsne.c (hash, mk_hashtab, nl_init, getname, getdimen,
x_rsne, s_rsne): Likewise.
* libI77/sue.c (s_rsue, s_wsue): Likewise.
* libI77/wref.c (wrt_E, wrt_F): Likewise.
* libI77/wsfe.c (s_wsfe): Likewise.
* libI77/wsle.c (s_wsle): Likewise.
* libI77/wsne.c (s_wsne): Likewise.
Sun Jun 2 08:59:50 2002 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Sun Jun 2 08:59:50 2002 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* libF77/main.c (main): Avoid implicit int. * libF77/main.c (main): Avoid implicit int.
......
...@@ -101,7 +101,7 @@ s_rdfe (cilist * a) ...@@ -101,7 +101,7 @@ s_rdfe (cilist * a)
f_init (); f_init ();
f__init = 3; f__init = 3;
f__reading = 1; f__reading = 1;
if (n = c_dfe (a)) if ((n = c_dfe (a)))
return (n); return (n);
if (f__curunit->uwrt && f__nowreading (f__curunit)) if (f__curunit->uwrt && f__nowreading (f__curunit))
err (a->cierr, errno, "read start"); err (a->cierr, errno, "read start");
...@@ -124,7 +124,7 @@ s_wdfe (cilist * a) ...@@ -124,7 +124,7 @@ s_wdfe (cilist * a)
f_init (); f_init ();
f__init = 3; f__init = 3;
f__reading = 0; f__reading = 0;
if (n = c_dfe (a)) if ((n = c_dfe (a)))
return (n); return (n);
if (f__curunit->uwrt != 1 && f__nowwriting (f__curunit)) if (f__curunit->uwrt != 1 && f__nowwriting (f__curunit))
err (a->cierr, errno, "startwrt"); err (a->cierr, errno, "startwrt");
......
...@@ -37,7 +37,7 @@ s_rdue (cilist * a) ...@@ -37,7 +37,7 @@ s_rdue (cilist * a)
{ {
int n; int n;
f__reading = 1; f__reading = 1;
if (n = c_due (a)) if ((n = c_due (a)))
return (n); return (n);
if (f__curunit->uwrt && f__nowreading (f__curunit)) if (f__curunit->uwrt && f__nowreading (f__curunit))
err (a->cierr, errno, "read start"); err (a->cierr, errno, "read start");
...@@ -49,7 +49,7 @@ s_wdue (cilist * a) ...@@ -49,7 +49,7 @@ s_wdue (cilist * a)
{ {
int n; int n;
f__reading = 0; f__reading = 0;
if (n = c_due (a)) if ((n = c_due (a)))
return (n); return (n);
if (f__curunit->uwrt != 1 && f__nowwriting (f__curunit)) if (f__curunit->uwrt != 1 && f__nowwriting (f__curunit))
err (a->cierr, errno, "write start"); err (a->cierr, errno, "write start");
......
...@@ -28,7 +28,7 @@ f_end (alist * a) ...@@ -28,7 +28,7 @@ f_end (alist * a)
{ {
char nbuf[10]; char nbuf[10];
sprintf (nbuf, "fort.%ld", (long) a->aunit); 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); fclose (tf);
return (0); return (0);
} }
......
...@@ -79,7 +79,7 @@ integer ...@@ -79,7 +79,7 @@ integer
s_rsfi (icilist * a) s_rsfi (icilist * a)
{ {
int n; int n;
if (n = c_si (a)) if ((n = c_si (a)))
return (n); return (n);
f__reading = 1; f__reading = 1;
f__doed = rd_ed; f__doed = rd_ed;
...@@ -112,7 +112,7 @@ integer ...@@ -112,7 +112,7 @@ integer
s_wsfi (icilist * a) s_wsfi (icilist * a)
{ {
int n; int n;
if (n = c_si (a)) if ((n = c_si (a)))
return (n); return (n);
f__reading = 0; f__reading = 0;
f__doed = w_ed; f__doed = w_ed;
......
...@@ -99,7 +99,7 @@ flag f__lquit; ...@@ -99,7 +99,7 @@ flag f__lquit;
int f__lcount, f__ltype, nml_read; int f__lcount, f__ltype, nml_read;
char *f__lchar; char *f__lchar;
double f__lx, f__ly; double f__lx, f__ly;
#define ERR(x) if(n=(x)) {f__init &= ~2; return(n);} #define ERR(x) if((n=(x))) {f__init &= ~2; return(n);}
#define GETC(x) (x=(*l_getc)()) #define GETC(x) (x=(*l_getc)())
#define Ungetc(x,y) (*l_ungetc)(x,y) #define Ungetc(x,y) (*l_ungetc)(x,y)
...@@ -330,7 +330,7 @@ l_C (void) ...@@ -330,7 +330,7 @@ l_C (void)
Ungetc (ch, f__cf); Ungetc (ch, f__cf);
nml_save = nml_read; nml_save = nml_read;
nml_read = 0; nml_read = 0;
if (ch = l_R (1, 0)) if ((ch = l_R (1, 0)))
return ch; return ch;
if (!f__ltype) if (!f__ltype)
errfl (f__elist->cierr, 112, "no real part"); errfl (f__elist->cierr, 112, "no real part");
...@@ -343,7 +343,7 @@ l_C (void) ...@@ -343,7 +343,7 @@ l_C (void)
} }
while (iswhit (GETC (ch))); while (iswhit (GETC (ch)));
(void) Ungetc (ch, f__cf); (void) Ungetc (ch, f__cf);
if (ch = l_R (1, 0)) if ((ch = l_R (1, 0)))
return ch; return ch;
if (!f__ltype) if (!f__ltype)
errfl (f__elist->cierr, 112, "no imaginary part"); errfl (f__elist->cierr, 112, "no imaginary part");
...@@ -367,7 +367,7 @@ static int ...@@ -367,7 +367,7 @@ static int
nmL_getc (void) nmL_getc (void)
{ {
int rv; int rv;
if (rv = *nmL_next++) if ((rv = *nmL_next++))
return rv; return rv;
l_getc = nmL_getc_save; l_getc = nmL_getc_save;
l_ungetc = nmL_ungetc_save; l_ungetc = nmL_ungetc_save;
...@@ -829,7 +829,7 @@ s_rsle (cilist * a) ...@@ -829,7 +829,7 @@ s_rsle (cilist * a)
f__reading = 1; f__reading = 1;
f__external = 1; f__external = 1;
f__formatted = 1; f__formatted = 1;
if (n = c_le (a)) if ((n = c_le (a)))
return (n); return (n);
f__lioproc = l_read; f__lioproc = l_read;
f__lquit = 0; f__lquit = 0;
......
...@@ -148,7 +148,7 @@ l_g (char *buf, double n) ...@@ -148,7 +148,7 @@ l_g (char *buf, double n)
while (*++b); while (*++b);
goto f__ret; goto f__ret;
case 'E': case 'E':
for (c1 = '.', c = 'E'; *b = c1; c1 = c, c = *++b); for (c1 = '.', c = 'E'; (*b = c1); c1 = c, c = *++b);
goto f__ret; goto f__ret;
} }
} }
...@@ -163,7 +163,7 @@ l_put (register char *s) ...@@ -163,7 +163,7 @@ l_put (register char *s)
register void (*pn) (int) = f__putn; register void (*pn) (int) = f__putn;
register int c; register int c;
while (c = *s++) while ((c = *s++))
(*pn) (c); (*pn) (c);
} }
......
...@@ -239,7 +239,7 @@ f_open (olist * a) ...@@ -239,7 +239,7 @@ f_open (olist * a)
case 'r': /* Fortran 90 replace option */ case 'r': /* Fortran 90 replace option */
case 'R': case 'R':
replace: replace:
if (tf = fopen (buf, f__w_mode[0])) if ((tf = fopen (buf, f__w_mode[0])))
fclose (tf); fclose (tf);
} }
...@@ -251,9 +251,9 @@ f_open (olist * a) ...@@ -251,9 +251,9 @@ f_open (olist * a)
ufmt = 0; ufmt = 0;
if (!(tf = fopen (buf, f__w_mode[ufmt | 2]))) 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; 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->uwrt = 1;
b->urw = 2; b->urw = 2;
......
...@@ -25,10 +25,10 @@ rd_Z (Uint * n, int w, ftnlen len) ...@@ -25,10 +25,10 @@ rd_Z (Uint * n, int w, ftnlen len)
if (!hex['0']) if (!hex['0'])
{ {
s = "0123456789"; s = "0123456789";
while (ch = *s++) while ((ch = *s++))
hex[ch] = ch - '0' + 1; hex[ch] = ch - '0' + 1;
s = "ABCDEF"; s = "ABCDEF";
while (ch = *s++) while ((ch = *s++))
hex[ch] = hex[ch + 'a' - 'A'] = ch - 'A' + 11; hex[ch] = hex[ch + 'a' - 'A'] = ch - 'A' + 11;
} }
s = s0 = (char *) x; s = s0 = (char *) x;
......
...@@ -70,7 +70,7 @@ s_rsfe (cilist * a) /* start */ ...@@ -70,7 +70,7 @@ s_rsfe (cilist * a) /* start */
f__sequential = 1; f__sequential = 1;
f__formatted = 1; f__formatted = 1;
f__external = 1; f__external = 1;
if (n = c_sfe (a)) if ((n = c_sfe (a)))
return (n); return (n);
f__elist = a; f__elist = a;
f__cursor = f__recpos = 0; f__cursor = f__recpos = 0;
......
...@@ -66,7 +66,7 @@ hash (hashtab * ht, register char *s) ...@@ -66,7 +66,7 @@ hash (hashtab * ht, register char *s)
register hashentry *h; register hashentry *h;
char *s0 = s; 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; x += c;
for (h = *(zot = ht->tab + x % ht->htsize); h; h = h->next) for (h = *(zot = ht->tab + x % ht->htsize); h; h = h->next)
if (!strcmp (s0, h->name)) if (!strcmp (s0, h->name))
...@@ -83,7 +83,7 @@ mk_hashtab (Namelist * nl) ...@@ -83,7 +83,7 @@ mk_hashtab (Namelist * nl)
hashentry *he; hashentry *he;
hashtab **x, **x0, *y; 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) if (nl == y->nl)
return y; return y;
if (n_nlcache >= MAX_NL_CACHE) if (n_nlcache >= MAX_NL_CACHE)
...@@ -138,10 +138,10 @@ nl_init (void) ...@@ -138,10 +138,10 @@ nl_init (void)
register char *s; register char *s;
register int c; register int c;
for (s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; c = *s++;) for (s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; (c = *s++);)
Alpha[c] Alpha[c]
= Alphanum[c] = Alpha[c + 'a' - 'A'] = Alphanum[c + 'a' - 'A'] = 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; Alphanum[c] = c;
} }
...@@ -161,7 +161,7 @@ getname (register char *s, int slen) ...@@ -161,7 +161,7 @@ getname (register char *s, int slen)
ch = 115; ch = 115;
errfl (f__elist->cierr, ch, "namelist read"); errfl (f__elist->cierr, ch, "namelist read");
} }
while (*s = Alphanum[GETC (ch) & 0xff]) while ((*s = Alphanum[GETC (ch) & 0xff]))
if (s < se) if (s < se)
s++; s++;
if (ch == EOF) if (ch == EOF)
...@@ -209,17 +209,17 @@ getdimen (int *chp, dimen * d, ftnlen delta, ftnlen extent, ftnlen * x1) ...@@ -209,17 +209,17 @@ getdimen (int *chp, dimen * d, ftnlen delta, ftnlen extent, ftnlen * x1)
register int k; register int k;
ftnlen x2, x3; ftnlen x2, x3;
if (k = getnum (chp, x1)) if ((k = getnum (chp, x1)))
return k; return k;
x3 = 1; x3 = 1;
if (*chp == ':') if (*chp == ':')
{ {
if (k = getnum (chp, &x2)) if ((k = getnum (chp, &x2)))
return k; return k;
x2 -= *x1; x2 -= *x1;
if (*chp == ':') if (*chp == ':')
{ {
if (k = getnum (chp, &x3)) if ((k = getnum (chp, &x3)))
return k; return k;
if (!x3) if (!x3)
return 123; return 123;
...@@ -311,7 +311,7 @@ top: ...@@ -311,7 +311,7 @@ top:
#endif #endif
} }
have_amp: have_amp:
if (ch = getname (buf, sizeof (buf))) if ((ch = getname (buf, sizeof (buf))))
return ch; return ch;
nl = (Namelist *) a->cifmt; nl = (Namelist *) a->cifmt;
if (strcmp (buf, nl->name)) if (strcmp (buf, nl->name))
...@@ -371,7 +371,7 @@ have_amp: ...@@ -371,7 +371,7 @@ have_amp:
if (ch <= ' ' && ch >= 0 || ch == ',') if (ch <= ' ' && ch >= 0 || ch == ',')
continue; continue;
Ungetc (ch, f__cf); Ungetc (ch, f__cf);
if (ch = getname (buf, sizeof (buf))) if ((ch = getname (buf, sizeof (buf))))
return ch; return ch;
goto havename; goto havename;
} }
...@@ -398,7 +398,7 @@ have_amp: ...@@ -398,7 +398,7 @@ have_amp:
{ {
if (type != TYCHAR) if (type != TYCHAR)
errfl (a->cierr, 122, where); 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); errfl (a->cierr, k, where);
if (ch != ')') if (ch != ')')
errfl (a->cierr, 115, where); errfl (a->cierr, 115, where);
...@@ -414,7 +414,7 @@ have_amp: ...@@ -414,7 +414,7 @@ have_amp:
nomax = span = dims[1]; nomax = span = dims[1];
ivae = iva + size * nomax; ivae = iva + size * nomax;
colonseen = 0; colonseen = 0;
if (k = getdimen (&ch, dn, size, nomax, &b)) if ((k = getdimen (&ch, dn, size, nomax, &b)))
errfl (a->cierr, k, where); errfl (a->cierr, k, where);
no = dn->extent; no = dn->extent;
b0 = dims[2]; b0 = dims[2];
...@@ -426,7 +426,7 @@ have_amp: ...@@ -426,7 +426,7 @@ have_amp:
errfl (a->cierr, 115, where); errfl (a->cierr, 115, where);
dn1 = dn + 1; dn1 = dn + 1;
span /= *dims; 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); errfl (a->cierr, k, where);
ex *= *dims; ex *= *dims;
b += b1 * ex; b += b1 * ex;
...@@ -446,7 +446,7 @@ have_amp: ...@@ -446,7 +446,7 @@ have_amp:
dn0 = dimens; dn0 = dimens;
if (type == TYCHAR && ch == '(' /*) */ ) 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); errfl (a->cierr, k, where);
if (ch != ')') if (ch != ')')
errfl (a->cierr, 115, where); errfl (a->cierr, 115, where);
...@@ -483,7 +483,7 @@ have_amp: ...@@ -483,7 +483,7 @@ have_amp:
dn1->delta -= ex; dn1->delta -= ex;
} }
} }
else if (dims = v->dims) else if ((dims = v->dims))
{ {
no = no1 = dims[1]; no = no1 = dims[1];
ivae = iva + no * size; ivae = iva + no * size;
...@@ -506,7 +506,7 @@ have_amp: ...@@ -506,7 +506,7 @@ have_amp:
else if (iva + no1 * size > ivae) else if (iva + no1 * size > ivae)
no1 = (ivae - iva) / size; no1 = (ivae - iva) / size;
f__lquit = 0; f__lquit = 0;
if (k = l_read (&no1, vaddr + iva, size, type)) if ((k = l_read (&no1, vaddr + iva, size, type)))
return k; return k;
if (f__lquit == 1) if (f__lquit == 1)
return 0; return 0;
...@@ -518,7 +518,7 @@ have_amp: ...@@ -518,7 +518,7 @@ have_amp:
no1 = (ivae - iva) / size; no1 = (ivae - iva) / size;
if (no1 > f__lcount) if (no1 > f__lcount)
no1 = f__lcount; no1 = f__lcount;
if (k = l_read (&no1, vaddr + iva, size, type)) if ((k = l_read (&no1, vaddr + iva, size, type)))
return k; return k;
iva += no1 * dn0->delta; iva += no1 * dn0->delta;
} }
...@@ -584,7 +584,7 @@ s_rsne (cilist * a) ...@@ -584,7 +584,7 @@ s_rsne (cilist * a)
f__external = 1; f__external = 1;
l_eof = 0; l_eof = 0;
if (n = c_le (a)) if ((n = c_le (a)))
return n; return n;
if (f__curunit->uwrt && f__nowreading (f__curunit)) if (f__curunit->uwrt && f__nowreading (f__curunit))
err (a->cierr, errno, where0); err (a->cierr, errno, where0);
......
...@@ -31,7 +31,7 @@ s_rsue (cilist * a) ...@@ -31,7 +31,7 @@ s_rsue (cilist * a)
f_init (); f_init ();
f__init = 3; f__init = 3;
f__reading = 1; f__reading = 1;
if (n = c_sue (a)) if ((n = c_sue (a)))
return (n); return (n);
f__recpos = 0; f__recpos = 0;
if (f__curunit->uwrt && f__nowreading (f__curunit)) if (f__curunit->uwrt && f__nowreading (f__curunit))
...@@ -56,7 +56,7 @@ s_wsue (cilist * a) ...@@ -56,7 +56,7 @@ s_wsue (cilist * a)
if (f__init != 1) if (f__init != 1)
f_init (); f_init ();
f__init = 3; f__init = 3;
if (n = c_sue (a)) if ((n = c_sue (a)))
return (n); return (n);
f__reading = 0; f__reading = 0;
f__reclen = 0; f__reclen = 0;
......
...@@ -134,7 +134,7 @@ wrt_E (ufloat * p, int w, int d, int e, ftnlen len) ...@@ -134,7 +134,7 @@ wrt_E (ufloat * p, int w, int d, int e, ftnlen len)
#else #else
if (!e0) if (!e0)
{ {
for (s -= 2, e1 = 2; s[0] = s[1]; s++) for (s -= 2, e1 = 2; (s[0] = s[1]); s++)
#ifdef CRAY #ifdef CRAY
delta--; delta--;
if ((delta += 4) < 0) if ((delta += 4) < 0)
...@@ -233,7 +233,7 @@ wrt_F (ufloat * p, int w, int d, ftnlen len) ...@@ -233,7 +233,7 @@ wrt_F (ufloat * p, int w, int d, ftnlen len)
#endif #endif
} }
if (n = f__scale) if ((n = f__scale))
{ {
if (n > 0) if (n > 0)
do do
...@@ -298,7 +298,7 @@ wrt_F (ufloat * p, int w, int d, ftnlen len) ...@@ -298,7 +298,7 @@ wrt_F (ufloat * p, int w, int d, ftnlen len)
PUT ('-'); PUT ('-');
else if (f__cplus) else if (f__cplus)
PUT ('+'); PUT ('+');
while (n = *b++) while ((n = *b++))
PUT (n); PUT (n);
while (--d1 >= 0) while (--d1 >= 0)
PUT ('0'); PUT ('0');
......
...@@ -53,7 +53,7 @@ s_wsfe (cilist * a) /*start */ ...@@ -53,7 +53,7 @@ s_wsfe (cilist * a) /*start */
f__sequential = 1; f__sequential = 1;
f__formatted = 1; f__formatted = 1;
f__external = 1; f__external = 1;
if (n = c_sfe (a)) if ((n = c_sfe (a)))
return (n); return (n);
f__elist = a; f__elist = a;
f__hiwater = f__cursor = f__recpos = 0; f__hiwater = f__cursor = f__recpos = 0;
......
...@@ -9,7 +9,7 @@ integer ...@@ -9,7 +9,7 @@ integer
s_wsle (cilist * a) s_wsle (cilist * a)
{ {
int n; int n;
if (n = c_le (a)) if ((n = c_le (a)))
return (n); return (n);
f__reading = 0; f__reading = 0;
f__external = 1; f__external = 1;
......
...@@ -7,7 +7,7 @@ s_wsne (cilist * a) ...@@ -7,7 +7,7 @@ s_wsne (cilist * a)
{ {
int n; int n;
if (n = c_le (a)) if ((n = c_le (a)))
return (n); return (n);
f__reading = 0; f__reading = 0;
f__external = 1; f__external = 1;
......
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