diff options
author | Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl> | 2000-06-11 21:39:55 +0200 |
---|---|---|
committer | Toon Moene <toon@gcc.gnu.org> | 2000-06-11 19:39:55 +0000 |
commit | 65377a89bfa91231e7018b130ff44c2ecb3766ca (patch) | |
tree | 5fd1a3283c8a726e0063c0eba4dd39d5ea23a601 /libf2c | |
parent | 11a27a767bc7ab87dca58ee882e6dd3b487069be (diff) | |
download | gcc-65377a89bfa91231e7018b130ff44c2ecb3766ca.zip gcc-65377a89bfa91231e7018b130ff44c2ecb3766ca.tar.gz gcc-65377a89bfa91231e7018b130ff44c2ecb3766ca.tar.bz2 |
rdfmt.c (rd_L): Use if-then-else instead of case statement to solve problems when...
2000-06-11 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
* rdfmt.c (rd_L): Use if-then-else instead of case statement to
solve problems when sizeof(char) == sizeof(short).
From-SVN: r34494
Diffstat (limited to 'libf2c')
-rw-r--r-- | libf2c/ChangeLog | 5 | ||||
-rw-r--r-- | libf2c/libI77/rdfmt.c | 14 |
2 files changed, 14 insertions, 5 deletions
diff --git a/libf2c/ChangeLog b/libf2c/ChangeLog index 6d0e6db..2c734c6 100644 --- a/libf2c/ChangeLog +++ b/libf2c/ChangeLog @@ -1,3 +1,8 @@ +2000-06-11 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl> + + * rdfmt.c (rd_L): Use if-then-else instead of case statement to + solve problems when sizeof(char) == sizeof(short). + 2000-05-18 Chris Demetriou <cgd@sibyte.com> * configure.in: Test for __g77_integer, __g77_uinteger, diff --git a/libf2c/libI77/rdfmt.c b/libf2c/libI77/rdfmt.c index 08ff0e8..f2b1211 100644 --- a/libf2c/libI77/rdfmt.c +++ b/libf2c/libI77/rdfmt.c @@ -208,11 +208,15 @@ rd_L(ftnint *n, int w, ftnlen len) case '\n': return errno = 116; } - switch(len) { - case sizeof(char): *(char *)n = (char)lv; break; - case sizeof(short): *(short *)n = (short)lv; break; - default: *n = lv; - } + /* The switch statement that was here + didn't cut it: It broke down for targets + where sizeof(char) == sizeof(short). */ + if (len == sizeof(char)) + *(char *)n = (char)lv; + else if (len == sizeof(short)) + *(short *)n = (short)lv; + else + *n = lv; while(w-- > 0) { GET(ch); if (ch == ',' || ch == '\n') |