From: | Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> |
---|---|
To: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com> |
Subject: | Re: taking stdbool.h into use |
Date: | 2017-11-08 16:46:45 |
Message-ID: | 49f03ac5-d8c1-91d6-8be3-b317163617f2@2ndquadrant.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 10/29/17 08:50, Michael Paquier wrote:
> 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.
Committed 4 and 5 together.
> 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.
I have found many more instances like that. It might be worth
simplifying a bit, but that sounds like a separate undertaking.
> Some comments in the code still mention FALSE or TRUE:
> - hashsearch.c uses FALSE in some comments.
> - In execExpr.c, ExecCheck mentions TRUE.
That one is an SQL TRUE, so I left it.
> - AggStateIsShared mentions TRUE and FALSE.
> - In arrayfuncs.c, ReadArrayStr, CopyArrayEls and ReadArrayBinary use TRUE.
Fixed the other ones.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2017-11-08 17:02:40 | Re: Small improvement to compactify_tuples |
Previous Message | Claudio Freire | 2017-11-08 16:29:15 | Re: Small improvement to compactify_tuples |