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:
Herman A.J. ten Brugge 2000-06-11 21:39:55 +02:00 committed by Toon Moene
parent 11a27a767b
commit 65377a89bf
2 changed files with 14 additions and 5 deletions

View File

@ -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,

View File

@ -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')