mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
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>
This commit is contained in:
@ -342,7 +342,7 @@ gin_bool_consistent(QUERYTYPE *query, bool *check)
|
||||
j = 0;
|
||||
|
||||
if (query->size <= 0)
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
/*
|
||||
* Set up data for checkcondition_gin. This must agree with the query
|
||||
|
@ -116,7 +116,7 @@ ginint4_consistent(PG_FUNCTION_ARGS)
|
||||
|
||||
/* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
|
||||
bool *recheck = (bool *) PG_GETARG_POINTER(5);
|
||||
bool res = FALSE;
|
||||
bool res = false;
|
||||
int32 i;
|
||||
|
||||
switch (strategy)
|
||||
@ -125,25 +125,25 @@ ginint4_consistent(PG_FUNCTION_ARGS)
|
||||
/* result is not lossy */
|
||||
*recheck = false;
|
||||
/* at least one element in check[] is true, so result = true */
|
||||
res = TRUE;
|
||||
res = true;
|
||||
break;
|
||||
case RTContainedByStrategyNumber:
|
||||
case RTOldContainedByStrategyNumber:
|
||||
/* we will need recheck */
|
||||
*recheck = true;
|
||||
/* at least one element in check[] is true, so result = true */
|
||||
res = TRUE;
|
||||
res = true;
|
||||
break;
|
||||
case RTSameStrategyNumber:
|
||||
/* we will need recheck */
|
||||
*recheck = true;
|
||||
/* Must have all elements in check[] true */
|
||||
res = TRUE;
|
||||
res = true;
|
||||
for (i = 0; i < nkeys; i++)
|
||||
{
|
||||
if (!check[i])
|
||||
{
|
||||
res = FALSE;
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -153,12 +153,12 @@ ginint4_consistent(PG_FUNCTION_ARGS)
|
||||
/* result is not lossy */
|
||||
*recheck = false;
|
||||
/* Must have all elements in check[] true */
|
||||
res = TRUE;
|
||||
res = true;
|
||||
for (i = 0; i < nkeys; i++)
|
||||
{
|
||||
if (!check[i])
|
||||
{
|
||||
res = FALSE;
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ PG_FUNCTION_INFO_V1(g_int_same);
|
||||
/*
|
||||
** The GiST Consistent method for _intments
|
||||
** Should return false if for all data items x below entry,
|
||||
** the predicate x op query == FALSE, where op is the oper
|
||||
** the predicate x op query == false, where op is the oper
|
||||
** corresponding to strategy in the pg_amop table.
|
||||
*/
|
||||
Datum
|
||||
@ -89,7 +89,7 @@ g_int_consistent(PG_FUNCTION_ARGS)
|
||||
query);
|
||||
break;
|
||||
default:
|
||||
retval = FALSE;
|
||||
retval = false;
|
||||
}
|
||||
pfree(query);
|
||||
PG_RETURN_BOOL(retval);
|
||||
@ -159,7 +159,7 @@ g_int_compress(PG_FUNCTION_ARGS)
|
||||
|
||||
retval = palloc(sizeof(GISTENTRY));
|
||||
gistentryinit(*retval, PointerGetDatum(r),
|
||||
entry->rel, entry->page, entry->offset, FALSE);
|
||||
entry->rel, entry->page, entry->offset, false);
|
||||
|
||||
PG_RETURN_POINTER(retval);
|
||||
}
|
||||
@ -206,7 +206,7 @@ g_int_compress(PG_FUNCTION_ARGS)
|
||||
r = resize_intArrayType(r, len);
|
||||
retval = palloc(sizeof(GISTENTRY));
|
||||
gistentryinit(*retval, PointerGetDatum(r),
|
||||
entry->rel, entry->page, entry->offset, FALSE);
|
||||
entry->rel, entry->page, entry->offset, false);
|
||||
PG_RETURN_POINTER(retval);
|
||||
}
|
||||
else
|
||||
@ -236,7 +236,7 @@ g_int_decompress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
retval = palloc(sizeof(GISTENTRY));
|
||||
gistentryinit(*retval, PointerGetDatum(in),
|
||||
entry->rel, entry->page, entry->offset, FALSE);
|
||||
entry->rel, entry->page, entry->offset, false);
|
||||
PG_RETURN_POINTER(retval);
|
||||
}
|
||||
|
||||
@ -251,7 +251,7 @@ g_int_decompress(PG_FUNCTION_ARGS)
|
||||
{
|
||||
retval = palloc(sizeof(GISTENTRY));
|
||||
gistentryinit(*retval, PointerGetDatum(in),
|
||||
entry->rel, entry->page, entry->offset, FALSE);
|
||||
entry->rel, entry->page, entry->offset, false);
|
||||
|
||||
PG_RETURN_POINTER(retval);
|
||||
}
|
||||
@ -273,7 +273,7 @@ g_int_decompress(PG_FUNCTION_ARGS)
|
||||
pfree(in);
|
||||
retval = palloc(sizeof(GISTENTRY));
|
||||
gistentryinit(*retval, PointerGetDatum(r),
|
||||
entry->rel, entry->page, entry->offset, FALSE);
|
||||
entry->rel, entry->page, entry->offset, false);
|
||||
|
||||
PG_RETURN_POINTER(retval);
|
||||
}
|
||||
@ -321,14 +321,14 @@ g_int_same(PG_FUNCTION_ARGS)
|
||||
*result = false;
|
||||
PG_RETURN_POINTER(result);
|
||||
}
|
||||
*result = TRUE;
|
||||
*result = true;
|
||||
da = ARRPTR(a);
|
||||
db = ARRPTR(b);
|
||||
while (n--)
|
||||
{
|
||||
if (*da++ != *db++)
|
||||
{
|
||||
*result = FALSE;
|
||||
*result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -74,19 +74,19 @@ _int_same(PG_FUNCTION_ARGS)
|
||||
da = ARRPTR(a);
|
||||
db = ARRPTR(b);
|
||||
|
||||
result = FALSE;
|
||||
result = false;
|
||||
|
||||
if (na == nb)
|
||||
{
|
||||
SORT(a);
|
||||
SORT(b);
|
||||
result = TRUE;
|
||||
result = true;
|
||||
|
||||
for (n = 0; n < na; n++)
|
||||
{
|
||||
if (da[n] != db[n])
|
||||
{
|
||||
result = FALSE;
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -110,7 +110,7 @@ _int_overlap(PG_FUNCTION_ARGS)
|
||||
CHECKARRVALID(a);
|
||||
CHECKARRVALID(b);
|
||||
if (ARRISEMPTY(a) || ARRISEMPTY(b))
|
||||
return FALSE;
|
||||
return false;
|
||||
|
||||
SORT(a);
|
||||
SORT(b);
|
||||
|
@ -40,7 +40,7 @@ inner_int_contains(ArrayType *a, ArrayType *b)
|
||||
break; /* db[j] is not in da */
|
||||
}
|
||||
|
||||
return (n == nb) ? TRUE : FALSE;
|
||||
return (n == nb) ? true : false;
|
||||
}
|
||||
|
||||
/* arguments are assumed sorted */
|
||||
@ -65,12 +65,12 @@ inner_int_overlap(ArrayType *a, ArrayType *b)
|
||||
if (da[i] < db[j])
|
||||
i++;
|
||||
else if (da[i] == db[j])
|
||||
return TRUE;
|
||||
return true;
|
||||
else
|
||||
j++;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
ArrayType *
|
||||
|
@ -168,7 +168,7 @@ g_intbig_compress(PG_FUNCTION_ARGS)
|
||||
retval = (GISTENTRY *) palloc(sizeof(GISTENTRY));
|
||||
gistentryinit(*retval, PointerGetDatum(res),
|
||||
entry->rel, entry->page,
|
||||
entry->offset, FALSE);
|
||||
entry->offset, false);
|
||||
|
||||
if (in != DatumGetArrayTypeP(entry->key))
|
||||
pfree(in);
|
||||
@ -195,7 +195,7 @@ g_intbig_compress(PG_FUNCTION_ARGS)
|
||||
retval = (GISTENTRY *) palloc(sizeof(GISTENTRY));
|
||||
gistentryinit(*retval, PointerGetDatum(res),
|
||||
entry->rel, entry->page,
|
||||
entry->offset, FALSE);
|
||||
entry->offset, false);
|
||||
|
||||
PG_RETURN_POINTER(retval);
|
||||
}
|
||||
@ -594,7 +594,7 @@ g_intbig_consistent(PG_FUNCTION_ARGS)
|
||||
retval = _intbig_overlap((GISTTYPE *) DatumGetPointer(entry->key), query);
|
||||
break;
|
||||
default:
|
||||
retval = FALSE;
|
||||
retval = false;
|
||||
}
|
||||
PG_FREE_IF_COPY(query, 1);
|
||||
PG_RETURN_BOOL(retval);
|
||||
|
Reference in New Issue
Block a user