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