diff options
author | toon <toon@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-06-11 19:39:55 +0000 |
---|---|---|
committer | toon <toon@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-06-11 19:39:55 +0000 |
commit | df33f3421bfbabea1b36e6587b93e561c807bf26 (patch) | |
tree | 5fd1a3283c8a726e0063c0eba4dd39d5ea23a601 /libf2c/libI77/rdfmt.c | |
parent | 39d9b7709e11973b09bc20ee9235929fd01f606a (diff) | |
download | ppe42-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.c | 14 |
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') |