/* -*-c-*-
*
- * $Id: limlee.c,v 1.7 2001/01/25 21:40:44 mdw Exp $
+ * $Id: limlee.c,v 1.8 2001/02/03 11:59:07 mdw Exp $
*
* Generate Lim-Lee primes
*
/*----- Revision history --------------------------------------------------*
*
* $Log: limlee.c,v $
+ * Revision 1.8 2001/02/03 11:59:07 mdw
+ * Don't use the @pgen@ random number generator for generating primes: it's
+ * only for testing them. Use a caller-supplied one instead.
+ *
* Revision 1.7 2001/01/25 21:40:44 mdw
* Remove dead code now that the new stepper structure is trustworthy.
*
static void llfree(limlee_factor *f, limlee_stepctx *l)
{
- if (f->p)
- mp_drop(f->p);
+ mp_drop(f->p);
}
static const limlee_primeops primeops_simple = { llgen, llfree };
/* --- Other bits of initialization --- */
l->seq = 0;
- l->r = ev->r;
dstr_create(&l->d);
if (!l->pops) {
l->pops = &primeops_simple;
mp *p;
int rc;
- if (ev->m)
- mp_drop(ev->m);
- l->r = ev->r;
+ mp_drop(ev->m);
for (;;) {
size_t i;
l.pops = 0;
l.iev = iev;
l.iec = iec;
+ l.r = r;
d = pgen(name, d, 0, oev, oec, on, limlee_step, &l,
rabin_iters(pl), pgen_test, &rr);