X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/blobdiff_plain/10217a5c148f63def6fc564960a9f28ae42d52dc..59919ae4b1721ca271c3d3e5955c09d322573821:/limlee.h diff --git a/limlee.h b/limlee.h index bccfccb..0131cb0 100644 --- a/limlee.h +++ b/limlee.h @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: limlee.h,v 1.2 2000/08/18 19:16:51 mdw Exp $ + * $Id: limlee.h,v 1.4 2001/02/03 11:59:07 mdw Exp $ * * Generate Lim-Lee primes * @@ -30,6 +30,14 @@ /*----- Revision history --------------------------------------------------* * * $Log: limlee.h,v $ + * Revision 1.4 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.3 2000/12/06 20:33:27 mdw + * Make flags be macros rather than enumerations, to ensure that they're + * unsigned. + * * Revision 1.2 2000/08/18 19:16:51 mdw * New stepper interface for constructing Lim-Lee primes. * @@ -78,6 +86,7 @@ typedef struct limlee_stepctx { void *pc; /* Context ptr for generator ops */ pgen_proc *iev; /* Event handler for inner @pgen@ */ void *iec; /* Context for inner @pgen@ */ + grand *r; /* Random number generator */ /* --- Output values --- */ @@ -87,7 +96,6 @@ typedef struct limlee_stepctx { /* --- Maintained internally --- */ octet *c; /* Combination byte-flag vector */ - grand *r; /* Random number generator */ unsigned long seq; /* Sequence number for primes */ size_t poolsz; /* Size of the small-prime pool */ dstr d; /* String for subprime name */ @@ -102,9 +110,7 @@ typedef struct limlee_primeops { /* --- Flags --- */ -enum { - LIMLEE_KEEPFACTORS = 1 -}; +#define LIMLEE_KEEPFACTORS 1u /*----- The Lim-Lee stepper function --------------------------------------*/