* intnum.c (yasm_intnum_zero): New function to zero an existing intnum.

* intnum.h (yasm_intnum_zero): Add prototype for above.

svn path=/trunk/yasm/; revision=1158
0.4
Peter Johnson 21 years ago
parent 7ad7637861
commit 533979e455
  1. 10
      libyasm/intnum.c
  2. 5
      libyasm/intnum.h

@ -445,6 +445,16 @@ yasm_intnum_calc(yasm_intnum *acc, yasm_expr_op op, yasm_intnum *operand,
}
/*@=nullderef =nullpass =branchstate@*/
void
yasm_intnum_zero(yasm_intnum *intn)
{
if (intn->type == INTNUM_BV) {
BitVector_Destroy(intn->val.bv);
intn->type = INTNUM_UL;
}
intn->val.ul = 0;
}
int
yasm_intnum_is_zero(yasm_intnum *intn)
{

@ -112,6 +112,11 @@ void yasm_intnum_destroy(/*@only@*/ yasm_intnum *intn);
void yasm_intnum_calc(yasm_intnum *acc, yasm_expr_op op, yasm_intnum *operand,
unsigned long line);
/** Zero an intnum.
* \param intn intnum
*/
void yasm_intnum_zero(yasm_intnum *intn);
/** Simple value check for 0.
* \param acc intnum
* \return Nonzero if acc==0.

Loading…
Cancel
Save