From ac1db652a0f9c208904e5dc831ffee202a9929e0 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Tue, 4 Jun 2002 02:24:26 +0000 Subject: [PATCH] lbitbits.c (lbit_cshift): disambiguate expressions with parentheses. * libF77/lbitbits.c (lbit_cshift): disambiguate expressions with parentheses. * libF77/qbitbits.c (qbit_cshift): Likewise. * libI77/inquire.c (f_inqu): Likewise. * libI77/rdfmt.c (rd_Z): Likewise. * libI77/rsne.c (x_rsne): Likewise. From-SVN: r54223 --- libf2c/ChangeLog | 9 +++++++++ libf2c/libF77/lbitbits.c | 8 ++++---- libf2c/libF77/qbitbits.c | 8 ++++---- libf2c/libI77/inquire.c | 4 ++-- libf2c/libI77/rdfmt.c | 4 ++-- libf2c/libI77/rsne.c | 2 +- 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/libf2c/ChangeLog b/libf2c/ChangeLog index 9e3e2a70445..7e705f1961c 100644 --- a/libf2c/ChangeLog +++ b/libf2c/ChangeLog @@ -1,3 +1,12 @@ +Mon Jun 3 22:23:03 2002 Kaveh R. Ghazi + + * libF77/lbitbits.c (lbit_cshift): disambiguate expressions + with parentheses. + * libF77/qbitbits.c (qbit_cshift): Likewise. + * libI77/inquire.c (f_inqu): Likewise. + * libI77/rdfmt.c (rd_Z): Likewise. + * libI77/rsne.c (x_rsne): Likewise. + Mon Jun 3 22:21:23 2002 Kaveh R. Ghazi * Makefile.in (s-libe77): Add WARN_CFLAGS. diff --git a/libf2c/libF77/lbitbits.c b/libf2c/libF77/lbitbits.c index 805d85848e9..3b28ae97aba 100644 --- a/libf2c/libF77/lbitbits.c +++ b/libf2c/libF77/lbitbits.c @@ -36,11 +36,11 @@ lbit_cshift (integer a, integer b, integer len) if (b >= 0) { b %= LONGBITS; - return (integer) (x << b | x >> LONGBITS - b); + return (integer) (x << b | x >> (LONGBITS - b)); } b = -b; b %= LONGBITS; - return (integer) (x << LONGBITS - b | x >> b); + return (integer) (x << (LONGBITS - b) | x >> b); } y = z = (unsigned long) -1; y <<= len; @@ -50,9 +50,9 @@ lbit_cshift (integer a, integer b, integer len) 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/libf2c/libF77/qbitbits.c b/libf2c/libF77/qbitbits.c index c2a87c24f30..f72858e7a33 100644 --- a/libf2c/libF77/qbitbits.c +++ b/libf2c/libF77/qbitbits.c @@ -40,11 +40,11 @@ qbit_cshift (longint a, integer b, integer len) if (b >= 0) { b %= LONG8BITS; - return (longint) (x << b | x >> LONG8BITS - b); + return (longint) (x << b | x >> (LONG8BITS - b)); } b = -b; b %= LONG8BITS; - return (longint) (x << LONG8BITS - b | x >> b); + return (longint) (x << (LONG8BITS - b) | x >> b); } y = z = (unsigned long) -1; y <<= len; @@ -54,9 +54,9 @@ qbit_cshift (longint a, integer b, integer len) 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)))); } diff --git a/libf2c/libI77/inquire.c b/libf2c/libI77/inquire.c index 5b2df3e699c..dae869cb4bf 100644 --- a/libf2c/libI77/inquire.c +++ b/libf2c/libI77/inquire.c @@ -56,7 +56,7 @@ 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; @@ -72,7 +72,7 @@ f_inqu (inlist * a) *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; diff --git a/libf2c/libI77/rdfmt.c b/libf2c/libI77/rdfmt.c index 5088f714f6f..8a8818aefb9 100644 --- a/libf2c/libI77/rdfmt.c +++ b/libf2c/libI77/rdfmt.c @@ -60,7 +60,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) { @@ -85,7 +85,7 @@ rd_Z (Uint * n, int w, ftnlen len) } 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/libf2c/libI77/rsne.c b/libf2c/libI77/rsne.c index 4b521344dd4..f0490dbaf8a 100644 --- a/libf2c/libI77/rsne.c +++ b/libf2c/libI77/rsne.c @@ -368,7 +368,7 @@ have_amp: 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))))