Re: [HACKERS] taking stdbool.h into use

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [HACKERS] taking stdbool.h into use
Дата
Msg-id CAB7nPqTVcZroQjeHhn+1fQzxzaaN2bWd4GXP80iGQ=KZ4q6amQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] taking stdbool.h into use  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: [HACKERS] taking stdbool.h into use  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Re: [HACKERS] taking stdbool.h into use  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
On Thu, Oct 26, 2017 at 9:25 AM, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
> Here is an updated patch set.  This is just a rebase of the previous
> set, no substantial changes.  Based on the discussion so far, I'm
> proposing that 0001 through 0007 could be ready to commit after review,
> whereas the remaining two need more work at some later time.

I had a look at this patch series. Patches 1, 2 (macos headers indeed
show that NSUNLINKMODULE_OPTION_NONE is set to 0x0), 3 to 7 look fine
to me.

I spotted a couple of other things while looking at your patches and
the code tree.

-   return (ginCompareItemPointers(&btree->itemptr, iptr) > 0) ? TRUE : FALSE;
+   return (ginCompareItemPointers(&btree->itemptr, iptr) > 0) ? true : false;
You could simplify that at the same time by removing such things. The
"false : true" pattern is less frequent than the "true : false"
pattern.

Some comments in the code still mention FALSE or TRUE:
- hashsearch.c uses FALSE in some comments.
- In execExpr.c, ExecCheck mentions TRUE.
- AggStateIsShared mentions TRUE and FALSE.
- In arrayfuncs.c, ReadArrayStr, CopyArrayEls and ReadArrayBinary use TRUE.

0009 looks like a good idea. It would make the code less confusing for
the reader to mention HAVE_STDBOOL_H in the #endif of c.h that you are
complicating to make the end of the block clear. I am lacking energy
for 0008, so I have no opinions to offer. Sorry :p
-- 
Michael


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: [HACKERS] MERGE SQL Statement for PG11
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] WIP: Restricting pg_rewind to data/wal dirs