summaryrefslogtreecommitdiffstats
path: root/libf2c/libI77/rdfmt.c
diff options
context:
space:
mode:
authortoon <toon@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-11 19:39:55 +0000
committertoon <toon@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-11 19:39:55 +0000
commitdf33f3421bfbabea1b36e6587b93e561c807bf26 (patch)
tree5fd1a3283c8a726e0063c0eba4dd39d5ea23a601 /libf2c/libI77/rdfmt.c
parent39d9b7709e11973b09bc20ee9235929fd01f606a (diff)
downloadppe42-gcc-df33f3421bfbabea1b36e6587b93e561c807bf26.tar.gz
ppe42-gcc-df33f3421bfbabea1b36e6587b93e561c807bf26.zip
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). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34494 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libf2c/libI77/rdfmt.c')
-rw-r--r--libf2c/libI77/rdfmt.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libf2c/libI77/rdfmt.c b/libf2c/libI77/rdfmt.c
index 08ff0e827b4..f2b121193a7 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')
OpenPOWER on IntegriCloud