Replace some more uses of mpz_set_si/ui with _ecl_big_set_fixnum/index

parent 680bd698
...@@ -354,7 +354,7 @@ ecl_boole(int op, cl_object x, cl_object y) ...@@ -354,7 +354,7 @@ ecl_boole(int op, cl_object x, cl_object y)
} }
case t_bignum: { case t_bignum: {
cl_object x_copy = _ecl_big_register0(); 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); bignum_operations[op](x_copy, y);
return _ecl_big_register_normalize(x_copy); return _ecl_big_register_normalize(x_copy);
} }
...@@ -368,7 +368,7 @@ ecl_boole(int op, cl_object x, cl_object y) ...@@ -368,7 +368,7 @@ ecl_boole(int op, cl_object x, cl_object y)
switch (type_of(y)) { switch (type_of(y)) {
case t_fixnum: { case t_fixnum: {
cl_object z = _ecl_big_register1(); 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); bignum_operations[op](x_copy, z);
_ecl_big_register_free(z); _ecl_big_register_free(z);
break; break;
...@@ -469,7 +469,7 @@ ecl_ash(cl_object x, cl_fixnum w) ...@@ -469,7 +469,7 @@ ecl_ash(cl_object x, cl_fixnum w)
} else { } else {
#ifdef WITH_GMP #ifdef WITH_GMP
if (FIXNUMP(x)) { if (FIXNUMP(x)) {
mpz_set_si(y->big.big_num, fix(x)); _ecl_big_set_fixnum(y, fix(x));
x = y; x = y;
} }
mpz_mul_2exp(y->big.big_num, x->big.big_num, (unsigned long)w); mpz_mul_2exp(y->big.big_num, x->big.big_num, (unsigned long)w);
......
...@@ -115,7 +115,7 @@ ecl_make_integer(cl_fixnum l) ...@@ -115,7 +115,7 @@ ecl_make_integer(cl_fixnum l)
{ {
if (l > MOST_POSITIVE_FIXNUM || l < MOST_NEGATIVE_FIXNUM) { if (l > MOST_POSITIVE_FIXNUM || l < MOST_NEGATIVE_FIXNUM) {
cl_object z = _ecl_big_register0(); 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 _ecl_big_register_copy(z);
} }
return MAKE_FIXNUM(l); return MAKE_FIXNUM(l);
...@@ -126,7 +126,7 @@ ecl_make_unsigned_integer(cl_index l) ...@@ -126,7 +126,7 @@ ecl_make_unsigned_integer(cl_index l)
{ {
if (l > MOST_POSITIVE_FIXNUM) { if (l > MOST_POSITIVE_FIXNUM) {
cl_object z = _ecl_big_register0(); 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 _ecl_big_register_copy(z);
} }
return MAKE_FIXNUM(l); return MAKE_FIXNUM(l);
...@@ -703,7 +703,7 @@ static cl_object ...@@ -703,7 +703,7 @@ static cl_object
into_bignum(cl_object bignum, cl_object integer) into_bignum(cl_object bignum, cl_object integer)
{ {
if (FIXNUMP(integer)) { if (FIXNUMP(integer)) {
mpz_set_si(bignum->big.big_num, fix(integer)); _ecl_big_set_fixnum(bignum, fix(integer));
} else { } else {
mpz_set(bignum->big.big_num, integer->big.big_num); mpz_set(bignum->big.big_num, integer->big.big_num);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment