Moving LOOP_ON_SIEVE_* macros to gmp-impl.h

Seth Troisi braintwo at gmail.com
Mon Mar 16 03:36:52 UTC 2020


Per Marco's comments in my prev_prime/next_prime patch
I moved some of the primesieve macros and functions to gmp-impl.h

LOOP_ON_SIEVE_BEGIN
LOOP_ON_SIEVE_CONTINUE
LOOP_ON_SIEVE_STOP
LOOP_ON_SIEVE_END
bit_to_n (renamed sieve_bit_to_n)
id_to_n (renamedi sieve_id_to_n)
n_to_bit (renamed sieve_n_to_bit)
primesieve_size

This allows the four (soon to be five) identical copies in
bin_uiui, oddfac_1, primorial_ui, and tests/devel/primes
to be cleaned up.

It's not clear where this should be documented, if someone tells me I'm
happy to add some documentation. Existing gmp_primesieve_t in gmp-impl.h
doesn't have any documentation so maybe no entry in the manual or maybe
they should both go under "Integer special functions" or a new "Integer
prime functions" section.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LOOP_ON_S_macros.patch
Type: text/x-patch
Size: 13103 bytes
Desc: not available
URL: <https://gmplib.org/list-archives/gmp-devel/attachments/20200315/6926dee9/attachment.bin>


More information about the gmp-devel mailing list