aboutsummaryrefslogtreecommitdiff
path: root/libf2c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2002-06-02 14:34:31 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2002-06-02 14:34:31 +0000
commite403d80d357106f3a0b12a290e812e9a6305c1ee (patch)
treecaccf8de27b0a4a5d5413fbef03acc9c7e79ee24 /libf2c
parent9eb404a0d9f85fc6960aab441ac129dcc93dc348 (diff)
downloadgcc-e403d80d357106f3a0b12a290e812e9a6305c1ee.zip
gcc-e403d80d357106f3a0b12a290e812e9a6305c1ee.tar.gz
gcc-e403d80d357106f3a0b12a290e812e9a6305c1ee.tar.bz2
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
Diffstat (limited to 'libf2c')
-rw-r--r--libf2c/ChangeLog20
-rw-r--r--libf2c/libI77/dfe.c4
-rw-r--r--libf2c/libI77/due.c4
-rw-r--r--libf2c/libI77/endfile.c2
-rw-r--r--libf2c/libI77/iio.c4
-rw-r--r--libf2c/libI77/lread.c10
-rw-r--r--libf2c/libI77/lwrite.c4
-rw-r--r--libf2c/libI77/open.c6
-rw-r--r--libf2c/libI77/rdfmt.c4
-rw-r--r--libf2c/libI77/rsfe.c2
-rw-r--r--libf2c/libI77/rsne.c36
-rw-r--r--libf2c/libI77/sue.c4
-rw-r--r--libf2c/libI77/wref.c6
-rw-r--r--libf2c/libI77/wsfe.c2
-rw-r--r--libf2c/libI77/wsle.c2
-rw-r--r--libf2c/libI77/wsne.c2
16 files changed, 66 insertions, 46 deletions
diff --git a/libf2c/ChangeLog b/libf2c/ChangeLog
index 3d9b554..6d0499c 100644
--- a/libf2c/ChangeLog
+++ b/libf2c/ChangeLog
@@ -1,3 +1,23 @@
+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>
* libF77/main.c (main): Avoid implicit int.
diff --git a/libf2c/libI77/dfe.c b/libf2c/libI77/dfe.c
index e91bb38..5ce0b4c 100644
--- a/libf2c/libI77/dfe.c
+++ b/libf2c/libI77/dfe.c
@@ -101,7 +101,7 @@ s_rdfe (cilist * a)
f_init ();
f__init = 3;
f__reading = 1;
- if (n = c_dfe (a))
+ if ((n = c_dfe (a)))
return (n);
if (f__curunit->uwrt && f__nowreading (f__curunit))
err (a->cierr, errno, "read start");
@@ -124,7 +124,7 @@ s_wdfe (cilist * a)
f_init ();
f__init = 3;
f__reading = 0;
- if (n = c_dfe (a))
+ if ((n = c_dfe (a)))
return (n);
if (f__curunit->uwrt != 1 && f__nowwriting (f__curunit))
err (a->cierr, errno, "startwrt");
diff --git a/libf2c/libI77/due.c b/libf2c/libI77/due.c
index 310c613..7c6a801 100644
--- a/libf2c/libI77/due.c
+++ b/libf2c/libI77/due.c
@@ -37,7 +37,7 @@ s_rdue (cilist * a)
{
int n;
f__reading = 1;
- if (n = c_due (a))
+ if ((n = c_due (a)))
return (n);
if (f__curunit->uwrt && f__nowreading (f__curunit))
err (a->cierr, errno, "read start");
@@ -49,7 +49,7 @@ s_wdue (cilist * a)
{
int n;
f__reading = 0;
- if (n = c_due (a))
+ if ((n = c_due (a)))
return (n);
if (f__curunit->uwrt != 1 && f__nowwriting (f__curunit))
err (a->cierr, errno, "write start");
diff --git a/libf2c/libI77/endfile.c b/libf2c/libI77/endfile.c
index d429d2b..513f210 100644
--- a/libf2c/libI77/endfile.c
+++ b/libf2c/libI77/endfile.c
@@ -28,7 +28,7 @@ f_end (alist * a)
{
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/libf2c/libI77/iio.c b/libf2c/libI77/iio.c
index a660a38..69f2154 100644
--- a/libf2c/libI77/iio.c
+++ b/libf2c/libI77/iio.c
@@ -79,7 +79,7 @@ integer
s_rsfi (icilist * a)
{
int n;
- if (n = c_si (a))
+ if ((n = c_si (a)))
return (n);
f__reading = 1;
f__doed = rd_ed;
@@ -112,7 +112,7 @@ integer
s_wsfi (icilist * a)
{
int n;
- if (n = c_si (a))
+ if ((n = c_si (a)))
return (n);
f__reading = 0;
f__doed = w_ed;
diff --git a/libf2c/libI77/lread.c b/libf2c/libI77/lread.c
index de6257d..f8ec7dc 100644
--- a/libf2c/libI77/lread.c
+++ b/libf2c/libI77/lread.c
@@ -99,7 +99,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)) {f__init &= ~2; return(n);}
+#define ERR(x) if((n=(x))) {f__init &= ~2; return(n);}
#define GETC(x) (x=(*l_getc)())
#define Ungetc(x,y) (*l_ungetc)(x,y)
@@ -330,7 +330,7 @@ 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");
@@ -343,7 +343,7 @@ 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");
@@ -367,7 +367,7 @@ 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;
@@ -829,7 +829,7 @@ s_rsle (cilist * a)
f__reading = 1;
f__external = 1;
f__formatted = 1;
- if (n = c_le (a))
+ if ((n = c_le (a)))
return (n);
f__lioproc = l_read;
f__lquit = 0;
diff --git a/libf2c/libI77/lwrite.c b/libf2c/libI77/lwrite.c
index da4a8e9..b910ab1 100644
--- a/libf2c/libI77/lwrite.c
+++ b/libf2c/libI77/lwrite.c
@@ -148,7 +148,7 @@ l_g (char *buf, double n)
while (*++b);
goto f__ret;
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;
}
}
@@ -163,7 +163,7 @@ l_put (register char *s)
register void (*pn) (int) = f__putn;
register int c;
- while (c = *s++)
+ while ((c = *s++))
(*pn) (c);
}
diff --git a/libf2c/libI77/open.c b/libf2c/libI77/open.c
index 72816d6..29e9fde 100644
--- a/libf2c/libI77/open.c
+++ b/libf2c/libI77/open.c
@@ -239,7 +239,7 @@ f_open (olist * a)
case 'r': /* Fortran 90 replace option */
case 'R':
replace:
- if (tf = fopen (buf, f__w_mode[0]))
+ if ((tf = fopen (buf, f__w_mode[0])))
fclose (tf);
}
@@ -251,9 +251,9 @@ f_open (olist * a)
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/libf2c/libI77/rdfmt.c b/libf2c/libI77/rdfmt.c
index d5198c1..5088f71 100644
--- a/libf2c/libI77/rdfmt.c
+++ b/libf2c/libI77/rdfmt.c
@@ -25,10 +25,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;
diff --git a/libf2c/libI77/rsfe.c b/libf2c/libI77/rsfe.c
index 0faef18..0dcda39 100644
--- a/libf2c/libI77/rsfe.c
+++ b/libf2c/libI77/rsfe.c
@@ -70,7 +70,7 @@ s_rsfe (cilist * a) /* start */
f__sequential = 1;
f__formatted = 1;
f__external = 1;
- if (n = c_sfe (a))
+ if ((n = c_sfe (a)))
return (n);
f__elist = a;
f__cursor = f__recpos = 0;
diff --git a/libf2c/libI77/rsne.c b/libf2c/libI77/rsne.c
index 85834c9..4b52134 100644
--- a/libf2c/libI77/rsne.c
+++ b/libf2c/libI77/rsne.c
@@ -66,7 +66,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))
@@ -83,7 +83,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)
@@ -138,10 +138,10 @@ nl_init (void)
register char *s;
register int c;
- 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;
}
@@ -161,7 +161,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)
@@ -209,17 +209,17 @@ 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;
@@ -311,7 +311,7 @@ top:
#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))
@@ -371,7 +371,7 @@ have_amp:
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;
}
@@ -398,7 +398,7 @@ have_amp:
{
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);
@@ -414,7 +414,7 @@ have_amp:
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];
@@ -426,7 +426,7 @@ have_amp:
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;
@@ -446,7 +446,7 @@ have_amp:
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);
@@ -483,7 +483,7 @@ have_amp:
dn1->delta -= ex;
}
}
- else if (dims = v->dims)
+ else if ((dims = v->dims))
{
no = no1 = dims[1];
ivae = iva + no * size;
@@ -506,7 +506,7 @@ have_amp:
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;
@@ -518,7 +518,7 @@ have_amp:
no1 = (ivae - iva) / size;
if (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;
iva += no1 * dn0->delta;
}
@@ -584,7 +584,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/libf2c/libI77/sue.c b/libf2c/libI77/sue.c
index d4f9426..a20df66 100644
--- a/libf2c/libI77/sue.c
+++ b/libf2c/libI77/sue.c
@@ -31,7 +31,7 @@ s_rsue (cilist * a)
f_init ();
f__init = 3;
f__reading = 1;
- if (n = c_sue (a))
+ if ((n = c_sue (a)))
return (n);
f__recpos = 0;
if (f__curunit->uwrt && f__nowreading (f__curunit))
@@ -56,7 +56,7 @@ s_wsue (cilist * a)
if (f__init != 1)
f_init ();
f__init = 3;
- if (n = c_sue (a))
+ if ((n = c_sue (a)))
return (n);
f__reading = 0;
f__reclen = 0;
diff --git a/libf2c/libI77/wref.c b/libf2c/libI77/wref.c
index 284bf9d..f3c490c 100644
--- a/libf2c/libI77/wref.c
+++ b/libf2c/libI77/wref.c
@@ -134,7 +134,7 @@ wrt_E (ufloat * p, int w, int d, int e, ftnlen len)
#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)
@@ -233,7 +233,7 @@ wrt_F (ufloat * p, int w, int d, ftnlen len)
#endif
}
- if (n = f__scale)
+ if ((n = f__scale))
{
if (n > 0)
do
@@ -298,7 +298,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/libf2c/libI77/wsfe.c b/libf2c/libI77/wsfe.c
index 2c71957..46f7a8f 100644
--- a/libf2c/libI77/wsfe.c
+++ b/libf2c/libI77/wsfe.c
@@ -53,7 +53,7 @@ s_wsfe (cilist * a) /*start */
f__sequential = 1;
f__formatted = 1;
f__external = 1;
- if (n = c_sfe (a))
+ if ((n = c_sfe (a)))
return (n);
f__elist = a;
f__hiwater = f__cursor = f__recpos = 0;
diff --git a/libf2c/libI77/wsle.c b/libf2c/libI77/wsle.c
index b418707..e9ef172 100644
--- a/libf2c/libI77/wsle.c
+++ b/libf2c/libI77/wsle.c
@@ -9,7 +9,7 @@ integer
s_wsle (cilist * a)
{
int n;
- if (n = c_le (a))
+ if ((n = c_le (a)))
return (n);
f__reading = 0;
f__external = 1;
diff --git a/libf2c/libI77/wsne.c b/libf2c/libI77/wsne.c
index 8211ca7..bcf0826 100644
--- a/libf2c/libI77/wsne.c
+++ b/libf2c/libI77/wsne.c
@@ -7,7 +7,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;