Re: GinPageIs* don't actually return a boolean - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Re: GinPageIs* don't actually return a boolean
Date
Msg-id 56BE053F.5080002@sigaev.ru
Whole thread Raw
In response to Re: GinPageIs* don't actually return a boolean  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: GinPageIs* don't actually return a boolean
Re: GinPageIs* don't actually return a boolean
List 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 by date:

Previous
From: Robert Haas
Date:
Subject: Re: Clock with Adaptive Replacement
Next
From: Christian Ullrich
Date:
Subject: Crash with old Windows on new CPU