mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-17 03:08:53 +08:00
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
This commit is contained in:
parent
11a27a767b
commit
65377a89bf
@ -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,
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user