Re: GinPageIs* don't actually return a boolean

Поиск
Список
Период
Сортировка
От Teodor Sigaev
Тема Re: GinPageIs* don't actually return a boolean
Дата
Msg-id 56BE053F.5080002@sigaev.ru
обсуждение исходный текст
Ответ на Re: GinPageIs* don't actually return a boolean  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: GinPageIs* don't actually return a boolean  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: GinPageIs* don't actually return a boolean  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
One more option for patch:

#define GinPageIsLeaf(page)    ((bool)(GinPageGetOpaque(page)->flags & GIN_LEAF))

Seems it will work on any platform with built-in bool. But I don't know will it 
work with 'typedef char bool' if high bit will be set.

> That's true, but it doesn't really seem like a reason not to commit
> this patch.  I mean, the coding here is (a) dangerous by your own
> admission and (b) actually breaks on platforms for which we allege
> support.  If we find out that somebody has implemented an int-width
> bool we'll have some bigger decisions to make, but I don't see any
> particular reason why we've got to make those decisions now.

+1

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
  WWW: http://www.sigaev.ru/
 



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Clock with Adaptive Replacement
Следующее
От: Christian Ullrich
Дата:
Сообщение: Crash with old Windows on new CPU