* intnum.c (yasm_intnum_is_zero, yasm_intnum_is_pos1, yasm_intnum_is_neg1)

(yasm_intnum_sign): Constize intnum parameter.
* intnum.h: Update prototypes for above.

svn path=/trunk/yasm/; revision=1295
0.5.0rc2
Peter Johnson 20 years ago
parent b7d3a2f80e
commit f03d75b1d8
  1. 8
      libyasm/intnum.c
  2. 8
      libyasm/intnum.h

@ -460,25 +460,25 @@ yasm_intnum_zero(yasm_intnum *intn)
}
int
yasm_intnum_is_zero(yasm_intnum *intn)
yasm_intnum_is_zero(const yasm_intnum *intn)
{
return (intn->type == INTNUM_UL && intn->val.ul == 0);
}
int
yasm_intnum_is_pos1(yasm_intnum *intn)
yasm_intnum_is_pos1(const yasm_intnum *intn)
{
return (intn->type == INTNUM_UL && intn->val.ul == 1);
}
int
yasm_intnum_is_neg1(yasm_intnum *intn)
yasm_intnum_is_neg1(const yasm_intnum *intn)
{
return (intn->type == INTNUM_BV && BitVector_is_full(intn->val.bv));
}
int
yasm_intnum_sign(yasm_intnum *intn)
yasm_intnum_sign(const yasm_intnum *intn)
{
if (intn->type == INTNUM_UL) {
if (intn->val.ul == 0)

@ -121,25 +121,25 @@ void yasm_intnum_zero(yasm_intnum *intn);
* \param acc intnum
* \return Nonzero if acc==0.
*/
int yasm_intnum_is_zero(yasm_intnum *acc);
int yasm_intnum_is_zero(const yasm_intnum *acc);
/** Simple value check for 1.
* \param acc intnum
* \return Nonzero if acc==1.
*/
int yasm_intnum_is_pos1(yasm_intnum *acc);
int yasm_intnum_is_pos1(const yasm_intnum *acc);
/** Simple value check for -1.
* \param acc intnum
* \return Nonzero if acc==-1.
*/
int yasm_intnum_is_neg1(yasm_intnum *acc);
int yasm_intnum_is_neg1(const yasm_intnum *acc);
/** Simple sign check.
* \param acc intnum
* \return -1 if negative, 0 if zero, +1 if positive
*/
int yasm_intnum_sign(yasm_intnum *acc);
int yasm_intnum_sign(const yasm_intnum *acc);
/** Convert an intnum to an unsigned 32-bit value. The value is in "standard"
* C format (eg, of unknown endian).

Loading…
Cancel
Save