summaryrefslogtreecommitdiff
path: root/sci-mathematics/flint/files/flint-3.1.3_p1-c99-I.patch
blob: 1ebe43d6243b211415c1cbe1d7993080948b11e1 (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
From 1b93e73d00881be12e04b7f13e070214a3c9e1cc Mon Sep 17 00:00:00 2001
From: Dima Pasechnik <dima@pasechnik.info>
Date: Wed, 19 Jun 2024 22:16:34 +0100
Subject: [PATCH] ensure C99 compliance in headers, as 'I' is reserved
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Note that the following code
---- cut here: save as t.c
---- cut here

fails to compile with a suffciently new compiler, e.g. clang 16 or gcc 14.

$ gcc -c t.c
In file included from t.c:1:
/usr/include/flint/mpoly.h:1319:43: error: expected ‘)’ before ‘__extension__’
 1319 | void mpoly_gcd_info_init(mpoly_gcd_info_t I, slong nvars);
      |                                           ^
In file included from /usr/include/flint/fmpz_types.h:15,
                 from /usr/include/flint/fmpz_mod_types.h:15,
                 from /usr/include/flint/mpoly_types.h:15,
                 from /usr/include/flint/mpoly.h:23,
                 from t.c:2:
/usr/include/flint/mpoly.h:1319:46: error: expected ‘;’, ‘,’ or ‘)’ before ‘mp_limb_signed_t’
 1319 | void mpoly_gcd_info_init(mpoly_gcd_info_t I, slong nvars);

...
---
 src/fft_small.h             |  6 +++---
 src/fmpz_mod_mpoly_factor.h |  8 ++++----
 src/fmpz_mpoly.h            |  2 +-
 src/fmpz_mpoly_factor.h     | 18 +++++++++---------
 src/fq_nmod_mpoly_factor.h  |  6 +++---
 src/fq_zech_mpoly_factor.h  |  6 +++---
 src/mpoly.h                 | 18 +++++++++---------
 src/nmod_mpoly.h            |  4 ++--
 src/nmod_mpoly_factor.h     |  6 +++---
 9 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/src/fft_small.h b/src/fft_small.h
index 3f62f2e988..b7404f196d 100644
--- a/src/fft_small.h
+++ b/src/fft_small.h
@@ -242,10 +242,10 @@ FLINT_INLINE double sd_fft_ctx_get_fft_index(double* d, ulong i)
 }
 
 /* sd_fft.c */
-void sd_fft_trunc(const sd_fft_lctx_t Q, ulong I, ulong S, ulong k, ulong j, ulong itrunc, ulong otrunc);
+void sd_fft_trunc(const sd_fft_lctx_t Q, ulong Iv, ulong S, ulong k, ulong j, ulong itrunc, ulong otrunc);
 
 /* sd_ifft.c */
-void sd_ifft_trunc(const sd_fft_lctx_t Q, ulong I, ulong S, ulong k, ulong j, ulong z, ulong n, int f);
+void sd_ifft_trunc(const sd_fft_lctx_t Q, ulong Iv, ulong S, ulong k, ulong j, ulong z, ulong n, int f);
 
 /* sd_fft_ctx.c */
 void sd_fft_ctx_clear(sd_fft_ctx_t Q);
@@ -428,7 +428,7 @@ typedef struct {
 
 typedef mpn_ctx_struct mpn_ctx_t[1];
 
-void _convert_block(ulong* Xs, sd_fft_ctx_struct* Rffts, double* d, ulong dstride, ulong np, ulong I);
+void _convert_block(ulong* Xs, sd_fft_ctx_struct* Rffts, double* d, ulong dstride, ulong np, ulong Iv);
 ulong flint_mpn_nbits(const ulong* a, ulong an);
 int flint_mpn_cmp_ui_2exp(const ulong* a, ulong an, ulong b, ulong e);
 unsigned char flint_mpn_add_inplace_c(ulong* z, ulong zn, ulong* a, ulong an, unsigned char cf);
diff --git a/src/fmpz_mod_mpoly_factor.h b/src/fmpz_mod_mpoly_factor.h
index 359fdd1e3d..460695dd23 100644
--- a/src/fmpz_mod_mpoly_factor.h
+++ b/src/fmpz_mod_mpoly_factor.h
@@ -1203,15 +1203,15 @@ typedef struct {
 typedef fmpz_mod_mpoly_pfrac_struct fmpz_mod_mpoly_pfrac_t[1];
 
 
-int fmpz_mod_mpoly_pfrac_init(fmpz_mod_mpoly_pfrac_t I,
+int fmpz_mod_mpoly_pfrac_init(fmpz_mod_mpoly_pfrac_t Iv,
     flint_bitcnt_t bits, slong l, slong r, const fmpz_mod_mpoly_struct * betas,
                           const fmpz * alpha, const fmpz_mod_mpoly_ctx_t ctx);
 
-void fmpz_mod_mpoly_pfrac_clear(fmpz_mod_mpoly_pfrac_t I,
+void fmpz_mod_mpoly_pfrac_clear(fmpz_mod_mpoly_pfrac_t Iv,
                                               const fmpz_mod_mpoly_ctx_t ctx);
 
 int fmpz_mod_mpoly_pfrac(slong r, fmpz_mod_mpoly_t t, const slong * deg,
-                     fmpz_mod_mpoly_pfrac_t I, const fmpz_mod_mpoly_ctx_t ctx);
+                     fmpz_mod_mpoly_pfrac_t Iv, const fmpz_mod_mpoly_ctx_t ctx);
 
 int fmpz_mod_mpoly_hlift(slong m, fmpz_mod_mpoly_struct * f, slong r,
             const fmpz * alpha, const fmpz_mod_mpoly_t A, const slong * degs,
@@ -1290,7 +1290,7 @@ int fmpz_mod_mpolyn_gcd_brown_smprime(
     fmpz_mod_mpolyn_t B,
     slong var,
     const fmpz_mod_mpoly_ctx_t ctx,
-    const mpoly_gcd_info_t I,
+    const mpoly_gcd_info_t Iv,
     fmpz_mod_poly_polyun_mpolyn_stack_t St);
 
 int fmpz_mod_mpolyl_gcdp_zippel(
diff --git a/src/fmpz_mpoly.h b/src/fmpz_mpoly.h
index b7c9677915..4be3d05c56 100644
--- a/src/fmpz_mpoly.h
+++ b/src/fmpz_mpoly.h
@@ -1084,7 +1084,7 @@ void fmpz_mpoly_vec_randtest_not_zero(fmpz_mpoly_vec_t vec, flint_rand_t state,
 
 void fmpz_mpoly_spoly(fmpz_mpoly_t res, const fmpz_mpoly_t f, const fmpz_mpoly_t g, const fmpz_mpoly_ctx_t ctx);
 void fmpz_mpoly_vec_set_primitive_unique(fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F, const fmpz_mpoly_ctx_t ctx);
-void fmpz_mpoly_reduction_primitive_part(fmpz_mpoly_t res, const fmpz_mpoly_t f, const fmpz_mpoly_vec_t I, const fmpz_mpoly_ctx_t ctx);
+void fmpz_mpoly_reduction_primitive_part(fmpz_mpoly_t res, const fmpz_mpoly_t f, const fmpz_mpoly_vec_t Iv, const fmpz_mpoly_ctx_t ctx);
 int fmpz_mpoly_vec_is_groebner(const fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F, const fmpz_mpoly_ctx_t ctx);
 void fmpz_mpoly_buchberger_naive(fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F, const fmpz_mpoly_ctx_t ctx);
 int fmpz_mpoly_buchberger_naive_with_limits(fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F,
diff --git a/src/fmpz_mpoly_factor.h b/src/fmpz_mpoly_factor.h
index 0da7c1052b..a04ef8021e 100644
--- a/src/fmpz_mpoly_factor.h
+++ b/src/fmpz_mpoly_factor.h
@@ -298,11 +298,11 @@ void fmpz_mpoly_from_mpolyl_perm_inflate(fmpz_mpoly_t A,
 
 int fmpz_mpolyl_gcd_brown(fmpz_mpoly_t G,
         fmpz_mpoly_t Abar, fmpz_mpoly_t Bbar, fmpz_mpoly_t A, fmpz_mpoly_t B,
-                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t I);
+                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv);
 
 int fmpz_mpolyl_gcd_brown_threaded_pool(fmpz_mpoly_t G,
         fmpz_mpoly_t Abar, fmpz_mpoly_t Bbar, fmpz_mpoly_t A, fmpz_mpoly_t B,
-                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t I,
+                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv,
                         const thread_pool_handle * handles, slong num_handles);
 
 int fmpz_mpolyl_gcd_zippel(fmpz_mpoly_t G, fmpz_mpoly_t Abar,
@@ -340,15 +340,15 @@ typedef struct {
 
 typedef fmpz_poly_pfrac_struct fmpz_poly_pfrac_t[1];
 
-void fmpz_poly_pfrac_init(fmpz_poly_pfrac_t I);
+void fmpz_poly_pfrac_init(fmpz_poly_pfrac_t Iv);
 
-void fmpz_poly_pfrac_clear(fmpz_poly_pfrac_t I);
+void fmpz_poly_pfrac_clear(fmpz_poly_pfrac_t Iv);
 
-int fmpz_poly_pfrac_precompute(fmpz_poly_pfrac_t I,
+int fmpz_poly_pfrac_precompute(fmpz_poly_pfrac_t Iv,
                                           const fmpz_poly_struct * b, slong r);
 
 int fmpz_poly_pfrac_precomp(fmpz_poly_struct * c,
-                                     const fmpz_poly_t A, fmpz_poly_pfrac_t I);
+                                     const fmpz_poly_t A, fmpz_poly_pfrac_t Iv);
 
 typedef struct {
     flint_bitcnt_t bits;
@@ -372,15 +372,15 @@ typedef struct {
 
 typedef fmpz_mpoly_pfrac_struct fmpz_mpoly_pfrac_t[1];
 
-int fmpz_mpoly_pfrac_init(fmpz_mpoly_pfrac_t I, flint_bitcnt_t bits,
+int fmpz_mpoly_pfrac_init(fmpz_mpoly_pfrac_t Iv, flint_bitcnt_t bits,
                             slong r, slong w, const fmpz_mpoly_struct * betas,
                                const fmpz * alpha, const fmpz_mpoly_ctx_t ctx);
 
-void fmpz_mpoly_pfrac_clear(fmpz_mpoly_pfrac_t I,
+void fmpz_mpoly_pfrac_clear(fmpz_mpoly_pfrac_t Iv,
                                                    const fmpz_mpoly_ctx_t ctx);
 
 int fmpz_mpoly_pfrac(slong l, fmpz_mpoly_t t, const slong * degs,
-                             fmpz_mpoly_pfrac_t I, const fmpz_mpoly_ctx_t ctx);
+                             fmpz_mpoly_pfrac_t Iv, const fmpz_mpoly_ctx_t ctx);
 
 int fmpz_mpoly_hlift(slong m, fmpz_mpoly_struct * f, slong r,
                 const fmpz * alpha, const fmpz_mpoly_t A, const slong * degs,
diff --git a/src/fq_nmod_mpoly_factor.h b/src/fq_nmod_mpoly_factor.h
index 6289d3f1c5..29caa99aa4 100644
--- a/src/fq_nmod_mpoly_factor.h
+++ b/src/fq_nmod_mpoly_factor.h
@@ -427,7 +427,7 @@ typedef fq_nmod_mpoly_pfrac_struct fq_nmod_mpoly_pfrac_t[1];
 
 
 int fq_nmod_mpoly_pfrac_init(
-    fq_nmod_mpoly_pfrac_t I,
+    fq_nmod_mpoly_pfrac_t Iv,
     flint_bitcnt_t bits,
     slong l, slong r,
     const fq_nmod_mpoly_struct * betas,
@@ -435,14 +435,14 @@ int fq_nmod_mpoly_pfrac_init(
     const fq_nmod_mpoly_ctx_t ctx);
 
 void fq_nmod_mpoly_pfrac_clear(
-    fq_nmod_mpoly_pfrac_t I,
+    fq_nmod_mpoly_pfrac_t Iv,
     const fq_nmod_mpoly_ctx_t ctx);
 
 int fq_nmod_mpoly_pfrac(
     slong r,
     fq_nmod_mpoly_t t,
     const slong * deg,
-    fq_nmod_mpoly_pfrac_t I,
+    fq_nmod_mpoly_pfrac_t Iv,
     const fq_nmod_mpoly_ctx_t ctx);
 
 int fq_nmod_mpoly_hlift(
diff --git a/src/fq_zech_mpoly_factor.h b/src/fq_zech_mpoly_factor.h
index 06f31369f9..3d3c51419f 100644
--- a/src/fq_zech_mpoly_factor.h
+++ b/src/fq_zech_mpoly_factor.h
@@ -652,7 +652,7 @@ typedef fq_zech_mpoly_pfrac_struct fq_zech_mpoly_pfrac_t[1];
 
 
 int fq_zech_mpoly_pfrac_init(
-    fq_zech_mpoly_pfrac_t I,
+    fq_zech_mpoly_pfrac_t Iv,
     flint_bitcnt_t bits,
     slong l, slong r,
     const fq_zech_mpoly_struct * betas,
@@ -660,14 +660,14 @@ int fq_zech_mpoly_pfrac_init(
     const fq_zech_mpoly_ctx_t ctx);
 
 void fq_zech_mpoly_pfrac_clear(
-    fq_zech_mpoly_pfrac_t I,
+    fq_zech_mpoly_pfrac_t Iv,
     const fq_zech_mpoly_ctx_t ctx);
 
 int fq_zech_mpoly_pfrac(
     slong r,
     fq_zech_mpoly_t t,
     const slong * deg,
-    fq_zech_mpoly_pfrac_t I,
+    fq_zech_mpoly_pfrac_t Iv,
     const fq_zech_mpoly_ctx_t ctx);
 
 int fq_zech_mpoly_hlift(
diff --git a/src/mpoly.h b/src/mpoly.h
index b0950e3a48..fe0ccbe7c4 100644
--- a/src/mpoly.h
+++ b/src/mpoly.h
@@ -1363,9 +1363,9 @@ typedef struct
 
 typedef mpoly_gcd_info_struct mpoly_gcd_info_t[1];
 
-void mpoly_gcd_info_init(mpoly_gcd_info_t I, slong nvars);
+void mpoly_gcd_info_init(mpoly_gcd_info_t Iv, slong nvars);
 
-void mpoly_gcd_info_clear(mpoly_gcd_info_t I);
+void mpoly_gcd_info_clear(mpoly_gcd_info_t Iv);
 
 void mpoly_gcd_info_limits(ulong * Amax_exp, ulong * Amin_exp,
                        slong * Amax_exp_count, slong * Amin_exp_count,
@@ -1378,25 +1378,25 @@ void mpoly_gcd_info_stride(ulong * strides,
                              const ulong * Bmax_exp, const ulong * Bmin_exp,
                                                        const mpoly_ctx_t mctx);
 
-void mpoly_gcd_info_set_perm(mpoly_gcd_info_t I,
+void mpoly_gcd_info_set_perm(mpoly_gcd_info_t Iv,
                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
 
-slong mpoly_gcd_info_get_brown_upper_limit(const mpoly_gcd_info_t I,
+slong mpoly_gcd_info_get_brown_upper_limit(const mpoly_gcd_info_t Iv,
                                                        slong var, slong bound);
 
-void mpoly_gcd_info_measure_hensel(mpoly_gcd_info_t I,
+void mpoly_gcd_info_measure_hensel(mpoly_gcd_info_t Iv,
                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
 
-void mpoly_gcd_info_measure_brown(mpoly_gcd_info_t I,
+void mpoly_gcd_info_measure_brown(mpoly_gcd_info_t Iv,
                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
 
-void mpoly_gcd_info_measure_bma(mpoly_gcd_info_t I,
+void mpoly_gcd_info_measure_bma(mpoly_gcd_info_t Iv,
                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
 
-void mpoly_gcd_info_measure_zippel(mpoly_gcd_info_t I,
+void mpoly_gcd_info_measure_zippel(mpoly_gcd_info_t Iv,
                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
 
-void mpoly_gcd_info_measure_zippel2(mpoly_gcd_info_t I,
+void mpoly_gcd_info_measure_zippel2(mpoly_gcd_info_t Iv,
                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
 
 int mpoly_monomial_cofactors(fmpz * Abarexps, fmpz * Bbarexps,
diff --git a/src/nmod_mpoly.h b/src/nmod_mpoly.h
index 2a8136e6eb..716ac9669a 100644
--- a/src/nmod_mpoly.h
+++ b/src/nmod_mpoly.h
@@ -1619,13 +1619,13 @@ int nmod_mpolyn_gcd_brown_smprime_bivar(
 int nmod_mpolyn_gcd_brown_smprime(nmod_mpolyn_t G,
                                   nmod_mpolyn_t Abar, nmod_mpolyn_t Bbar,
                                  nmod_mpolyn_t A, nmod_mpolyn_t B, slong var,
-                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t I,
+                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv,
                                                          nmod_poly_stack_t Sp);
 
 int nmod_mpolyn_gcd_brown_smprime_threaded_pool(nmod_mpolyn_t G,
                                 nmod_mpolyn_t Abar, nmod_mpolyn_t Bbar,
                                nmod_mpolyn_t A, nmod_mpolyn_t B, slong var,
-                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t I,
+                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv,
                         const thread_pool_handle * handles, slong num_workers);
 
 int nmod_mpolyn_gcd_brown_lgprime(nmod_mpolyn_t G,
diff --git a/src/nmod_mpoly_factor.h b/src/nmod_mpoly_factor.h
index a46afc860f..b16c802b9b 100644
--- a/src/nmod_mpoly_factor.h
+++ b/src/nmod_mpoly_factor.h
@@ -362,15 +362,15 @@ typedef struct {
 typedef nmod_mpoly_pfrac_struct nmod_mpoly_pfrac_t[1];
 
 
-int nmod_mpoly_pfrac_init(nmod_mpoly_pfrac_t I, flint_bitcnt_t bits,
+int nmod_mpoly_pfrac_init(nmod_mpoly_pfrac_t Iv, flint_bitcnt_t bits,
                          slong l, slong r, const nmod_mpoly_struct * betas,
                           const mp_limb_t * alpha, const nmod_mpoly_ctx_t ctx);
 
-void nmod_mpoly_pfrac_clear(nmod_mpoly_pfrac_t I,
+void nmod_mpoly_pfrac_clear(nmod_mpoly_pfrac_t Iv,
                                                    const nmod_mpoly_ctx_t ctx);
 
 int nmod_mpoly_pfrac(slong r, nmod_mpoly_t t, const slong * deg,
-                             nmod_mpoly_pfrac_t I, const nmod_mpoly_ctx_t ctx);
+                             nmod_mpoly_pfrac_t Iv, const nmod_mpoly_ctx_t ctx);
 
 int nmod_mpoly_hlift(slong m, nmod_mpoly_struct * f, slong r,
             const mp_limb_t * alpha, const nmod_mpoly_t A, const slong * degs,