X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/4e5ba4306db8cb64a87ad37084c0bf64c03563e1..79bc45d029fd0283e76c3774070ec05710351ce9:/rand/lcrand.c diff --git a/rand/lcrand.c b/rand/lcrand.c index d8c4a378..f0f01ddf 100644 --- a/rand/lcrand.c +++ b/rand/lcrand.c @@ -33,6 +33,7 @@ #include #include +#include #include #include "grand.h" @@ -106,15 +107,11 @@ uint32 lcrand(uint32 x) /* --- Now reduce mod p --- * * - * I'm using shifts and adds to do the multiply step here. This needs to - * be changed if @D@ ever becomes something other than 5. + * I'm using shifts and adds to do the multiply step here. */ -#if D != 5 -# error "Change shift sequence!" -#endif - { + STATIC_ASSERT(D == 5, "Shift sequence doesn't match prime"); uint32 q; q = yy[1];