This repository has been archived by the owner on Jan 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
0001-Fix-compliation-error-with-GMP-long-long-limbs.patch
52 lines (47 loc) · 1.99 KB
/
0001-Fix-compliation-error-with-GMP-long-long-limbs.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 260f754cf7e421a41e89f3b93fb86a99a05cc376 Mon Sep 17 00:00:00 2001
From: "Erik M. Bray" <erik.bray@lri.fr>
Date: Mon, 22 Apr 2019 16:07:17 +0200
Subject: [PATCH] Fix compliation error with GMP long long limbs.
Depending how GMP is configured the macro from flint, slong, which actually
refers to GMP's mp_limb_signed_t, may be a long long instead of plain long.
numeric doesn't have a constructor for long long, leading to an ambiguous
overload error on the constructor. In this case it should make more sense
to just use normal int and long types for these loop variables as it
makes sense to, and only cast to the "slong" type when passing to the
flint interface.
---
ginac/useries.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ginac/useries.cpp b/ginac/useries.cpp
index 1dc97f0..fd68d49 100644
--- a/ginac/useries.cpp
+++ b/ginac/useries.cpp
@@ -82,10 +82,10 @@ long fmpq_poly_ldegree(const fmpq_poly_t& fp)
if (fmpq_poly_is_zero(fp))
return 0;
long len = fmpq_poly_length(fp);
- for (slong n=0; n<=len; n++) {
+ for (long n=0; n<=len; n++) {
fmpq_t c;
fmpq_init(c);
- fmpq_poly_get_coeff_fmpq(c, fp, n);
+ fmpq_poly_get_coeff_fmpq(c, fp, (slong)n);
if (not fmpq_is_zero(c)) {
fmpq_clear(c);
return n;
@@ -435,12 +435,12 @@ ex useries(const ex& the_ex, const symbol& x, int order, unsigned options)
}
// Fill expair vector
- for (slong n=0; n<=deg+prec; n++) {
+ for (int n=0; n<=deg+prec; n++) {
if (n + fp.offset >= order)
break;
fmpq_t c;
fmpq_init(c);
- fmpq_poly_get_coeff_fmpq(c, fp.ft, n);
+ fmpq_poly_get_coeff_fmpq(c, fp.ft, (slong)n);
if (not fmpq_is_zero(c)) {
mpq_t gc;
mpq_init(gc);
--
2.15.1