X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/963a61481edc7a83698b18b518bf20cd93d268a6..85f15f07a01fc508f88fbbd2f1c3b61ec888cdd8:/pgen.c diff --git a/pgen.c b/pgen.c index 9ffd6fb..4758c78 100644 --- a/pgen.c +++ b/pgen.c @@ -1,13 +1,11 @@ /* -*-c-*- * - * $Id$ - * * Prime number generation * * (c) 2005 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of the Python interface to Catacomb. * @@ -15,12 +13,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * Catacomb/Python is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with Catacomb/Python; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -40,7 +38,7 @@ static PyObject *pfilt_pywrap(pfilt *f) o = PyObject_New(pfilt_pyobj, pfilt_pytype); o->f = *f; o->st = pfilt_step(f, 0); - return ((PyObject *)o); + return ((PyObject *)o); } static PyObject *pfilt_pymake(PyTypeObject *ty, PyObject *xobj) @@ -129,7 +127,7 @@ end: } static PyObject *pfilt_pylong(PyObject *me) - { return ((PyObject *)mp_topylong(PFILT_F(me)->m)); } + { return (mp_topylong(PFILT_F(me)->m)); } static PyObject *pfget_x(PyObject *me, void *hunoz) { return (mp_pywrap(MP_COPY(PFILT_F(me)->m))); } @@ -548,7 +546,7 @@ static int pgev_python(int rq, pgen_event *ev, void *p) goto end; else if (l < PGEN_ABORT || l > PGEN_PASS) VALERR("return code out of range"); - else + else st = l; end: if (pyev) { @@ -698,7 +696,7 @@ static PyObject *psget_step(PyObject *me, void *hunoz) static PyGetSetDef pgstep_pygetset[] = { #define GETSETNAME(op, name) ps##op##_##name - GET (step, "S.step -> step size for the stepper") + GET (step, "S.step -> step size for the stepper") #undef GETSETNAME { 0 } }; @@ -780,7 +778,7 @@ static PyObject *pjget_jump(PyObject *me, void *hunoz) static PyGetSetDef pgjump_pygetset[] = { #define GETSETNAME(op, name) pj##op##_##name - GET (jump, "S.jump -> jump size for the stepper") + GET (jump, "S.jump -> jump size for the stepper") #undef GETSETNAME { 0 } }; @@ -933,7 +931,7 @@ static PyObject *meth_pgen(PyObject *me, PyObject *arg, PyObject *kw) end: mp_drop(r); mp_drop(x); droppgev(&step); droppgev(&test); droppgev(&evt); - return (rc); + return (rc); } static PyObject *meth_strongprime_setup(PyObject *me, @@ -1035,10 +1033,10 @@ pgen(START, [name = 'p', stepper = PrimeGenStepper(2),\n\ nsteps = 0, ntests = RabinMiller.iters(START.nbits)]) -> P") KWMETH(strongprime_setup, "\ strongprime_setup(NBITS, [name = 'p', event = pgen_nullev,\n\ - rng = rand, nsteps = 0]) -> (START, JUMP)") + rng = rand, nsteps = 0]) -> (START, JUMP)") KWMETH(strongprime, "\ strongprime_setup(NBITS, [name = 'p', event = pgen_nullev,\n\ - rng = rand, nsteps = 0]) -> P") + rng = rand, nsteps = 0]) -> P") KWMETH(limlee, "\ limlee(PBITS, QBITS, [name = 'p', event = pgen_nullev,\n\ ievent = pgen_nullev, rng = rand, nsteps = 0]) -> (P, [Q, ...])")