]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
factor: primes_diff idx type consistency
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 4 Jun 2025 15:07:23 +0000 (08:07 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 10 Jul 2025 00:12:39 +0000 (17:12 -0700)
* src/factor.c (factor_insert_refind):
Use idx_t for indexes into primes_diff,
for consistency with other indexes into primes_diff.
This has no practical effect unless the primes_diff
table becomes unreasonably large.

src/factor.c

index c16330047f98e66bd8a14b9690e9baaf91d78de3..e32cf7c3af47d5bf7ce7791f2599796e15ec829c 100644 (file)
@@ -717,9 +717,9 @@ static bool flag_prove_primality = PROVE_PRIMALITY;
 #endif
 
 static void
-factor_insert_refind (struct factors *factors, mp_limb_t p, int i, int off)
+factor_insert_refind (struct factors *factors, mp_limb_t p, idx_t i, idx_t off)
 {
-  for (int j = 0; j < off; j++)
+  for (idx_t j = 0; j < off; j++)
     p += primes_diff[i + j];
   factor_insert (factors, p);
 }