Make verinum output match for either 32-bit or 64-bit systems

This commit is contained in:
Cary R 2014-12-10 15:07:34 -08:00
parent 96472e5537
commit 0e38843ae9
1 changed files with 3 additions and 1 deletions

View File

@ -780,7 +780,9 @@ ostream& operator<< (ostream&o, const verinum&v)
/* If the number is fully defined (no x or z) then print it
out as a decimal number. */
if (v.is_defined() && v.len() <= 8*sizeof(long)) {
unsigned dec_len = 8*sizeof(int); /* avoid 32/64 bit differences. */
if (! v.has_sign()) dec_len -= 1; /* an unsigned number. */
if (v.is_defined() && v.len() <= dec_len) {
if (v.has_sign())
o << "'sd" << v.as_long();
else