mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-04-25 02:50:24 -07:00
Replace some more uses of mpz_set_si/ui with _ecl_big_set_fixnum/index
This commit is contained in:
parent
680bd6988c
commit
0e3b1c389f
2 changed files with 6 additions and 6 deletions
|
|
@ -354,7 +354,7 @@ ecl_boole(int op, cl_object x, cl_object y)
|
|||
}
|
||||
case t_bignum: {
|
||||
cl_object x_copy = _ecl_big_register0();
|
||||
_ecl_big_set_si(x_copy, fix(x));
|
||||
_ecl_big_set_fixnum(x_copy, fix(x));
|
||||
bignum_operations[op](x_copy, y);
|
||||
return _ecl_big_register_normalize(x_copy);
|
||||
}
|
||||
|
|
@ -368,7 +368,7 @@ ecl_boole(int op, cl_object x, cl_object y)
|
|||
switch (type_of(y)) {
|
||||
case t_fixnum: {
|
||||
cl_object z = _ecl_big_register1();
|
||||
_ecl_big_set_si(z,fix(y));
|
||||
_ecl_big_set_fixnum(z,fix(y));
|
||||
bignum_operations[op](x_copy, z);
|
||||
_ecl_big_register_free(z);
|
||||
break;
|
||||
|
|
@ -469,7 +469,7 @@ ecl_ash(cl_object x, cl_fixnum w)
|
|||
} else {
|
||||
#ifdef WITH_GMP
|
||||
if (FIXNUMP(x)) {
|
||||
mpz_set_si(y->big.big_num, fix(x));
|
||||
_ecl_big_set_fixnum(y, fix(x));
|
||||
x = y;
|
||||
}
|
||||
mpz_mul_2exp(y->big.big_num, x->big.big_num, (unsigned long)w);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ ecl_make_integer(cl_fixnum l)
|
|||
{
|
||||
if (l > MOST_POSITIVE_FIXNUM || l < MOST_NEGATIVE_FIXNUM) {
|
||||
cl_object z = _ecl_big_register0();
|
||||
_ecl_big_set_si(z, l);
|
||||
_ecl_big_set_fixnum(z, l);
|
||||
return _ecl_big_register_copy(z);
|
||||
}
|
||||
return MAKE_FIXNUM(l);
|
||||
|
|
@ -126,7 +126,7 @@ ecl_make_unsigned_integer(cl_index l)
|
|||
{
|
||||
if (l > MOST_POSITIVE_FIXNUM) {
|
||||
cl_object z = _ecl_big_register0();
|
||||
_ecl_big_set_ui(z, l);
|
||||
_ecl_big_set_index(z, l);
|
||||
return _ecl_big_register_copy(z);
|
||||
}
|
||||
return MAKE_FIXNUM(l);
|
||||
|
|
@ -703,7 +703,7 @@ static cl_object
|
|||
into_bignum(cl_object bignum, cl_object integer)
|
||||
{
|
||||
if (FIXNUMP(integer)) {
|
||||
mpz_set_si(bignum->big.big_num, fix(integer));
|
||||
_ecl_big_set_fixnum(bignum, fix(integer));
|
||||
} else {
|
||||
mpz_set(bignum->big.big_num, integer->big.big_num);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue