Re: magic constant -1

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: magic constant -1
Дата
Msg-id 162867790911052118r855502erd950a8a914c0a5dc@mail.gmail.com
обсуждение исходный текст
Ответ на Re: magic constant -1  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
2009/11/5 Tom Lane <tgl@sss.pgh.pa.us>:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
>> we use a value -1 as two values: a) unknown typmod, b) unknown
>> location. Can we substitute it by some better identifier?
>
>> Maybe: UnknownTmod, UnknownLoc ... UnspecTmd, UnspecLoc???
>
> Doesn't really seem worth the trouble, especially since the checks
> for "unspecified" are coded as negative/nonnegative rather than
> simple equality.

I worked on enhancing an area where typmod is used, and I had a small
problem - because it wasn't simply clean, where -1 is typmod or
location.

This should be an idea for enhancing and increasing code quality. -1
is probably last wide used magic constant in pg.

Pavel


>
>                        regards, tom lane
>


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

Предыдущее
От: abindra@u.washington.edu
Дата:
Сообщение: Freebsd & autoconf-2.63
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Why do OLD and NEW have special internal names?