+2000-03-20 Kevin Buettner <kevinb@redhat.com>
+
+ * utils.c (floatformat_from_doublest): Don't assume that a long
+ will be exactly 32 bits in length. Also... make sure space
+ that we're writing the float to is completely initialized to
+ zeroes, even when the number of bits in the float is not
+ evenly divisible by FLOATFORMAT_CHAR_BIT.
+
2000-03-20 Jim Blandy <jimb@redhat.com>
* i386-linux-nat.c: No need to #include "frame.h" any more.
unsigned char *uto = (unsigned char *) to;
memcpy (&dfrom, from, sizeof (dfrom));
- memset (uto, 0, fmt->totalsize / FLOATFORMAT_CHAR_BIT);
+ memset (uto, 0, (fmt->totalsize + FLOATFORMAT_CHAR_BIT - 1)
+ / FLOATFORMAT_CHAR_BIT);
if (dfrom == 0)
return; /* Result is zero */
if (dfrom != dfrom) /* Result is NaN */
mant_bits = mant_bits_left < 32 ? mant_bits_left : 32;
mant *= 4294967296.0;
- mant_long = (unsigned long) mant;
+ mant_long = ((unsigned long) mant) & 0xffffffffL;
mant -= mant_long;
/* If the integer bit is implicit, then we need to discard it.
&& fmt->intbit == floatformat_intbit_no)
{
mant_long <<= 1;
+ mant_long &= 0xffffffffL;
mant_bits -= 1;
}