From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: emre@hasegeli.com, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ning Yu <nyu@pivotal.io>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: New Defects reported by Coverity Scan for PostgreSQL
Date: Wed, 1 Aug 2018 15:33:47 +0200
Message-ID: <5fece6c5-6a80-9694-1a24-3ae245ae2cba@2ndquadrant.com> (raw)
In-Reply-To: <CAE2gYzw6iD1YTZ+67hA=s3AG5sbLCsGkHRYQ_Z1Kd+vhiM7ecA@mail.gmail.com>
References: <E1fjZo1-00019i-GG@gemulon.postgresql.org>
<20180731172149.kdjl3xdjjtwxaj4s@alvherre.pgsql>
<CAKmaiL2o6584gLFP=6YX-MUqmvOiT==uny+LA8z3=uAnriuzXA@mail.gmail.com>
<26769.1533090136@sss.pgh.pa.us>
<CAE2gYzw6iD1YTZ+67hA=s3AG5sbLCsGkHRYQ_Z1Kd+vhiM7ecA@mail.gmail.com>
On 08/01/2018 11:55 AM, Emre Hasegeli wrote:
>> Or perhaps I have it backwards and "l1" and "l2" need to be swapped in
>> that description. But the mere fact that there is any question about
>> that means that the function is poorly documented and perhaps poorly
>> named as well. For that matter, is there a good reason why l1/l2
>> have those roles and not the reverse?
>
> Consistency. I organized all xxx_closept_yyy(Point *result, xxx *l1,
> yyy *l2) functions in a way that they find the find the point on "l1".
>
IMHO the main issue here is that the rule is not obvious / documented
anywhere. I think the best way to do that is by making it clear in a
comment for each such such function.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: tomas.vondra@2ndquadrant.com, tgl@sss.pgh.pa.us, nyu@pivotal.io, alvherre@2ndquadrant.com, pgsql-hackers@postgresql.org
Subject: Re: New Defects reported by Coverity Scan for PostgreSQL
In-Reply-To: <5fece6c5-6a80-9694-1a24-3ae245ae2cba@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox