bool abuse in path_encode()

Started by Peter Eisentrautalmost 13 years ago2 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

The function path_encode() in geo_ops.c takes an argument "bool closed",
to indicate an open or closed path --- but you can also pass -1 to
indicate "neither". I propose to change this to an enum to make the
code clearer and less weird.

Attachments:

path-encode-enum.patchtext/x-patch; charset=UTF-8; name=path-encode-enum.patchDownload+16-14
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: bool abuse in path_encode()

Peter Eisentraut <peter_e@gmx.net> writes:

The function path_encode() in geo_ops.c takes an argument "bool closed",
to indicate an open or closed path --- but you can also pass -1 to
indicate "neither".

Egad :-(.

I propose to change this to an enum to make the
code clearer and less weird.

Please change the "default" cases to be "case PATH_NONE", then.

regards, tom lane

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