aboutsummaryrefslogtreecommitdiff
path: root/libf2c
diff options
context:
space:
mode:
Diffstat (limited to 'libf2c')
-rw-r--r--libf2c/ChangeLog5
-rw-r--r--libf2c/libI77/rdfmt.c14
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')