+2000-03-02 Kevin Buettner <kevinb@redhat.com>
+
+ * findvar.c (extract_floating, store_floating): Use target
+ floating point type sizes rather host sizes to determine
+ which conversion needs to be done.
+
2000-03-02 Nick Duffek <nsd@cygnus.com>
* uw-thread.c: Apply GNU conventions to comment formatting.
dirty work. */
DOUBLEST
-extract_floating (addr, len)
- PTR addr;
- int len;
+extract_floating (void *addr, int len)
{
DOUBLEST dretval;
- if (len == sizeof (float))
+ if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT)
{
if (HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT)
{
else
floatformat_to_doublest (TARGET_FLOAT_FORMAT, addr, &dretval);
}
- else if (len == sizeof (double))
+ else if (len * TARGET_CHAR_BIT == TARGET_DOUBLE_BIT)
{
if (HOST_DOUBLE_FORMAT == TARGET_DOUBLE_FORMAT)
{
else
floatformat_to_doublest (TARGET_DOUBLE_FORMAT, addr, &dretval);
}
- else if (len == sizeof (DOUBLEST))
+ else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT)
{
if (HOST_LONG_DOUBLE_FORMAT == TARGET_LONG_DOUBLE_FORMAT)
{
}
void
-store_floating (addr, len, val)
- PTR addr;
- int len;
- DOUBLEST val;
+store_floating (void *addr, int len, DOUBLEST val)
{
- if (len == sizeof (float))
+ if (len * TARGET_CHAR_BIT == TARGET_FLOAT_BIT)
{
if (HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT)
{
else
floatformat_from_doublest (TARGET_FLOAT_FORMAT, &val, addr);
}
- else if (len == sizeof (double))
+ else if (len * TARGET_CHAR_BIT == TARGET_DOUBLE_BIT)
{
if (HOST_DOUBLE_FORMAT == TARGET_DOUBLE_FORMAT)
{
else
floatformat_from_doublest (TARGET_DOUBLE_FORMAT, &val, addr);
}
- else if (len == sizeof (DOUBLEST))
+ else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT)
{
if (HOST_LONG_DOUBLE_FORMAT == TARGET_LONG_DOUBLE_FORMAT)
memcpy (addr, &val, sizeof (val));