Codebase list libmath-prime-util-perl / 22c6a94
Compiler warnings Dana Jacobsen 8 years ago
4 changed file(s) with 9 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
113113 version that is non-threadsafe.
114114
115115 - Tests for sieve_prime_cluster.
116 - cluster sieve: res2 vs. cres
117 - cluster sieve: do uint32_t vs. UV change in GMP
706706 XSRETURN_UV(ret);
707707 /* For min/max, use string compare if not an object */
708708 if ((ix == 2 || ix == 3) && !sv_isobject(ST(0))) {
709 int i, retindex = 0;
709 int retindex = 0;
710710 int minmax = (ix == 2);
711711 STRLEN alen, blen;
712712 char *aptr, *bptr;
211211
212212 /* Sort the non-small factors */
213213 for (i = nsmallfactors+1; i < nfactors; i++) {
214 UV f = factors[i];
215 for (j = i; j > 0 && factors[j-1] > f; j--)
214 UV fi = factors[i];
215 for (j = i; j > 0 && factors[j-1] > fi; j--)
216216 factors[j] = factors[j-1];
217 factors[j] = f;
217 factors[j] = fi;
218218 }
219219 }
220220 return nfactors;
430430 * clever, and does the job. */
431431
432432 #define sieve_zero(sieve, si, wordcount) \
433 { uint32 index = si/SWORD_BITS; \
434 sword_t mask = SWORD_MASKBIT(si); \
435 if (sieve[index] & mask) { \
436 sieve[index] &= ~mask; \
437 wordcount[index]--; \
433 { uint32 index_ = si/SWORD_BITS; \
434 sword_t mask_ = SWORD_MASKBIT(si); \
435 if (sieve[index_] & mask_) { \
436 sieve[index_] &= ~mask_; \
437 wordcount[index_]--; \
438438 } }
439439
440440 #define sieve_case_zero(casenum, skip, si, p, size, mult, sieve, wordcount) \