Re: move some bitmapset.c macros to bitmapset.h - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: move some bitmapset.c macros to bitmapset.h
Date
Msg-id 20221205120549.vs2h4lg5jsh2tytt@alvherre.pgsql
Whole thread Raw
In response to move some bitmapset.c macros to bitmapset.h  (John Naylor <john.naylor@enterprisedb.com>)
Responses Re: move some bitmapset.c macros to bitmapset.h
List pgsql-hackers
On 2022-Dec-05, John Naylor wrote:

> diff --git a/src/backend/nodes/bitmapset.c b/src/backend/nodes/bitmapset.c
> index b7b274aeff..3204b49738 100644
> --- a/src/backend/nodes/bitmapset.c
> +++ b/src/backend/nodes/bitmapset.c
> @@ -26,33 +26,9 @@
>  #include "port/pg_bitutils.h"
>  
>  
> -#define WORDNUM(x)    ((x) / BITS_PER_BITMAPWORD)
> -#define BITNUM(x)    ((x) % BITS_PER_BITMAPWORD)

In this location, nobody can complain about the naming of these macros,
since they're just used to implement other bitmapset.c code.  However,
if you move them to the .h file, ISTM you should give them more
meaningful names.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Oh, great altar of passive entertainment, bestow upon me thy discordant images
at such speed as to render linear thought impossible" (Calvin a la TV)



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: move some bitmapset.c macros to bitmapset.h
Next
From: gkokolatos@pm.me
Date:
Subject: Re: Add LZ4 compression in pg_dump