Fix padding of x when literal is sized and unsigned.

This commit is contained in:
steve 2007-01-27 05:36:11 +00:00
parent 8e1c7e2891
commit 2de8bafb5c
3 changed files with 19 additions and 7 deletions

View File

@ -21,7 +21,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: lexor.lex,v 1.92 2006/07/31 03:50:17 steve Exp $"
#ident "$Id: lexor.lex,v 1.93 2007/01/27 05:36:11 steve Exp $"
#endif
# include "config.h"
@ -460,7 +460,7 @@ static verinum*make_unsized_binary(const char*txt)
ptr += 1;
}
verinum*out = new verinum(bits, size);
verinum*out = new verinum(bits, size, false);
out->has_sign(sign_flag);
delete[]bits;
return out;
@ -520,7 +520,7 @@ static verinum*make_unsized_octal(const char*txt)
ptr += 1;
}
verinum*out = new verinum(bits, size);
verinum*out = new verinum(bits, size, false);
out->has_sign(sign_flag);
delete[]bits;
return out;
@ -590,7 +590,7 @@ static verinum*make_unsized_hex(const char*txt)
ptr += 1;
}
verinum*out = new verinum(bits, size);
verinum*out = new verinum(bits, size, false);
out->has_sign(sign_flag);
delete[]bits;
return out;

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: pform.cc,v 1.138 2007/01/16 05:44:15 steve Exp $"
#ident "$Id: pform.cc,v 1.139 2007/01/27 05:36:11 steve Exp $"
#endif
# include "config.h"
@ -199,7 +199,7 @@ verinum* pform_verinum_with_size(verinum*siz, verinum*val,
break;
}
verinum*res = new verinum(pad, size);
verinum*res = new verinum(pad, size, true);
unsigned copy = val->len();
if (res->len() < copy)
@ -1744,6 +1744,9 @@ int pform_parse(const char*path, FILE*file)
/*
* $Log: pform.cc,v $
* Revision 1.139 2007/01/27 05:36:11 steve
* Fix padding of x when literal is sized and unsigned.
*
* Revision 1.138 2007/01/16 05:44:15 steve
* Major rework of array handling. Memories are replaced with the
* more general concept of arrays. The NetMemory and NetEMemory

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: verinum.cc,v 1.50 2007/01/19 05:42:04 steve Exp $"
#ident "$Id: verinum.cc,v 1.51 2007/01/27 05:36:11 steve Exp $"
#endif
# include "config.h"
@ -352,6 +352,12 @@ verinum pad_to_width(const verinum&that, unsigned width)
verinum::V pad = that[that.len()-1];
if (pad==verinum::V1 && !that.has_sign())
pad = verinum::V0;
if (that.has_len()) {
if (pad==verinum::Vx)
pad = verinum::V0;
if (pad==verinum::Vz)
pad = verinum::V0;
}
verinum val(pad, width, that.has_len());
@ -1056,6 +1062,9 @@ verinum::V operator ^ (verinum::V l, verinum::V r)
/*
* $Log: verinum.cc,v $
* Revision 1.51 2007/01/27 05:36:11 steve
* Fix padding of x when literal is sized and unsigned.
*
* Revision 1.50 2007/01/19 05:42:04 steve
* Fix calculation of verinum pow operation.
*