[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.
signature.asc
Description: PGP signature
- [PATCH] src/: ceil_prime(): Add function to get the lowest prime not smaller than n, Alejandro Colomar, 2024/03/13
- [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n, Alejandro Colomar, 2024/03/13
- Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n, G. Branden Robinson, 2024/03/13
- Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n, G. Branden Robinson, 2024/03/13
- Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n,
Alejandro Colomar <=
- Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n, G. Branden Robinson, 2024/03/13
- Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n, Alejandro Colomar, 2024/03/13
- Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n, James K. Lowden, 2024/03/13
- Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n, G. Branden Robinson, 2024/03/13
- Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n, James K. Lowden, 2024/03/13
- Re: [PATCH v2] src/: ceil_prime(): Add function to get the lowest prime not smaller than n, Alejandro Colomar, 2024/03/13
[PATCH v3 2/9] [libgroff]: Remove dead code, Alejandro Colomar, 2024/03/15
[PATCH v3 3/9] src/: Remove redundant checks after strtol(3)., Alejandro Colomar, 2024/03/15
[PATCH v3 4/9] [grolbp]: Remove bogus (and redundant) check, Alejandro Colomar, 2024/03/15
[PATCH v3 0/9] strtol(3)-related fixes, Alejandro Colomar, 2024/03/15