mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-20 04:02:27 +00:00
dfb1bd873d
- Fix WITH_GMP on FreeBSD >= 500035 - Add a test target to the Makefile of the port. Approved by: netchild
64 lines
1.3 KiB
C++
64 lines
1.3 KiB
C++
--- src/gmpnumbers.cpp.orig Thu Nov 20 21:50:20 2003
|
|
+++ src/gmpnumbers.cpp Thu Nov 20 22:04:17 2003
|
|
@@ -82,25 +82,19 @@
|
|
|
|
void initGMPNumber(GMPNumber& x, GMPNumber& y)
|
|
{
|
|
- mpz_t man;
|
|
- mpz_init_set(man,y.man);
|
|
- x.man = man;
|
|
+ mpz_init_set(x.man,y.man);
|
|
x.exp = y.exp;
|
|
}
|
|
|
|
void initGMPNumber(GMPNumber& x, long y)
|
|
{
|
|
- mpz_t man;
|
|
- mpz_init_set_ui(man,y);
|
|
- x.man = man;
|
|
+ mpz_init_set_ui(x.man,y);
|
|
x.exp = 0;
|
|
}
|
|
|
|
void initGMPNumber(GMPNumber& x, mpz_t mpz)
|
|
{
|
|
- mpz_t man;
|
|
- mpz_init_set(man,mpz);
|
|
- x.man = man;
|
|
+ mpz_init_set(x.man,mpz);
|
|
x.exp = 0;
|
|
}
|
|
|
|
@@ -149,11 +143,9 @@
|
|
exp++;
|
|
}
|
|
if (!*man) {*man='0';*(man+1)='\0';neg=0;exp=0;}
|
|
- mpz_t ma;
|
|
- mpz_init_set_str(ma,man,10);
|
|
+ mpz_init_set_str(x.man,man,10);
|
|
free(man);
|
|
- if(neg)mpz_neg(ma,ma);
|
|
- x.man=ma;
|
|
+ if(neg)mpz_neg(x.man,x.man);
|
|
x.exp=exp;
|
|
}
|
|
|
|
@@ -170,7 +162,7 @@
|
|
free(str);
|
|
}
|
|
|
|
-char* getstrGMPNumber(GMPNumber& x, long prec=0)
|
|
+char* getstrGMPNumber(GMPNumber& x, long prec)
|
|
{
|
|
long rawsize = mpz_sizeinbase(x.man,10);
|
|
size_t size;
|
|
@@ -241,7 +233,7 @@
|
|
}
|
|
|
|
static LispStringPtr GMPNumberToString(GMPNumber& x, LispHashTable& h,
|
|
- LispInt prec=0)
|
|
+ LispInt prec)
|
|
{
|
|
char* result = getstrGMPNumber(x, prec);
|
|
LispStringPtr toreturn = h.LookUp(result);
|