groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime


From: Alejandro Colomar
Subject: Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n
Date: Wed, 13 Mar 2024 12:05:37 +0100

Hi Branden,

On Wed, Mar 13, 2024 at 05:46:38AM -0500, G. Branden Robinson wrote:
> Forgot to attach my working copy, of course.

You could have attached/inlined a diff; it would be smaller.  :)

> /* Copyright (C) 1989-2020 Free Software Foundation, Inc.
>      Written by James Clark (jjc@jclark.com)
> 
> This file is part of groff.
> 

[...]

>     case 'h':
>       {
>       int requested_hash_table_size;
>       check_integer_arg('h', optarg, 2, &requested_hash_table_size);

This is a breaking change.  My suggestion keeps accepting 1, with a
warning --as before--, and translates it to 2 (instead of 3, which was
being done previously).

So, I don't like this change, I think, unless you *want* to break 1,
which I'm neutral to, since I don't know what this program does at all.

Cheers,
Alex

>       hash_table_size = requested_hash_table_size;
>       if ((hash_table_size > 2) && (hash_table_size % 2) == 0)
>               hash_table_size++;
>       while (!is_prime(hash_table_size))
>         hash_table_size += 2;
>       if (hash_table_size != requested_hash_table_size)
>         warning("requested hash table size %1 is not prime: using %2"
>                 " instead", optarg, hash_table_size);
>       debug("using hash table size of %1", hash_table_size);
>       }
>       break;

-- 
<https://www.alejandro-colomar.es/>
Looking for a remote C programming job at the moment.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]