* io/read.c (set_integer): Use memcpy to fill buffer.

From-SVN: r103687
This commit is contained in:
Steve Ellcey 2005-08-31 17:05:52 +00:00 committed by Steve Ellcey
parent e6494c9434
commit af452a2bf9
2 changed files with 24 additions and 5 deletions

View File

@ -1,3 +1,7 @@
2005-08-31 Steve Ellcey <sje@cup.hp.com>
* io/read.c (set_integer): Use memcpy to fill buffer.
2005-08-31 Steve Ellcey <sje@cup.hp.com>
PR target/23556

View File

@ -49,20 +49,35 @@ set_integer (void *dest, GFC_INTEGER_LARGEST value, int length)
{
#ifdef HAVE_GFC_INTEGER_16
case 16:
*((GFC_INTEGER_16 *) dest) = value;
{
GFC_INTEGER_16 tmp = value;
memcpy (dest, (void *) &tmp, length);
}
break;
#endif
case 8:
*((GFC_INTEGER_8 *) dest) = value;
{
GFC_INTEGER_8 tmp = value;
memcpy (dest, (void *) &tmp, length);
}
break;
case 4:
*((GFC_INTEGER_4 *) dest) = value;
{
GFC_INTEGER_4 tmp = value;
memcpy (dest, (void *) &tmp, length);
}
break;
case 2:
*((GFC_INTEGER_2 *) dest) = value;
{
GFC_INTEGER_2 tmp = value;
memcpy (dest, (void *) &tmp, length);
}
break;
case 1:
*((GFC_INTEGER_1 *) dest) = value;
{
GFC_INTEGER_1 tmp = value;
memcpy (dest, (void *) &tmp, length);
}
break;
default:
internal_error ("Bad integer kind");