--- src/basemath/arith1.c +++ src/basemath/arith1.c @@ -3621,7 +3621,7 @@ GEN Fp_order(GEN a, GEN o, GEN p) { if (lgefint(p) == 3 && (!o || typ(o) == t_INT)) { - ulong pp = p[2], oo = (o && lgefint(o)==3)? o[2]: pp-1; + ulong pp = p[2], oo = (o && lgefint(o)==3)? (ulong)(o[2]): pp-1; return utoi( Fl_order(umodiu(a, pp), oo, pp) ); } return gen_order(a, o, (void*)p, &Fp_star); @@ -4109,7 +4109,7 @@ Fl_log_Fp(ulong a, ulong g, ulong ord, u { pari_sp av = avma; GEN r = Fp_log(utoi(a),utoi(g),utoi(ord),utoi(p)); - ulong z = typ(r)==t_INT ? itou(r): ~0L; + ulong z = (typ(r)==t_INT) ? itou(r): ~0UL; avma = av; return z; } --- src/basemath/base4.c +++ src/basemath/base4.c @@ -504,7 +504,7 @@ idealHNF_Z_factor_i(GEN x, GEN f0, GEN * for (i = 1; i < l; i++) { GEN p = gel(P,i); - vZ[i] = f0? Z_pval(xZ, p): itou(gel(E,i)); + vZ[i] = f0? Z_pval(xZ, p): itos(gel(E,i)); vN[i] = idealHNF_norm_pval(x,p, vZ[i]); } return P; --- src/basemath/char.c +++ src/basemath/char.c @@ -407,7 +407,7 @@ zv_cyc_minimize(GEN cyc, GEN g, GEN copr gk = vecmoduu(gk, cyc); if (vecsmall_lexcmp(gk, best) < 0) { best = gk; bestk = k; } } - avma = av; return bestk == 1? k0: Fl_mul(k0, bestk, o); + avma = av; return bestk == 1? k0: (long)Fl_mul(k0, bestk, o); } /* g of order o in abelian group G attached to cyc. Is g a minimal generator * [wrt lex order] of the cyclic subgroup it generates; --- src/basemath/hyperell.c +++ src/basemath/hyperell.c @@ -683,7 +683,7 @@ Flx_genus2charpoly_naive(GEN H, ulong p) { GEN r2 = gel(V, n+1); c += uel(r2,2) ? - (uel(r2,1) ? k[1+Fl2_norm_pre(r2, D, p, pi)]: e) + (uel(r2,1) ? (ulong)(k[1+Fl2_norm_pre(r2, D, p, pi)]): e) : !!uel(r2,1); if (i == p-1) break; V = Fl2V_next(V, p); --- src/basemath/mftrace.c +++ src/basemath/mftrace.c @@ -10980,7 +10980,7 @@ mfslashexpansion(GEN mf, GEN f, GEN ga, long CD = (C * D) % N, BC = (B * C) % F; GEN CV, t; /* weight of f * Theta in 1/2-integral weight */ - k = typ(gk) == t_INT? itou(gk): MF_get_r(mf)+1; + k = (typ(gk) == t_INT)? itos(gk): MF_get_r(mf)+1; CV = odd(k) ? powuu(N, k - 1) : powuu(N, k >> 1); deg = ulcm(ulcm(ord, N/ugcd(N,CD)), F/ugcd(F,BC)); if (typ(gk) != t_INT && (C & 3) && odd(deg)) deg <<= 2;/* must adjoin I */ --- src/basemath/nffactor.c +++ src/basemath/nffactor.c @@ -2062,7 +2062,7 @@ guess_roots(GEN nf) /* the gcd of the p^f - 1 is p^(gcd of the f's) - 1 */ for (i = 1; i <= nfdegree; i++) if (F[i]) { - gcdf = gcdf? ugcd(gcdf, i): i; + gcdf = gcdf? (long)ugcd(gcdf, i): i; if (gcdf == 1) break; } pf_1 = subiu(powuu(p, gcdf), 1); --- src/language/sumiter.c +++ src/language/sumiter.c @@ -269,14 +269,14 @@ forfactored(GEN a, GEN b, GEN code) sb = signe(b); if (sa < 0) { - stop = forfactoredneg((sb < 0)? b[2]: 1UL, itou(a), code); + stop = forfactoredneg((sb < 0)? (ulong)b[2]: 1UL, itou(a), code); if (!stop && sb >= 0) stop = eval0(code); if (!stop && sb > 0) forfactoredpos(1UL, b[2], code); } else { if (!sa) stop = eval0(code); - if (!stop && sb) forfactoredpos(sa? a[2]: 1UL, itou(b), code); + if (!stop && sb) forfactoredpos(sa? (ulong)a[2]: 1UL, itou(b), code); } pop_lex(1); avma = av; }