vvp_vector4_t words are unsigned long.
The double to vvp_vector4_t constructor was not using the correct declaration for the bit words. This worked as long as unsigned and unsigned long were the same size (usually).
This commit is contained in:
parent
be551a6b68
commit
296f1bacc1
|
|
@ -416,14 +416,14 @@ vvp_vector4_t::vvp_vector4_t(unsigned size, double val)
|
|||
|
||||
/* Skip any leading bits. */
|
||||
for (int idx = (signed) nwords; idx > (signed) my_words; idx -=1) {
|
||||
unsigned bits = (unsigned) fraction;
|
||||
unsigned long bits = (unsigned long) fraction;
|
||||
fraction = fraction - (double) bits;
|
||||
fraction = ldexp(fraction, BITS_PER_WORD);
|
||||
}
|
||||
|
||||
/* Convert the remaining bits as appropriate. */
|
||||
if (my_words == 0) {
|
||||
unsigned bits = (unsigned) fraction;
|
||||
unsigned long bits = (unsigned long) fraction;
|
||||
abits_val_ = bits;
|
||||
fraction = fraction - (double) bits;
|
||||
/* Round any fractional part up. */
|
||||
|
|
@ -431,7 +431,7 @@ vvp_vector4_t::vvp_vector4_t(unsigned size, double val)
|
|||
} else {
|
||||
if (nwords < my_words) my_words = nwords;
|
||||
for (int idx = (signed)my_words; idx >= 0; idx -= 1) {
|
||||
unsigned bits = (unsigned) fraction;
|
||||
unsigned long bits = (unsigned long) fraction;
|
||||
abits_ptr_[idx] = bits;
|
||||
fraction = fraction - (double) bits;
|
||||
fraction = ldexp(fraction, BITS_PER_WORD);
|
||||
|
|
|
|||
Loading…
Reference in New Issue