From: Peter Johnson Date: Sun, 30 Oct 2005 06:13:24 +0000 (-0000) Subject: * intnum.c (yasm_intnum_is_zero, yasm_intnum_is_pos1, yasm_intnum_is_neg1) X-Git-Tag: v0.5.0rc1~83 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f03d75b1d8c949699f0481a8c5a2bf2fc9a6e95a;p=yasm * 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 --- diff --git a/libyasm/intnum.c b/libyasm/intnum.c index 00e9ba1f..3b594e3c 100644 --- a/libyasm/intnum.c +++ b/libyasm/intnum.c @@ -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) diff --git a/libyasm/intnum.h b/libyasm/intnum.h index 779fd049..ccda97be 100644 --- a/libyasm/intnum.h +++ b/libyasm/intnum.h @@ -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).