VM: make the bignum_to_* family free functions, they don't need to be
members of factor_vmdb4
parent
72fe466ac9
commit
e14d7a3508
|
|
@ -369,7 +369,7 @@ FOO_TO_BIGNUM(ulong_long, uint64_t, int64_t, uint64_t)
|
||||||
/* cannot allocate memory */
|
/* cannot allocate memory */
|
||||||
/* bignum_to_cell, fixnum_to_cell, long_long_to_cell, ulong_long_to_cell */
|
/* bignum_to_cell, fixnum_to_cell, long_long_to_cell, ulong_long_to_cell */
|
||||||
#define BIGNUM_TO_FOO(name, type, stype, utype) \
|
#define BIGNUM_TO_FOO(name, type, stype, utype) \
|
||||||
type factor_vm::bignum_to_##name(bignum* bn) { \
|
type bignum_to_##name(bignum* bn) { \
|
||||||
if (BIGNUM_ZERO_P(bn)) \
|
if (BIGNUM_ZERO_P(bn)) \
|
||||||
return (0); \
|
return (0); \
|
||||||
{ \
|
{ \
|
||||||
|
|
|
||||||
|
|
@ -42,4 +42,9 @@ enum bignum_comparison {
|
||||||
bignum_comparison_greater = 1
|
bignum_comparison_greater = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
cell bignum_to_cell(bignum* bn);
|
||||||
|
fixnum bignum_to_fixnum(bignum* bn);
|
||||||
|
int64_t bignum_to_long_long(bignum* bn);
|
||||||
|
uint64_t bignum_to_ulong_long(bignum* bn);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -232,11 +232,7 @@ struct factor_vm {
|
||||||
bignum** remainder);
|
bignum** remainder);
|
||||||
bignum* bignum_quotient(bignum* numerator, bignum* denominator);
|
bignum* bignum_quotient(bignum* numerator, bignum* denominator);
|
||||||
bignum* bignum_remainder(bignum* numerator, bignum* denominator);
|
bignum* bignum_remainder(bignum* numerator, bignum* denominator);
|
||||||
cell bignum_to_cell(bignum* bn);
|
|
||||||
fixnum bignum_to_fixnum_strict(bignum* bn);
|
fixnum bignum_to_fixnum_strict(bignum* bn);
|
||||||
fixnum bignum_to_fixnum(bignum* bn);
|
|
||||||
int64_t bignum_to_long_long(bignum* bn);
|
|
||||||
uint64_t bignum_to_ulong_long(bignum* bn);
|
|
||||||
bignum* double_to_bignum(double x);
|
bignum* double_to_bignum(double x);
|
||||||
int bignum_equal_p_unsigned(bignum* x, bignum* y);
|
int bignum_equal_p_unsigned(bignum* x, bignum* y);
|
||||||
enum bignum_comparison bignum_compare_unsigned(bignum* x, bignum* y);
|
enum bignum_comparison bignum_compare_unsigned(bignum* x, bignum* y);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue