Skip to content

Commit 13e9976

Browse files
committed
fix warnings in some fglm files
1 parent 8438768 commit 13e9976

6 files changed

Lines changed: 15 additions & 18 deletions

File tree

src/fglm/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libfglm.la
22
libfglm_la_SOURCES = fglm_core.c
33
libfglm_ladir = $(includedir)/msolve/fglm
44
libfglm_la_HEADERS = fglm.h
5-
libfglm_la_CFLAGS = $(SIMD_FLAGS) $(CPUEXT_FLAGS) $(OPENMP_CFLAGS)
5+
libfglm_la_CFLAGS = $(SIMD_FLAGS) $(CPUEXT_FLAGS) $(OPENMP_CFLAGS) -Wall -Wextra
66

77
EXTRA_DIST = fglm.h \
88
libfglm.h \

src/fglm/berlekamp_massey.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ void nmod_berlekamp_massey_add_point_modif(
191191
B->points->length = old_length + 1;
192192
}
193193

194-
//shift ne sert pas
195-
int nmod_em_gcd(nmod_berlekamp_massey_t B, long shift){
194+
int nmod_em_gcd(nmod_berlekamp_massey_t B){
196195
slong i, l, k, queue_len, queue_lo, queue_hi;
197196
queue_lo = B->npoints; // vaut 0 en entree
198197
queue_hi = B->points->length; //vaut 2*dim ou dim est la dimension du quotient
@@ -316,7 +315,6 @@ int nmod_em_gcd(nmod_berlekamp_massey_t B, long shift){
316315
}
317316

318317

319-
//shift ne sert pas
320318
int nmod_em_gcd_preinstantiated(nmod_berlekamp_massey_t B, long shift){
321319
slong l, k, queue_len, queue_lo, queue_hi;
322320
queue_lo = B->npoints; // vaut 0 en entree
@@ -436,7 +434,6 @@ int nmod_em_gcd_preinstantiated(nmod_berlekamp_massey_t B, long shift){
436434
FLINT_ASSERT(2*nmod_poly_degree(B->V1) <= B->npoints);
437435
FLINT_ASSERT(2*nmod_poly_degree(B->R0) >= B->npoints);
438436
FLINT_ASSERT(2*nmod_poly_degree(B->R1) < B->npoints);
439-
440437

441438
return 1;
442439
}

src/fglm/data_fglm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static inline param_t *allocate_fglm_param(mp_limb_t prime, long nvars){
166166
static inline void free_fglm_param(param_t *param){
167167
nmod_poly_clear(param->elim);
168168
nmod_poly_clear(param->denom);
169-
for(szmat_t i = 0; i < param->nvars-1; i++){
169+
for(szmat_t i = 0; i < (unsigned int)param->nvars-1; i++){
170170
nmod_poly_clear(param->coords[i]);
171171
}
172172
free(param->coords);

src/fglm/fglm_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static int invert_hankel_matrix(fglm_bms_data_t *data_bms, szmat_t deg){
222222

223223
mirror_points(data_bms->BMS, data_bms->BMS->points->length);
224224

225-
nmod_em_gcd(data_bms->BMS, 0);
225+
nmod_em_gcd(data_bms->BMS);
226226
if(data_bms->BMS->R1->length-1 < dim-1 && dim > 1){
227227
fprintf(stderr, "Singular matrix\n");
228228
return 0;
@@ -242,7 +242,7 @@ static int invert_hankel_matrix(fglm_bms_data_t *data_bms, szmat_t deg){
242242
data_bms->BMS->npoints = 0;
243243

244244
//(R_i, R_{i+1}, V_i, V_{i+1}) = EMGCD(R_0, R_1)
245-
nmod_em_gcd(data_bms->BMS, 0);
245+
nmod_em_gcd(data_bms->BMS);
246246
//Z2 = LC(R_{i+1})^{-1} x (V_{i+1})
247247
inv = n_invmod(data_bms->BMS->R1->coeffs[data_bms->BMS->R1->length-1],
248248
(data_bms->BMS->R1->mod).n);

src/fglm/linalg-fglm.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@
4949

5050
static inline void non_avx_matrix_vector_product(uint32_t* vec_res, const uint32_t* mat,
5151
const uint32_t* vec, const uint32_t ncols,
52-
const uint32_t nrows, const uint32_t PRIME,
53-
const uint32_t RED_32, const uint32_t RED_64,
54-
md_t *st)
52+
const uint32_t nrows, const uint32_t PRIME)
5553
{
5654
uint32_t i, j;
5755
int64_t prod1, prod2, prod3, prod4;

src/fglm/matrix-mult.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,17 @@ static inline uint64_t ADDMODRED32(uint64_t a, uint64_t b,
100100
const uint32_t p, const uint32_t preinv)
101101
{
102102
const long neg = p - a;
103-
return (neg > b) ? MODRED32((a + b), p, preinv) : MODRED32((b - neg), p, preinv);
103+
return (neg > (long)b) ? MODRED32((a + b), p, preinv) : MODRED32((b - neg), p, preinv);
104104
}
105105

106-
static inline uint64_t SUBMODRED32(uint64_t a, uint64_t b,
107-
const uint32_t p, const uint32_t preinv)
108-
{
109-
const long neg = a - b;
110-
return (a < b) ? (p + neg) : (neg);
111-
}
106+
/** currently unused
107+
* static inline uint64_t SUBMODRED32(uint64_t a, uint64_t b,
108+
* const uint32_t p, const uint32_t preinv)
109+
* {
110+
* const long neg = a - b;
111+
* return (a < b) ? (p + neg) : (neg);
112+
* }
113+
*/
112114

113115
#if HAVE_AVX2
114116
static inline void REDUCE(uint64_t *acc64, uint64_t *acc4x64,

0 commit comments

Comments
 (0)