summaryrefslogtreecommitdiff
path: root/src/backend/access/gin/ginvacuum.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-08-16 00:22:32 -0400
committerPeter Eisentraut <peter_e@gmx.net>2017-11-08 11:37:28 -0500
commit2eb4a831e5fb5d8fc17e13aea56e04af3efe27b4 (patch)
treeb46993cceb7cd8b848e39a45c1bb8c73dc67b221 /src/backend/access/gin/ginvacuum.c
parent4497f2f3b30fa5cd48898033c351bfcf01ce73e2 (diff)
Change TRUE/FALSE to true/false
The lower case spellings are C and C++ standard and are used in most parts of the PostgreSQL sources. The upper case spellings are only used in some files/modules. So standardize on the standard spellings. The APIs for ICU, Perl, and Windows define their own TRUE and FALSE, so those are left as is when using those APIs. In code comments, we use the lower-case spelling for the C concepts and keep the upper-case spelling for the SQL concepts. Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
Diffstat (limited to 'src/backend/access/gin/ginvacuum.c')
-rw-r--r--src/backend/access/gin/ginvacuum.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/backend/access/gin/ginvacuum.c b/src/backend/access/gin/ginvacuum.c
index 31425e9963e..a20a99c8140 100644
--- a/src/backend/access/gin/ginvacuum.c
+++ b/src/backend/access/gin/ginvacuum.c
@@ -235,7 +235,7 @@ ginScanToDelete(GinVacuumState *gvs, BlockNumber blkno, bool isRoot,
DataPageDeleteStack *me;
Buffer buffer;
Page page;
- bool meDelete = FALSE;
+ bool meDelete = false;
bool isempty;
if (isRoot)
@@ -274,7 +274,7 @@ ginScanToDelete(GinVacuumState *gvs, BlockNumber blkno, bool isRoot,
{
PostingItem *pitem = GinDataPageGetPostingItem(page, i);
- if (ginScanToDelete(gvs, PostingItemGetBlockNumber(pitem), FALSE, me, i))
+ if (ginScanToDelete(gvs, PostingItemGetBlockNumber(pitem), false, me, i))
i--;
}
}
@@ -291,7 +291,7 @@ ginScanToDelete(GinVacuumState *gvs, BlockNumber blkno, bool isRoot,
{
Assert(!isRoot);
ginDeletePage(gvs, blkno, me->leftBlkno, me->parent->blkno, myoff, me->parent->isRoot);
- meDelete = TRUE;
+ meDelete = true;
}
}
@@ -319,7 +319,7 @@ ginVacuumPostingTreeLeaves(GinVacuumState *gvs, BlockNumber blkno, bool isRoot)
{
Buffer buffer;
Page page;
- bool hasVoidPage = FALSE;
+ bool hasVoidPage = false;
MemoryContext oldCxt;
buffer = ReadBufferExtended(gvs->index, MAIN_FORKNUM, blkno,
@@ -339,7 +339,7 @@ ginVacuumPostingTreeLeaves(GinVacuumState *gvs, BlockNumber blkno, bool isRoot)
/* if root is a leaf page, we don't desire further processing */
if (GinDataLeafPageIsEmpty(page))
- hasVoidPage = TRUE;
+ hasVoidPage = true;
UnlockReleaseBuffer(buffer);
@@ -348,8 +348,8 @@ ginVacuumPostingTreeLeaves(GinVacuumState *gvs, BlockNumber blkno, bool isRoot)
else
{
OffsetNumber i;
- bool hasEmptyChild = FALSE;
- bool hasNonEmptyChild = FALSE;
+ bool hasEmptyChild = false;
+ bool hasNonEmptyChild = false;
OffsetNumber maxoff = GinPageGetOpaque(page)->maxoff;
BlockNumber *children = palloc(sizeof(BlockNumber) * (maxoff + 1));
@@ -369,10 +369,10 @@ ginVacuumPostingTreeLeaves(GinVacuumState *gvs, BlockNumber blkno, bool isRoot)
for (i = FirstOffsetNumber; i <= maxoff; i++)
{
- if (ginVacuumPostingTreeLeaves(gvs, children[i], FALSE))
- hasEmptyChild = TRUE;
+ if (ginVacuumPostingTreeLeaves(gvs, children[i], false))
+ hasEmptyChild = true;
else
- hasNonEmptyChild = TRUE;
+ hasNonEmptyChild = true;
}
pfree(children);
@@ -380,12 +380,12 @@ ginVacuumPostingTreeLeaves(GinVacuumState *gvs, BlockNumber blkno, bool isRoot)
vacuum_delay_point();
/*
- * All subtree is empty - just return TRUE to indicate that parent
+ * All subtree is empty - just return true to indicate that parent
* must do a cleanup. Unless we are ROOT an there is way to go upper.
*/
if (hasEmptyChild && !hasNonEmptyChild && !isRoot)
- return TRUE;
+ return true;
if (hasEmptyChild)
{
@@ -399,9 +399,9 @@ ginVacuumPostingTreeLeaves(GinVacuumState *gvs, BlockNumber blkno, bool isRoot)
memset(&root, 0, sizeof(DataPageDeleteStack));
root.leftBlkno = InvalidBlockNumber;
- root.isRoot = TRUE;
+ root.isRoot = true;
- ginScanToDelete(gvs, blkno, TRUE, &root, InvalidOffsetNumber);
+ ginScanToDelete(gvs, blkno, true, &root, InvalidOffsetNumber);
ptr = root.child;
@@ -416,14 +416,14 @@ ginVacuumPostingTreeLeaves(GinVacuumState *gvs, BlockNumber blkno, bool isRoot)
}
/* Here we have deleted all empty subtrees */
- return FALSE;
+ return false;
}
}
static void
ginVacuumPostingTree(GinVacuumState *gvs, BlockNumber rootBlkno)
{
- ginVacuumPostingTreeLeaves(gvs, rootBlkno, TRUE);
+ ginVacuumPostingTreeLeaves(gvs, rootBlkno, true);
}
/*