From ac2b09b16c7c0346bb0e020a392ba6700ec90754 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 16 Aug 2017 00:22:32 -0400 Subject: [PATCH v2 4/9] 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. --- contrib/btree_gist/btree_bit.c | 6 +- contrib/btree_gist/btree_bytea.c | 2 +- contrib/btree_gist/btree_inet.c | 2 +- contrib/btree_gist/btree_interval.c | 4 +- contrib/btree_gist/btree_numeric.c | 2 +- contrib/btree_gist/btree_text.c | 4 +- contrib/btree_gist/btree_time.c | 2 +- contrib/btree_gist/btree_ts.c | 2 +- contrib/btree_gist/btree_utils_num.c | 4 +- contrib/btree_gist/btree_utils_var.c | 12 +- contrib/btree_gist/btree_uuid.c | 2 +- contrib/cube/cube.c | 36 ++-- contrib/dblink/dblink.c | 6 +- contrib/fuzzystrmatch/fuzzystrmatch.c | 2 +- contrib/hstore/hstore_gist.c | 10 +- contrib/intarray/_int_bool.c | 2 +- contrib/intarray/_int_gin.c | 14 +- contrib/intarray/_int_gist.c | 18 +- contrib/intarray/_int_op.c | 8 +- contrib/intarray/_int_tool.c | 6 +- contrib/intarray/_intbig_gist.c | 6 +- contrib/ltree/_ltree_gist.c | 4 +- contrib/ltree/ltree_gist.c | 4 +- contrib/pg_trgm/trgm_gist.c | 4 +- contrib/seg/seg.c | 10 +- doc/src/sgml/gin.sgml | 28 +-- doc/src/sgml/indexam.sgml | 26 +-- doc/src/sgml/libpq.sgml | 4 +- doc/src/sgml/spgist.sgml | 2 +- doc/src/sgml/sslinfo.sgml | 6 +- src/backend/access/gin/ginbtree.c | 4 +- src/backend/access/gin/ginbulk.c | 6 +- src/backend/access/gin/gindatapage.c | 14 +- src/backend/access/gin/ginentrypage.c | 16 +- src/backend/access/gin/ginget.c | 40 ++-- src/backend/access/gin/gininsert.c | 4 +- src/backend/access/gin/ginvacuum.c | 32 ++-- src/backend/access/gist/gist.c | 4 +- src/backend/access/gist/gistget.c | 4 +- src/backend/access/gist/gistproc.c | 16 +- src/backend/access/gist/gistsplit.c | 38 ++-- src/backend/access/gist/gistutil.c | 24 +-- src/backend/commands/tablecmds.c | 14 +- src/backend/executor/nodeAgg.c | 2 +- src/backend/executor/nodeAppend.c | 8 +- src/backend/executor/nodeGroup.c | 8 +- src/backend/optimizer/util/predtest.c | 32 ++-- src/backend/parser/gram.y | 294 ++++++++++++++--------------- src/backend/parser/parse_utilcmd.c | 8 +- src/backend/replication/repl_gram.y | 18 +- src/backend/storage/buffer/bufmgr.c | 26 +-- src/backend/storage/buffer/localbuf.c | 6 +- src/backend/storage/ipc/shmem.c | 8 +- src/backend/storage/ipc/shmqueue.c | 8 +- src/backend/storage/lmgr/lock.c | 26 +-- src/backend/utils/adt/datetime.c | 50 ++--- src/backend/utils/adt/formatting.c | 272 +++++++++++++------------- src/backend/utils/adt/geo_ops.c | 12 +- src/backend/utils/adt/network_gist.c | 6 +- src/backend/utils/adt/numeric.c | 10 +- src/backend/utils/adt/tsginidx.c | 2 +- src/backend/utils/adt/tsgistidx.c | 6 +- src/backend/utils/adt/tsquery_gist.c | 4 +- src/backend/utils/misc/guc.c | 18 +- src/interfaces/ecpg/ecpglib/misc.c | 4 +- src/interfaces/ecpg/pgtypeslib/datetime.c | 4 +- src/interfaces/ecpg/pgtypeslib/dt_common.c | 16 +- src/interfaces/ecpg/pgtypeslib/interval.c | 16 +- src/interfaces/ecpg/pgtypeslib/numeric.c | 6 +- src/interfaces/ecpg/preproc/pgc.l | 24 +-- src/interfaces/libpq/fe-connect.c | 28 +-- src/interfaces/libpq/fe-exec.c | 86 ++++----- src/interfaces/libpq/fe-misc.c | 2 +- src/interfaces/libpq/fe-protocol2.c | 12 +- src/interfaces/libpq/fe-protocol3.c | 12 +- src/interfaces/libpq/libpq-events.c | 34 ++-- src/pl/plpgsql/src/pl_exec.c | 8 +- 77 files changed, 765 insertions(+), 765 deletions(-) diff --git a/contrib/btree_gist/btree_bit.c b/contrib/btree_gist/btree_bit.c index a56a2752a7..2225244ded 100644 --- a/contrib/btree_gist/btree_bit.c +++ b/contrib/btree_gist/btree_bit.c @@ -111,7 +111,7 @@ static const gbtree_vinfo tinfo = { gbt_t_bit, 0, - TRUE, + true, gbt_bitgt, gbt_bitge, gbt_biteq, @@ -152,13 +152,13 @@ gbt_bit_consistent(PG_FUNCTION_ARGS) if (GIST_LEAF(entry)) retval = gbt_var_consistent(&r, query, strategy, PG_GET_COLLATION(), - TRUE, &tinfo, fcinfo->flinfo); + true, &tinfo, fcinfo->flinfo); else { bytea *q = gbt_bit_xfrm((bytea *) query); retval = gbt_var_consistent(&r, q, strategy, PG_GET_COLLATION(), - FALSE, &tinfo, fcinfo->flinfo); + false, &tinfo, fcinfo->flinfo); } PG_RETURN_BOOL(retval); } diff --git a/contrib/btree_gist/btree_bytea.c b/contrib/btree_gist/btree_bytea.c index 00753e7f48..6b005f0157 100644 --- a/contrib/btree_gist/btree_bytea.c +++ b/contrib/btree_gist/btree_bytea.c @@ -75,7 +75,7 @@ static const gbtree_vinfo tinfo = { gbt_t_bytea, 0, - TRUE, + true, gbt_byteagt, gbt_byteage, gbt_byteaeq, diff --git a/contrib/btree_gist/btree_inet.c b/contrib/btree_gist/btree_inet.c index b5b593f77f..86c27ca955 100644 --- a/contrib/btree_gist/btree_inet.c +++ b/contrib/btree_gist/btree_inet.c @@ -105,7 +105,7 @@ gbt_inet_compress(PG_FUNCTION_ARGS) r->upper = r->lower; gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } else retval = entry; diff --git a/contrib/btree_gist/btree_interval.c b/contrib/btree_gist/btree_interval.c index 61ab478c42..3a527a75fa 100644 --- a/contrib/btree_gist/btree_interval.c +++ b/contrib/btree_gist/btree_interval.c @@ -169,7 +169,7 @@ gbt_intv_compress(PG_FUNCTION_ARGS) } gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } PG_RETURN_POINTER(retval); @@ -201,7 +201,7 @@ gbt_intv_decompress(PG_FUNCTION_ARGS) gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } PG_RETURN_POINTER(retval); } diff --git a/contrib/btree_gist/btree_numeric.c b/contrib/btree_gist/btree_numeric.c index 43793d36a2..b72060cdb6 100644 --- a/contrib/btree_gist/btree_numeric.c +++ b/contrib/btree_gist/btree_numeric.c @@ -79,7 +79,7 @@ static const gbtree_vinfo tinfo = { gbt_t_numeric, 0, - FALSE, + false, gbt_numeric_gt, gbt_numeric_ge, gbt_numeric_eq, diff --git a/contrib/btree_gist/btree_text.c b/contrib/btree_gist/btree_text.c index 090c849470..79ffac2685 100644 --- a/contrib/btree_gist/btree_text.c +++ b/contrib/btree_gist/btree_text.c @@ -80,7 +80,7 @@ static gbtree_vinfo tinfo = { gbt_t_text, 0, - FALSE, + false, gbt_textgt, gbt_textge, gbt_texteq, @@ -128,7 +128,7 @@ gbt_bpchar_compress(PG_FUNCTION_ARGS) gistentryinit(trim, d, entry->rel, entry->page, - entry->offset, TRUE); + entry->offset, true); retval = gbt_var_compress(&trim, &tinfo); } else diff --git a/contrib/btree_gist/btree_time.c b/contrib/btree_gist/btree_time.c index bb239d4986..90cf6554ea 100644 --- a/contrib/btree_gist/btree_time.c +++ b/contrib/btree_gist/btree_time.c @@ -183,7 +183,7 @@ gbt_timetz_compress(PG_FUNCTION_ARGS) r->lower = r->upper = tmp; gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } else retval = entry; diff --git a/contrib/btree_gist/btree_ts.c b/contrib/btree_gist/btree_ts.c index 1582cff102..18740cad38 100644 --- a/contrib/btree_gist/btree_ts.c +++ b/contrib/btree_gist/btree_ts.c @@ -230,7 +230,7 @@ gbt_tstz_compress(PG_FUNCTION_ARGS) r->lower = r->upper = gmt; gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } else retval = entry; diff --git a/contrib/btree_gist/btree_utils_num.c b/contrib/btree_gist/btree_utils_num.c index c2faf8b25a..29b0faf997 100644 --- a/contrib/btree_gist/btree_utils_num.c +++ b/contrib/btree_gist/btree_utils_num.c @@ -86,7 +86,7 @@ gbt_num_compress(GISTENTRY *entry, const gbtree_ninfo *tinfo) memcpy((void *) &r[tinfo->size], leaf, tinfo->size); retval = palloc(sizeof(GISTENTRY)); gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } else retval = entry; @@ -150,7 +150,7 @@ gbt_num_fetch(GISTENTRY *entry, const gbtree_ninfo *tinfo) retval = palloc(sizeof(GISTENTRY)); gistentryinit(*retval, datum, entry->rel, entry->page, entry->offset, - FALSE); + false); return retval; } diff --git a/contrib/btree_gist/btree_utils_var.c b/contrib/btree_gist/btree_utils_var.c index 586de63a4d..339b4a3031 100644 --- a/contrib/btree_gist/btree_utils_var.c +++ b/contrib/btree_gist/btree_utils_var.c @@ -45,7 +45,7 @@ gbt_var_decompress(PG_FUNCTION_ARGS) gistentryinit(*retval, PointerGetDatum(key), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); PG_RETURN_POINTER(retval); } @@ -169,7 +169,7 @@ gbt_var_node_cp_len(const GBT_VARKEY *node, const gbtree_vinfo *tinfo) static bool gbt_bytea_pf_match(const bytea *pf, const bytea *query, const gbtree_vinfo *tinfo) { - bool out = FALSE; + bool out = false; int32 qlen = VARSIZE(query) - VARHDRSZ; int32 nlen = VARSIZE(pf) - VARHDRSZ; @@ -294,7 +294,7 @@ gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo *tinfo) retval = palloc(sizeof(GISTENTRY)); gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, - entry->offset, TRUE); + entry->offset, true); } else retval = entry; @@ -314,7 +314,7 @@ gbt_var_fetch(PG_FUNCTION_ARGS) retval = palloc(sizeof(GISTENTRY)); gistentryinit(*retval, PointerGetDatum(r.lower), entry->rel, entry->page, - entry->offset, TRUE); + entry->offset, true); PG_RETURN_POINTER(retval); } @@ -561,7 +561,7 @@ gbt_var_consistent(GBT_VARKEY_R *key, const gbtree_vinfo *tinfo, FmgrInfo *flinfo) { - bool retval = FALSE; + bool retval = false; switch (strategy) { @@ -607,7 +607,7 @@ gbt_var_consistent(GBT_VARKEY_R *key, tinfo->f_eq(query, key->upper, collation, flinfo)); break; default: - retval = FALSE; + retval = false; } return retval; diff --git a/contrib/btree_gist/btree_uuid.c b/contrib/btree_gist/btree_uuid.c index ecf357d662..bbed16a852 100644 --- a/contrib/btree_gist/btree_uuid.c +++ b/contrib/btree_gist/btree_uuid.c @@ -114,7 +114,7 @@ gbt_uuid_compress(PG_FUNCTION_ARGS) memcpy((void *) (r + UUID_LEN), (void *) key, UUID_LEN); gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } else retval = entry; diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c index 1032b997f9..1aec820f3a 100644 --- a/contrib/cube/cube.c +++ b/contrib/cube/cube.c @@ -309,7 +309,7 @@ cube_out(PG_FUNCTION_ARGS) /* ** The GiST Consistent method for boxes ** 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 @@ -396,7 +396,7 @@ g_cube_decompress(PG_FUNCTION_ARGS) gistentryinit(*retval, PointerGetDatum(key), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); PG_RETURN_POINTER(retval); } PG_RETURN_POINTER(entry); @@ -589,9 +589,9 @@ g_cube_same(PG_FUNCTION_ARGS) bool *result = (bool *) PG_GETARG_POINTER(2); if (cube_cmp_v0(b1, b2) == 0) - *result = TRUE; + *result = true; else - *result = FALSE; + *result = false; PG_RETURN_NDBOX(result); } @@ -623,7 +623,7 @@ g_cube_leaf_consistent(NDBOX *key, retval = cube_contains_v0(query, key); break; default: - retval = FALSE; + retval = false; } return retval; } @@ -650,7 +650,7 @@ g_cube_internal_consistent(NDBOX *key, retval = (bool) cube_overlap_v0(key, query); break; default: - retval = FALSE; + retval = false; } return retval; } @@ -1058,7 +1058,7 @@ cube_contains_v0(NDBOX *a, NDBOX *b) int i; if ((a == NULL) || (b == NULL)) - return FALSE; + return false; if (DIM(a) < DIM(b)) { @@ -1070,9 +1070,9 @@ cube_contains_v0(NDBOX *a, NDBOX *b) for (i = DIM(a); i < DIM(b); i++) { if (LL_COORD(b, i) != 0) - return FALSE; + return false; if (UR_COORD(b, i) != 0) - return FALSE; + return false; } } @@ -1081,13 +1081,13 @@ cube_contains_v0(NDBOX *a, NDBOX *b) { if (Min(LL_COORD(a, i), UR_COORD(a, i)) > Min(LL_COORD(b, i), UR_COORD(b, i))) - return FALSE; + return false; if (Max(LL_COORD(a, i), UR_COORD(a, i)) < Max(LL_COORD(b, i), UR_COORD(b, i))) - return FALSE; + return false; } - return TRUE; + return true; } Datum @@ -1128,7 +1128,7 @@ cube_overlap_v0(NDBOX *a, NDBOX *b) int i; if ((a == NULL) || (b == NULL)) - return FALSE; + return false; /* swap the box pointers if needed */ if (DIM(a) < DIM(b)) @@ -1143,21 +1143,21 @@ cube_overlap_v0(NDBOX *a, NDBOX *b) for (i = 0; i < DIM(b); i++) { if (Min(LL_COORD(a, i), UR_COORD(a, i)) > Max(LL_COORD(b, i), UR_COORD(b, i))) - return FALSE; + return false; if (Max(LL_COORD(a, i), UR_COORD(a, i)) < Min(LL_COORD(b, i), UR_COORD(b, i))) - return FALSE; + return false; } /* compare to zero those dimensions in (a) absent in (b) */ for (i = DIM(b); i < DIM(a); i++) { if (Min(LL_COORD(a, i), UR_COORD(a, i)) > 0) - return FALSE; + return false; if (Max(LL_COORD(a, i), UR_COORD(a, i)) < 0) - return FALSE; + return false; } - return TRUE; + return true; } diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c index 7dc7716a3a..a7e22b378a 100644 --- a/contrib/dblink/dblink.c +++ b/contrib/dblink/dblink.c @@ -243,7 +243,7 @@ dblink_init(void) pconn = (remoteConn *) MemoryContextAlloc(TopMemoryContext, sizeof(remoteConn)); pconn->conn = NULL; pconn->openCursorCount = 0; - pconn->newXactForCursor = FALSE; + pconn->newXactForCursor = false; } } @@ -423,7 +423,7 @@ dblink_open(PG_FUNCTION_ARGS) if (PQresultStatus(res) != PGRES_COMMAND_OK) dblink_res_internalerror(conn, res, "begin error"); PQclear(res); - rconn->newXactForCursor = TRUE; + rconn->newXactForCursor = true; /* * Since transaction state was IDLE, we force cursor count to @@ -523,7 +523,7 @@ dblink_close(PG_FUNCTION_ARGS) /* if count is zero, commit the transaction */ if (rconn->openCursorCount == 0) { - rconn->newXactForCursor = FALSE; + rconn->newXactForCursor = false; res = PQexec(conn, "COMMIT"); if (PQresultStatus(res) != PGRES_COMMAND_OK) diff --git a/contrib/fuzzystrmatch/fuzzystrmatch.c b/contrib/fuzzystrmatch/fuzzystrmatch.c index 5b98adfa0c..f6341c84cf 100644 --- a/contrib/fuzzystrmatch/fuzzystrmatch.c +++ b/contrib/fuzzystrmatch/fuzzystrmatch.c @@ -87,7 +87,7 @@ soundex_code(char letter) phoned_word -- The final phonized word. (We'll allocate the memory.) Output - error -- A simple error flag, returns TRUE or FALSE + error -- A simple error flag, returns true or false NOTES: ALL non-alpha characters are ignored, this includes whitespace, although non-alpha characters will break up phonemes. diff --git a/contrib/hstore/hstore_gist.c b/contrib/hstore/hstore_gist.c index f8f5934e40..c8fc1f9d9e 100644 --- a/contrib/hstore/hstore_gist.c +++ b/contrib/hstore/hstore_gist.c @@ -144,7 +144,7 @@ ghstore_compress(PG_FUNCTION_ARGS) gistentryinit(*retval, PointerGetDatum(res), entry->rel, entry->page, entry->offset, - FALSE); + false); } else if (!ISALLTRUE(DatumGetPointer(entry->key))) { @@ -166,7 +166,7 @@ ghstore_compress(PG_FUNCTION_ARGS) gistentryinit(*retval, PointerGetDatum(res), entry->rel, entry->page, entry->offset, - FALSE); + false); } PG_RETURN_POINTER(retval); @@ -570,7 +570,7 @@ ghstore_consistent(PG_FUNCTION_ARGS) continue; crc = crc32_sz(VARDATA(key_datums[i]), VARSIZE(key_datums[i]) - VARHDRSZ); if (!(GETBIT(sign, HASHVAL(crc)))) - res = FALSE; + res = false; } } else if (strategy == HStoreExistsAnyStrategyNumber) @@ -585,7 +585,7 @@ ghstore_consistent(PG_FUNCTION_ARGS) TEXTOID, -1, false, 'i', &key_datums, &key_nulls, &key_count); - res = FALSE; + res = false; for (i = 0; !res && i < key_count; ++i) { @@ -595,7 +595,7 @@ ghstore_consistent(PG_FUNCTION_ARGS) continue; crc = crc32_sz(VARDATA(key_datums[i]), VARSIZE(key_datums[i]) - VARHDRSZ); if (GETBIT(sign, HASHVAL(crc))) - res = TRUE; + res = true; } } else diff --git a/contrib/intarray/_int_bool.c b/contrib/intarray/_int_bool.c index 01e47c53d0..91e2a804f2 100644 --- a/contrib/intarray/_int_bool.c +++ b/contrib/intarray/_int_bool.c @@ -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 diff --git a/contrib/intarray/_int_gin.c b/contrib/intarray/_int_gin.c index 73628bea11..7aebfec54b 100644 --- a/contrib/intarray/_int_gin.c +++ b/contrib/intarray/_int_gin.c @@ -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; } } diff --git a/contrib/intarray/_int_gist.c b/contrib/intarray/_int_gist.c index 79521b29b0..911d18023b 100644 --- a/contrib/intarray/_int_gist.c +++ b/contrib/intarray/_int_gist.c @@ -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; } } diff --git a/contrib/intarray/_int_op.c b/contrib/intarray/_int_op.c index 3637c4564c..fe7fcc4662 100644 --- a/contrib/intarray/_int_op.c +++ b/contrib/intarray/_int_op.c @@ -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); diff --git a/contrib/intarray/_int_tool.c b/contrib/intarray/_int_tool.c index 2fdfd2ec63..ee8fb64a47 100644 --- a/contrib/intarray/_int_tool.c +++ b/contrib/intarray/_int_tool.c @@ -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 * diff --git a/contrib/intarray/_intbig_gist.c b/contrib/intarray/_intbig_gist.c index 6dae7c91c1..de7bc82a23 100644 --- a/contrib/intarray/_intbig_gist.c +++ b/contrib/intarray/_intbig_gist.c @@ -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); diff --git a/contrib/ltree/_ltree_gist.c b/contrib/ltree/_ltree_gist.c index a387f5b899..77efa2fdeb 100644 --- a/contrib/ltree/_ltree_gist.c +++ b/contrib/ltree/_ltree_gist.c @@ -100,7 +100,7 @@ _ltree_compress(PG_FUNCTION_ARGS) retval = (GISTENTRY *) palloc(sizeof(GISTENTRY)); gistentryinit(*retval, PointerGetDatum(key), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } else if (!LTG_ISALLTRUE(entry->key)) { @@ -123,7 +123,7 @@ _ltree_compress(PG_FUNCTION_ARGS) retval = (GISTENTRY *) palloc(sizeof(GISTENTRY)); gistentryinit(*retval, PointerGetDatum(key), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } PG_RETURN_POINTER(retval); } diff --git a/contrib/ltree/ltree_gist.c b/contrib/ltree/ltree_gist.c index 70e78a672a..86d50028bb 100644 --- a/contrib/ltree/ltree_gist.c +++ b/contrib/ltree/ltree_gist.c @@ -64,7 +64,7 @@ ltree_compress(PG_FUNCTION_ARGS) retval = (GISTENTRY *) palloc(sizeof(GISTENTRY)); gistentryinit(*retval, PointerGetDatum(key), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } PG_RETURN_POINTER(retval); } @@ -81,7 +81,7 @@ ltree_decompress(PG_FUNCTION_ARGS) gistentryinit(*retval, PointerGetDatum(key), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); PG_RETURN_POINTER(retval); } PG_RETURN_POINTER(entry); diff --git a/contrib/pg_trgm/trgm_gist.c b/contrib/pg_trgm/trgm_gist.c index ed02af875c..e55dc19a65 100644 --- a/contrib/pg_trgm/trgm_gist.c +++ b/contrib/pg_trgm/trgm_gist.c @@ -106,7 +106,7 @@ gtrgm_compress(PG_FUNCTION_ARGS) retval = (GISTENTRY *) palloc(sizeof(GISTENTRY)); gistentryinit(*retval, PointerGetDatum(res), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } else if (ISSIGNKEY(DatumGetPointer(entry->key)) && !ISALLTRUE(DatumGetPointer(entry->key))) @@ -130,7 +130,7 @@ gtrgm_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); } diff --git a/contrib/seg/seg.c b/contrib/seg/seg.c index e707b18fc6..8bac4d50d0 100644 --- a/contrib/seg/seg.c +++ b/contrib/seg/seg.c @@ -188,7 +188,7 @@ seg_upper(PG_FUNCTION_ARGS) /* ** The GiST Consistent method for segments ** 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 @@ -413,9 +413,9 @@ gseg_same(PG_FUNCTION_ARGS) bool *result = (bool *) PG_GETARG_POINTER(2); if (DirectFunctionCall2(seg_same, PG_GETARG_DATUM(0), PG_GETARG_DATUM(1))) - *result = TRUE; + *result = true; else - *result = FALSE; + *result = false; #ifdef GIST_DEBUG fprintf(stderr, "same: %s\n", (*result ? "TRUE" : "FALSE")); @@ -465,7 +465,7 @@ gseg_leaf_consistent(Datum key, Datum query, StrategyNumber strategy) retval = DirectFunctionCall2(seg_contained, key, query); break; default: - retval = FALSE; + retval = false; } PG_RETURN_DATUM(retval); @@ -514,7 +514,7 @@ gseg_internal_consistent(Datum key, Datum query, StrategyNumber strategy) DatumGetBool(DirectFunctionCall2(seg_overlap, key, query)); break; default: - retval = FALSE; + retval = false; } PG_RETURN_BOOL(retval); diff --git a/doc/src/sgml/gin.sgml b/doc/src/sgml/gin.sgml index 7c2321ec3c..f5b5b9386c 100644 --- a/doc/src/sgml/gin.sgml +++ b/doc/src/sgml/gin.sgml @@ -223,9 +223,9 @@ Extensibility pmatch is an output argument for use when partial match is supported. To use it, extractQuery must allocate - an array of *nkeys booleans and store its address at - *pmatch. Each element of the array should be set to TRUE - if the corresponding key requires partial match, FALSE if not. + an array of *nkeys bools and store its address at + *pmatch. Each element of the array should be set to true + if the corresponding key requires partial match, false if not. If *pmatch is set to NULL then GIN assumes partial match is not required. The variable is initialized to NULL before call, so this argument can simply be ignored by operator classes that do @@ -267,7 +267,7 @@ Extensibility Datum queryKeys[], bool nullFlags[]) - Returns TRUE if an indexed item satisfies the query operator with + Returns true if an indexed item satisfies the query operator with strategy number n (or might satisfy it, if the recheck indication is returned). This function does not have direct access to the indexed item's value, since GIN does not @@ -277,8 +277,8 @@ Extensibility nkeys, which is the same as the number of keys previously returned by extractQuery for this query datum. Each element of the - check array is TRUE if the indexed item contains the - corresponding query key, i.e., if (check[i] == TRUE) the i-th key of the + check array is true if the indexed item contains the + corresponding query key, i.e., if (check[i] == true) the i-th key of the extractQuery result array is present in the indexed item. The original query datum is passed in case the consistent method needs to consult it, @@ -291,7 +291,7 @@ Extensibility When extractQuery returns a null key in queryKeys[], the corresponding check[] element - is TRUE if the indexed item contains a null key; that is, the + is true if the indexed item contains a null key; that is, the semantics of check[] are like IS NOT DISTINCT FROM. The consistent function can examine the corresponding nullFlags[] element if it needs to tell @@ -299,13 +299,13 @@ Extensibility - On success, *recheck should be set to TRUE if the heap - tuple needs to be rechecked against the query operator, or FALSE if - the index test is exact. That is, a FALSE return value guarantees - that the heap tuple does not match the query; a TRUE return value with - *recheck set to FALSE guarantees that the heap tuple does - match the query; and a TRUE return value with - *recheck set to TRUE means that the heap tuple might match + On success, *recheck should be set to true if the heap + tuple needs to be rechecked against the query operator, or false if + the index test is exact. That is, a false return value guarantees + that the heap tuple does not match the query; a true return value with + *recheck set to false guarantees that the heap tuple does + match the query; and a true return value with + *recheck set to true means that the heap tuple might match the query, so it needs to be fetched and rechecked by evaluating the query operator directly against the originally indexed item. diff --git a/doc/src/sgml/indexam.sgml b/doc/src/sgml/indexam.sgml index aa3d371d2e..511cf4d942 100644 --- a/doc/src/sgml/indexam.sgml +++ b/doc/src/sgml/indexam.sgml @@ -280,9 +280,9 @@ Index Access Method Functions The function's Boolean result value is significant only when checkUnique is UNIQUE_CHECK_PARTIAL. - In this case a TRUE result means the new entry is known unique, whereas - FALSE means it might be non-unique (and a deferred uniqueness check must - be scheduled). For other cases a constant FALSE result is recommended. + In this case a true result means the new entry is known unique, whereas + false means it might be non-unique (and a deferred uniqueness check must + be scheduled). For other cases a constant false result is recommended. @@ -368,8 +368,8 @@ Index Access Method Functions linkend="indexes-index-only-scans">index-only scans on the given column, by returning the indexed column values for an index entry in the form of an IndexTuple. The attribute number - is 1-based, i.e. the first column's attno is 1. Returns TRUE if supported, - else FALSE. If the access method does not support index-only scans at all, + is 1-based, i.e. the first column's attno is 1. Returns true if supported, + else false. If the access method does not support index-only scans at all, the amcanreturn field in its IndexAmRoutine struct can be set to NULL. @@ -532,15 +532,15 @@ Index Access Method Functions ScanDirection direction); Fetch the next tuple in the given scan, moving in the given - direction (forward or backward in the index). Returns TRUE if a tuple was - obtained, FALSE if no matching tuples remain. In the TRUE case the tuple + direction (forward or backward in the index). Returns true if a tuple was + obtained, false if no matching tuples remain. In the true case the tuple TID is stored into the scan structure. Note that success means only that the index contains an entry that matches the scan keys, not that the tuple necessarily still exists in the heap or will pass the caller's snapshot test. On success, amgettuple - must also set scan->xs_recheck to TRUE or FALSE. - FALSE means it is certain that the index entry matches the scan keys. - TRUE means this is not certain, and the conditions represented by the + must also set scan->xs_recheck to true or false. + False means it is certain that the index entry matches the scan keys. + true means this is not certain, and the conditions represented by the scan keys must be rechecked against the heap tuple after fetching it. This provision supports lossy index operators. Note that rechecking will extend only to the scan conditions; a partial @@ -550,7 +550,7 @@ Index Access Method Functions If the index supports index-only - scans (i.e., amcanreturn returns TRUE for it), + scans (i.e., amcanreturn returns true for it), then on success the AM must also check scan->xs_want_itup, and if that is true it must return the originally indexed data for the index entry. The data can be returned in the form of an @@ -1082,8 +1082,8 @@ Index Uniqueness Checks constraint is deferrable. PostgreSQL will use this mode to insert each row's index entry. The access method must allow duplicate entries into the index, and report any - potential duplicates by returning FALSE from aminsert. - For each row for which FALSE is returned, a deferred recheck will + potential duplicates by returning false from aminsert. + For each row for which false is returned, a deferred recheck will be scheduled. diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 096a8be605..f5de8b6ba3 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -6968,12 +6968,12 @@ Event Example break; } - /* unknown event ID, just return TRUE. */ + /* unknown event ID, just return true. */ default: break; } - return TRUE; /* event processing succeeded */ + return true; /* event processing succeeded */ } ]]> diff --git a/doc/src/sgml/spgist.sgml b/doc/src/sgml/spgist.sgml index cd4a8d07c4..2842a3c5d9 100644 --- a/doc/src/sgml/spgist.sgml +++ b/doc/src/sgml/spgist.sgml @@ -794,7 +794,7 @@ SP-GiST Limits trees, in which each level of the tree includes a prefix that is short enough to fit on a page, and the final leaf level includes a suffix also short enough to fit on a page. The operator class should set - longValuesOK to TRUE only if it is prepared to arrange for + longValuesOK to true only if it is prepared to arrange for this to happen. Otherwise, the SP-GiST core will reject any request to index a value that is too large to fit on an index page. diff --git a/doc/src/sgml/sslinfo.sgml b/doc/src/sgml/sslinfo.sgml index 1fd323a0b6..1e272aab1b 100644 --- a/doc/src/sgml/sslinfo.sgml +++ b/doc/src/sgml/sslinfo.sgml @@ -32,7 +32,7 @@ Functions Provided - Returns TRUE if current connection to server uses SSL, and FALSE + Returns true if current connection to server uses SSL, and false otherwise. @@ -77,8 +77,8 @@ Functions Provided - Returns TRUE if current client has presented a valid SSL client - certificate to the server, and FALSE otherwise. (The server + Returns true if current client has presented a valid SSL client + certificate to the server, and false otherwise. (The server might or might not be configured to require a client certificate.) diff --git a/src/backend/access/gin/ginbtree.c b/src/backend/access/gin/ginbtree.c index b02cb8ae58..1b920facc2 100644 --- a/src/backend/access/gin/ginbtree.c +++ b/src/backend/access/gin/ginbtree.c @@ -41,7 +41,7 @@ ginTraverseLock(Buffer buffer, bool searchMode) page = BufferGetPage(buffer); if (GinPageIsLeaf(page)) { - if (searchMode == FALSE) + if (searchMode == false) { /* we should relock our page */ LockBuffer(buffer, GIN_UNLOCK); @@ -107,7 +107,7 @@ ginFindLeafPage(GinBtree btree, bool searchMode, Snapshot snapshot) * ok, page is correctly locked, we should check to move right .., * root never has a right link, so small optimization */ - while (btree->fullScan == FALSE && stack->blkno != btree->rootBlkno && + while (btree->fullScan == false && stack->blkno != btree->rootBlkno && btree->isMoveRight(btree, page)) { BlockNumber rightlink = GinPageGetOpaque(page)->rightlink; diff --git a/src/backend/access/gin/ginbulk.c b/src/backend/access/gin/ginbulk.c index c76f504295..c0857180b5 100644 --- a/src/backend/access/gin/ginbulk.c +++ b/src/backend/access/gin/ginbulk.c @@ -52,7 +52,7 @@ ginCombineData(RBNode *existing, const RBNode *newdata, void *arg) } /* If item pointers are not ordered, they will need to be sorted later */ - if (eo->shouldSort == FALSE) + if (eo->shouldSort == false) { int res; @@ -60,7 +60,7 @@ ginCombineData(RBNode *existing, const RBNode *newdata, void *arg) Assert(res != 0); if (res > 0) - eo->shouldSort = TRUE; + eo->shouldSort = true; } eo->list[eo->count] = en->list[0]; @@ -176,7 +176,7 @@ ginInsertBAEntry(BuildAccumulator *accum, ea->key = getDatumCopy(accum, attnum, key); ea->maxcount = DEF_NPTR; ea->count = 1; - ea->shouldSort = FALSE; + ea->shouldSort = false; ea->list = (ItemPointerData *) palloc(sizeof(ItemPointerData) * DEF_NPTR); ea->list[0] = *heapptr; diff --git a/src/backend/access/gin/gindatapage.c b/src/backend/access/gin/gindatapage.c index 2e5ea47976..9c6cba4825 100644 --- a/src/backend/access/gin/gindatapage.c +++ b/src/backend/access/gin/gindatapage.c @@ -235,9 +235,9 @@ dataIsMoveRight(GinBtree btree, Page page) ItemPointer iptr = GinDataPageGetRightBound(page); if (GinPageRightMost(page)) - return FALSE; + return false; - return (ginCompareItemPointers(&btree->itemptr, iptr) > 0) ? TRUE : FALSE; + return (ginCompareItemPointers(&btree->itemptr, iptr) > 0) ? true : false; } /* @@ -1875,9 +1875,9 @@ ginPrepareDataScan(GinBtree btree, Relation index, BlockNumber rootBlkno) btree->fillRoot = ginDataFillRoot; btree->prepareDownlink = dataPrepareDownlink; - btree->isData = TRUE; - btree->fullScan = FALSE; - btree->isBuild = FALSE; + btree->isData = true; + btree->fullScan = false; + btree->isBuild = false; } /* @@ -1919,9 +1919,9 @@ ginScanBeginPostingTree(GinBtree btree, Relation index, BlockNumber rootBlkno, ginPrepareDataScan(btree, index, rootBlkno); - btree->fullScan = TRUE; + btree->fullScan = true; - stack = ginFindLeafPage(btree, TRUE, snapshot); + stack = ginFindLeafPage(btree, true, snapshot); return stack; } diff --git a/src/backend/access/gin/ginentrypage.c b/src/backend/access/gin/ginentrypage.c index d5cc70258a..bf7b05107b 100644 --- a/src/backend/access/gin/ginentrypage.c +++ b/src/backend/access/gin/ginentrypage.c @@ -30,7 +30,7 @@ static void entrySplitPage(GinBtree btree, Buffer origbuf, * Form a tuple for entry tree. * * If the tuple would be too big to be stored, function throws a suitable - * error if errorTooBig is TRUE, or returns NULL if errorTooBig is FALSE. + * error if errorTooBig is true, or returns NULL if errorTooBig is false. * * See src/backend/access/gin/README for a description of the index tuple * format that is being built here. We build on the assumption that we @@ -249,7 +249,7 @@ entryIsMoveRight(GinBtree btree, Page page) GinNullCategory category; if (GinPageRightMost(page)) - return FALSE; + return false; itup = getRightMostTuple(page); attnum = gintuple_get_attrnum(btree->ginstate, itup); @@ -258,9 +258,9 @@ entryIsMoveRight(GinBtree btree, Page page) if (ginCompareAttEntries(btree->ginstate, btree->entryAttnum, btree->entryKey, btree->entryCategory, attnum, key, category) > 0) - return TRUE; + return true; - return FALSE; + return false; } /* @@ -356,7 +356,7 @@ entryLocateLeafEntry(GinBtree btree, GinBtreeStack *stack) if (btree->fullScan) { stack->off = FirstOffsetNumber; - return TRUE; + return true; } low = FirstOffsetNumber; @@ -762,9 +762,9 @@ ginPrepareEntryScan(GinBtree btree, OffsetNumber attnum, btree->fillRoot = ginEntryFillRoot; btree->prepareDownlink = entryPrepareDownlink; - btree->isData = FALSE; - btree->fullScan = FALSE; - btree->isBuild = FALSE; + btree->isData = false; + btree->fullScan = false; + btree->isBuild = false; btree->entryAttnum = attnum; btree->entryKey = key; diff --git a/src/backend/access/gin/ginget.c b/src/backend/access/gin/ginget.c index 9895080685..1ecf97507d 100644 --- a/src/backend/access/gin/ginget.c +++ b/src/backend/access/gin/ginget.c @@ -311,7 +311,7 @@ startScanEntry(GinState *ginstate, GinScanEntry entry, Snapshot snapshot) entry->nlist = 0; entry->matchBitmap = NULL; entry->matchResult = NULL; - entry->reduceResult = FALSE; + entry->reduceResult = false; entry->predictNumberResult = 0; /* @@ -324,9 +324,9 @@ startScanEntry(GinState *ginstate, GinScanEntry entry, Snapshot snapshot) stackEntry = ginFindLeafPage(&btreeEntry, true, snapshot); page = BufferGetPage(stackEntry->buffer); /* ginFindLeafPage() will have already checked snapshot age. */ - needUnlock = TRUE; + needUnlock = true; - entry->isFinished = TRUE; + entry->isFinished = true; if (entry->isPartialMatch || entry->queryCategory == GIN_CAT_EMPTY_QUERY) @@ -363,7 +363,7 @@ startScanEntry(GinState *ginstate, GinScanEntry entry, Snapshot snapshot) if (entry->matchBitmap && !tbm_is_empty(entry->matchBitmap)) { entry->matchIterator = tbm_begin_iterate(entry->matchBitmap); - entry->isFinished = FALSE; + entry->isFinished = false; } } else if (btreeEntry.findItem(&btreeEntry, stackEntry)) @@ -385,7 +385,7 @@ startScanEntry(GinState *ginstate, GinScanEntry entry, Snapshot snapshot) * root of posting tree. */ LockBuffer(stackEntry->buffer, GIN_UNLOCK); - needUnlock = FALSE; + needUnlock = false; stack = ginScanBeginPostingTree(&entry->btree, ginstate->index, rootPostingTree, snapshot); @@ -410,7 +410,7 @@ startScanEntry(GinState *ginstate, GinScanEntry entry, Snapshot snapshot) LockBuffer(entry->buffer, GIN_UNLOCK); freeGinBtreeStack(stack); - entry->isFinished = FALSE; + entry->isFinished = false; } else if (GinGetNPosting(itup) > 0) { @@ -418,7 +418,7 @@ startScanEntry(GinState *ginstate, GinScanEntry entry, Snapshot snapshot) &entry->nlist); entry->predictNumberResult = entry->nlist; - entry->isFinished = FALSE; + entry->isFinished = false; } } @@ -565,7 +565,7 @@ startScan(IndexScanDesc scan) for (i = 0; i < so->totalentries; i++) { so->entries[i]->predictNumberResult /= so->totalentries; - so->entries[i]->reduceResult = TRUE; + so->entries[i]->reduceResult = true; } } } @@ -666,7 +666,7 @@ entryLoadMoreItems(GinState *ginstate, GinScanEntry entry, { UnlockReleaseBuffer(entry->buffer); entry->buffer = InvalidBuffer; - entry->isFinished = TRUE; + entry->isFinished = true; return; } @@ -728,7 +728,7 @@ entryLoadMoreItems(GinState *ginstate, GinScanEntry entry, /* * Sets entry->curItem to next heap item pointer > advancePast, for one entry - * of one scan key, or sets entry->isFinished to TRUE if there are no more. + * of one scan key, or sets entry->isFinished to true if there are no more. * * Item pointers are returned in ascending order. * @@ -775,7 +775,7 @@ entryGetItem(GinState *ginstate, GinScanEntry entry, ItemPointerSetInvalid(&entry->curItem); tbm_end_iterate(entry->matchIterator); entry->matchIterator = NULL; - entry->isFinished = TRUE; + entry->isFinished = true; break; } @@ -835,7 +835,7 @@ entryGetItem(GinState *ginstate, GinScanEntry entry, entry->matchResult->offsets[entry->offset]); entry->offset++; gotitem = true; - } while (!gotitem || (entry->reduceResult == TRUE && dropItem(entry))); + } while (!gotitem || (entry->reduceResult == true && dropItem(entry))); } else if (!BufferIsValid(entry->buffer)) { @@ -848,7 +848,7 @@ entryGetItem(GinState *ginstate, GinScanEntry entry, if (entry->offset >= entry->nlist) { ItemPointerSetInvalid(&entry->curItem); - entry->isFinished = TRUE; + entry->isFinished = true; break; } @@ -876,7 +876,7 @@ entryGetItem(GinState *ginstate, GinScanEntry entry, entry->curItem = entry->list[entry->offset++]; } while (ginCompareItemPointers(&entry->curItem, &advancePast) <= 0 || - (entry->reduceResult == TRUE && dropItem(entry))); + (entry->reduceResult == true && dropItem(entry))); } } @@ -891,7 +891,7 @@ entryGetItem(GinState *ginstate, GinScanEntry entry, * iff recheck is needed for this item pointer (including the case where the * item pointer is a lossy page pointer). * - * If all entry streams are exhausted, sets key->isFinished to TRUE. + * If all entry streams are exhausted, sets key->isFinished to true. * * Item pointers must be returned in ascending order. * @@ -963,7 +963,7 @@ keyGetItem(GinState *ginstate, MemoryContext tempCtx, GinScanKey key, if (allFinished) { /* all entries are finished */ - key->isFinished = TRUE; + key->isFinished = true; return; } @@ -1051,7 +1051,7 @@ keyGetItem(GinState *ginstate, MemoryContext tempCtx, GinScanKey key, * them. We could pass them as MAYBE as well, but if we're using the * "shim" implementation of a tri-state consistent function (see * ginlogic.c), it's better to pass as few MAYBEs as possible. So pass - * them as TRUE. + * them as true. * * Note that only lossy-page entries pointing to the current item's page * should trigger this processing; we might have future lossy pages in the @@ -1064,7 +1064,7 @@ keyGetItem(GinState *ginstate, MemoryContext tempCtx, GinScanKey key, for (i = 0; i < key->nentries; i++) { entry = key->scanEntry[i]; - if (entry->isFinished == FALSE && + if (entry->isFinished == false && ginCompareItemPointers(&entry->curItem, &curPageLossy) == 0) { if (i < key->nuserentries) @@ -1314,7 +1314,7 @@ scanGetItem(IndexScanDesc scan, ItemPointerData advancePast, } } - return TRUE; + return true; } @@ -1508,7 +1508,7 @@ collectMatchesForHeapRow(IndexScanDesc scan, pendingPosition *pos) memset(key->entryRes, GIN_FALSE, key->nentries); } - memset(pos->hasMatchKey, FALSE, so->nkeys); + memset(pos->hasMatchKey, false, so->nkeys); /* * Outer loop iterates over multiple pending-list pages when a single heap diff --git a/src/backend/access/gin/gininsert.c b/src/backend/access/gin/gininsert.c index 5378011f50..8acc2b25b2 100644 --- a/src/backend/access/gin/gininsert.c +++ b/src/backend/access/gin/gininsert.c @@ -185,7 +185,7 @@ ginEntryInsert(GinState *ginstate, IndexTuple itup; Page page; - insertdata.isDelete = FALSE; + insertdata.isDelete = false; /* During index build, count the to-be-inserted entry */ if (buildStats) @@ -221,7 +221,7 @@ ginEntryInsert(GinState *ginstate, itup = addItemPointersToLeafTuple(ginstate, itup, items, nitem, buildStats); - insertdata.isDelete = TRUE; + insertdata.isDelete = true; } else { diff --git a/src/backend/access/gin/ginvacuum.c b/src/backend/access/gin/ginvacuum.c index 31425e9963..a20a99c814 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); } /* diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c index 565525bbdf..121dc016da 100644 --- a/src/backend/access/gist/gist.c +++ b/src/backend/access/gist/gist.c @@ -1364,8 +1364,8 @@ gistSplit(Relation r, IndexTupleSize(itup[0]), GiSTPageSize, RelationGetRelationName(r)))); - memset(v.spl_lisnull, TRUE, sizeof(bool) * giststate->tupdesc->natts); - memset(v.spl_risnull, TRUE, sizeof(bool) * giststate->tupdesc->natts); + memset(v.spl_lisnull, true, sizeof(bool) * giststate->tupdesc->natts); + memset(v.spl_risnull, true, sizeof(bool) * giststate->tupdesc->natts); gistSplitByKey(r, page, itup, len, giststate, &v, 0); /* form left and right vector */ diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c index 760ea0c997..bb1dd9e9cc 100644 --- a/src/backend/access/gist/gistget.c +++ b/src/backend/access/gist/gistget.c @@ -197,7 +197,7 @@ gistindex_keytest(IndexScanDesc scan, gistdentryinit(giststate, key->sk_attno - 1, &de, datum, r, page, offset, - FALSE, isNull); + false, isNull); /* * Call the Consistent function to evaluate the test. The @@ -258,7 +258,7 @@ gistindex_keytest(IndexScanDesc scan, gistdentryinit(giststate, key->sk_attno - 1, &de, datum, r, page, offset, - FALSE, isNull); + false, isNull); /* * Call the Distance function to evaluate the distance. The diff --git a/src/backend/access/gist/gistproc.c b/src/backend/access/gist/gistproc.c index 08990f5a1b..b864053ee3 100644 --- a/src/backend/access/gist/gistproc.c +++ b/src/backend/access/gist/gistproc.c @@ -105,7 +105,7 @@ box_penalty(const BOX *original, const BOX *new) * The GiST Consistent method for boxes * * Should return false if for all data items x below entry, - * the predicate x op query must be FALSE, where op is the oper + * the predicate x op query must be false, where op is the oper * corresponding to strategy in the pg_amop table. */ Datum @@ -122,7 +122,7 @@ gist_box_consistent(PG_FUNCTION_ARGS) *recheck = false; if (DatumGetBoxP(entry->key) == NULL || query == NULL) - PG_RETURN_BOOL(FALSE); + PG_RETURN_BOOL(false); /* * if entry is not leaf, use rtree_internal_consistent, else use @@ -1084,7 +1084,7 @@ gist_poly_compress(PG_FUNCTION_ARGS) retval = (GISTENTRY *) palloc(sizeof(GISTENTRY)); gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } else retval = entry; @@ -1109,7 +1109,7 @@ gist_poly_consistent(PG_FUNCTION_ARGS) *recheck = true; if (DatumGetBoxP(entry->key) == NULL || query == NULL) - PG_RETURN_BOOL(FALSE); + PG_RETURN_BOOL(false); /* * Since the operators require recheck anyway, we can just use @@ -1152,7 +1152,7 @@ gist_circle_compress(PG_FUNCTION_ARGS) retval = (GISTENTRY *) palloc(sizeof(GISTENTRY)); gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } else retval = entry; @@ -1178,7 +1178,7 @@ gist_circle_consistent(PG_FUNCTION_ARGS) *recheck = true; if (DatumGetBoxP(entry->key) == NULL || query == NULL) - PG_RETURN_BOOL(FALSE); + PG_RETURN_BOOL(false); /* * Since the operators require recheck anyway, we can just use @@ -1214,7 +1214,7 @@ gist_point_compress(PG_FUNCTION_ARGS) box->high = box->low = *point; gistentryinit(*retval, BoxPGetDatum(box), - entry->rel, entry->page, entry->offset, FALSE); + entry->rel, entry->page, entry->offset, false); PG_RETURN_POINTER(retval); } @@ -1243,7 +1243,7 @@ gist_point_fetch(PG_FUNCTION_ARGS) r->y = in->high.y; gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); PG_RETURN_POINTER(retval); } diff --git a/src/backend/access/gist/gistsplit.c b/src/backend/access/gist/gistsplit.c index 617f42c317..9efb16dd24 100644 --- a/src/backend/access/gist/gistsplit.c +++ b/src/backend/access/gist/gistsplit.c @@ -125,7 +125,7 @@ findDontCares(Relation r, GISTSTATE *giststate, GISTENTRY *valvec, * check for nulls */ gistentryinit(entry, spl->splitVector.spl_rdatum, r, NULL, - (OffsetNumber) 0, FALSE); + (OffsetNumber) 0, false); for (i = 0; i < spl->splitVector.spl_nleft; i++) { int j = spl->splitVector.spl_left[i]; @@ -141,7 +141,7 @@ findDontCares(Relation r, GISTSTATE *giststate, GISTENTRY *valvec, /* And conversely for the right-side tuples */ gistentryinit(entry, spl->splitVector.spl_ldatum, r, NULL, - (OffsetNumber) 0, FALSE); + (OffsetNumber) 0, false); for (i = 0; i < spl->splitVector.spl_nright; i++) { int j = spl->splitVector.spl_right[i]; @@ -177,7 +177,7 @@ removeDontCares(OffsetNumber *a, int *len, const bool *dontcare) { OffsetNumber ai = a[i]; - if (dontcare[ai] == FALSE) + if (dontcare[ai] == false) { /* re-emit item into a[] */ *curwpos = ai; @@ -213,10 +213,10 @@ placeOne(Relation r, GISTSTATE *giststate, GistSplitVector *v, rpenalty; GISTENTRY entry; - gistentryinit(entry, v->spl_lattr[attno], r, NULL, 0, FALSE); + gistentryinit(entry, v->spl_lattr[attno], r, NULL, 0, false); lpenalty = gistpenalty(giststate, attno, &entry, v->spl_lisnull[attno], identry + attno, isnull[attno]); - gistentryinit(entry, v->spl_rattr[attno], r, NULL, 0, FALSE); + gistentryinit(entry, v->spl_rattr[attno], r, NULL, 0, false); rpenalty = gistpenalty(giststate, attno, &entry, v->spl_risnull[attno], identry + attno, isnull[attno]); @@ -265,10 +265,10 @@ supportSecondarySplit(Relation r, GISTSTATE *giststate, int attno, entrySL, entrySR; - gistentryinit(entryL, oldL, r, NULL, 0, FALSE); - gistentryinit(entryR, oldR, r, NULL, 0, FALSE); - gistentryinit(entrySL, sv->spl_ldatum, r, NULL, 0, FALSE); - gistentryinit(entrySR, sv->spl_rdatum, r, NULL, 0, FALSE); + gistentryinit(entryL, oldL, r, NULL, 0, false); + gistentryinit(entryR, oldR, r, NULL, 0, false); + gistentryinit(entrySL, sv->spl_ldatum, r, NULL, 0, false); + gistentryinit(entrySR, sv->spl_rdatum, r, NULL, 0, false); if (sv->spl_ldatum_exists && sv->spl_rdatum_exists) { @@ -320,8 +320,8 @@ supportSecondarySplit(Relation r, GISTSTATE *giststate, int attno, SWAPVAR(sv->spl_left, sv->spl_right, off); SWAPVAR(sv->spl_nleft, sv->spl_nright, noff); SWAPVAR(sv->spl_ldatum, sv->spl_rdatum, datum); - gistentryinit(entrySL, sv->spl_ldatum, r, NULL, 0, FALSE); - gistentryinit(entrySR, sv->spl_rdatum, r, NULL, 0, FALSE); + gistentryinit(entrySL, sv->spl_ldatum, r, NULL, 0, false); + gistentryinit(entrySR, sv->spl_rdatum, r, NULL, 0, false); } if (sv->spl_ldatum_exists) @@ -396,20 +396,20 @@ genericPickSplit(GISTSTATE *giststate, GistEntryVector *entryvec, GIST_SPLITVEC * Calls user picksplit method for attno column to split tuples into * two vectors. * - * Returns FALSE if split is complete (there are no more index columns, or + * Returns false if split is complete (there are no more index columns, or * there is no need to consider them because split is optimal already). * - * Returns TRUE and v->spl_dontcare = NULL if the picksplit result is + * Returns true and v->spl_dontcare = NULL if the picksplit result is * degenerate (all tuples seem to be don't-cares), so we should just * disregard this column and split on the next column(s) instead. * - * Returns TRUE and v->spl_dontcare != NULL if there are don't-care tuples + * Returns true and v->spl_dontcare != NULL if there are don't-care tuples * that could be relocated based on the next column(s). The don't-care * tuples have been removed from the split and must be reinserted by caller. * There is at least one non-don't-care tuple on each side of the split, * and union keys for all columns are updated to include just those tuples. * - * A TRUE result implies there is at least one more index column. + * A true result implies there is at least one more index column. */ static bool gistUserPicksplit(Relation r, GistEntryVector *entryvec, int attno, GistSplitVector *v, @@ -610,7 +610,7 @@ gistSplitHalf(GIST_SPLITVEC *v, int len) * attno: column we are working on (zero-based index) * * Outside caller must initialize v->spl_lisnull and v->spl_risnull arrays - * to all-TRUE. On return, spl_left/spl_nleft contain indexes of tuples + * to all-true. On return, spl_left/spl_nleft contain indexes of tuples * to go left, spl_right/spl_nright contain indexes of tuples to go right, * spl_lattr/spl_lisnull contain left-side union key values, and * spl_rattr/spl_risnull contain right-side union key values. Other fields @@ -643,7 +643,7 @@ gistSplitByKey(Relation r, Page page, IndexTuple *itup, int len, &IsNull); gistdentryinit(giststate, attno, &(entryvec->vector[i]), datum, r, page, i, - FALSE, IsNull); + false, IsNull); if (IsNull) offNullTuples[nOffNullTuples++] = i; } @@ -655,7 +655,7 @@ gistSplitByKey(Relation r, Page page, IndexTuple *itup, int len, * our attention to the next column. If there's no next column, just * split page in half. */ - v->spl_risnull[attno] = v->spl_lisnull[attno] = TRUE; + v->spl_risnull[attno] = v->spl_lisnull[attno] = true; if (attno + 1 < giststate->tupdesc->natts) gistSplitByKey(r, page, itup, len, giststate, v, attno + 1); @@ -672,7 +672,7 @@ gistSplitByKey(Relation r, Page page, IndexTuple *itup, int len, */ v->splitVector.spl_right = offNullTuples; v->splitVector.spl_nright = nOffNullTuples; - v->spl_risnull[attno] = TRUE; + v->spl_risnull[attno] = true; v->splitVector.spl_left = (OffsetNumber *) palloc(len * sizeof(OffsetNumber)); v->splitVector.spl_nleft = 0; diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c index b6ccc1a66a..c7e9b2b1b6 100644 --- a/src/backend/access/gist/gistutil.c +++ b/src/backend/access/gist/gistutil.c @@ -179,7 +179,7 @@ gistMakeUnionItVec(GISTSTATE *giststate, IndexTuple *itvec, int len, evec->vector + evec->n, datum, NULL, NULL, (OffsetNumber) 0, - FALSE, IsNull); + false, IsNull); evec->n++; } @@ -187,7 +187,7 @@ gistMakeUnionItVec(GISTSTATE *giststate, IndexTuple *itvec, int len, if (evec->n == 0) { attr[i] = (Datum) 0; - isnull[i] = TRUE; + isnull[i] = true; } else { @@ -204,7 +204,7 @@ gistMakeUnionItVec(GISTSTATE *giststate, IndexTuple *itvec, int len, PointerGetDatum(evec), PointerGetDatum(&attrsize)); - isnull[i] = FALSE; + isnull[i] = false; } } } @@ -246,17 +246,17 @@ gistMakeUnionKey(GISTSTATE *giststate, int attno, if (isnull1 && isnull2) { - *dstisnull = TRUE; + *dstisnull = true; *dst = (Datum) 0; } else { - if (isnull1 == FALSE && isnull2 == FALSE) + if (isnull1 == false && isnull2 == false) { evec->vector[0] = *entry1; evec->vector[1] = *entry2; } - else if (isnull1 == FALSE) + else if (isnull1 == false) { evec->vector[0] = *entry1; evec->vector[1] = *entry1; @@ -267,7 +267,7 @@ gistMakeUnionKey(GISTSTATE *giststate, int attno, evec->vector[1] = *entry2; } - *dstisnull = FALSE; + *dstisnull = false; *dst = FunctionCall2Coll(&giststate->unionFn[attno], giststate->supportCollation[attno], PointerGetDatum(evec), @@ -303,7 +303,7 @@ gistDeCompressAtt(GISTSTATE *giststate, Relation r, IndexTuple tuple, Page p, datum = index_getattr(tuple, i + 1, giststate->tupdesc, &isnull[i]); gistdentryinit(giststate, i, &attdata[i], datum, r, p, o, - FALSE, isnull[i]); + false, isnull[i]); } } @@ -313,7 +313,7 @@ gistDeCompressAtt(GISTSTATE *giststate, Relation r, IndexTuple tuple, Page p, IndexTuple gistgetadjusted(Relation r, IndexTuple oldtup, IndexTuple addtup, GISTSTATE *giststate) { - bool neednew = FALSE; + bool neednew = false; GISTENTRY oldentries[INDEX_MAX_KEYS], addentries[INDEX_MAX_KEYS]; bool oldisnull[INDEX_MAX_KEYS], @@ -451,7 +451,7 @@ gistchoose(Relation r, Page p, IndexTuple it, /* it has compressed entry */ /* Compute penalty for this column. */ datum = index_getattr(itup, j + 1, giststate->tupdesc, &IsNull); gistdentryinit(giststate, j, &entry, datum, r, p, i, - FALSE, IsNull); + false, IsNull); usize = gistpenalty(giststate, j, &entry, IsNull, &identry[j], isnull[j]); if (usize > 0) @@ -671,8 +671,8 @@ gistpenalty(GISTSTATE *giststate, int attno, { float penalty = 0.0; - if (giststate->penaltyFn[attno].fn_strict == FALSE || - (isNullOrig == FALSE && isNullAdd == FALSE)) + if (giststate->penaltyFn[attno].fn_strict == false || + (isNullOrig == false && isNullAdd == false)) { FunctionCall3Coll(&giststate->penaltyFn[attno], giststate->supportCollation[attno], diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 563bcda30c..bbc8d668a4 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -2306,7 +2306,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence, * * constraints is a list of CookedConstraint structs for previous constraints. * - * Returns TRUE if merged (constraint is a duplicate), or FALSE if it's + * Returns true if merged (constraint is a duplicate), or false if it's * got a so-far-unique name, or throws error if conflict. */ static bool @@ -5765,7 +5765,7 @@ ATExecDropNotNull(Relation rel, const char *colName, LOCKMODE lockmode) */ if (((Form_pg_attribute) GETSTRUCT(tuple))->attnotnull) { - ((Form_pg_attribute) GETSTRUCT(tuple))->attnotnull = FALSE; + ((Form_pg_attribute) GETSTRUCT(tuple))->attnotnull = false; CatalogTupleUpdate(attr_rel, &tuple->t_self, tuple); @@ -5846,7 +5846,7 @@ ATExecSetNotNull(AlteredTableInfo *tab, Relation rel, */ if (!((Form_pg_attribute) GETSTRUCT(tuple))->attnotnull) { - ((Form_pg_attribute) GETSTRUCT(tuple))->attnotnull = TRUE; + ((Form_pg_attribute) GETSTRUCT(tuple))->attnotnull = true; CatalogTupleUpdate(attr_rel, &tuple->t_self, tuple); @@ -8299,16 +8299,16 @@ validateForeignKeyConstraint(char *conname, trig.tgoid = InvalidOid; trig.tgname = conname; trig.tgenabled = TRIGGER_FIRES_ON_ORIGIN; - trig.tgisinternal = TRUE; + trig.tgisinternal = true; trig.tgconstrrelid = RelationGetRelid(pkrel); trig.tgconstrindid = pkindOid; trig.tgconstraint = constraintOid; - trig.tgdeferrable = FALSE; - trig.tginitdeferred = FALSE; + trig.tgdeferrable = false; + trig.tginitdeferred = false; /* we needn't fill in remaining fields */ /* - * See if we can do it with a single LEFT JOIN query. A FALSE result + * See if we can do it with a single LEFT JOIN query. A false result * indicates we must proceed with the fire-the-trigger method. */ if (RI_Initial_Check(&trig, rel, pkrel)) diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 0ae5873868..1b7b786b80 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -2601,7 +2601,7 @@ agg_retrieve_hash_table(AggState *aggstate) else { /* No more hashtables, so done */ - aggstate->agg_done = TRUE; + aggstate->agg_done = true; return NULL; } } diff --git a/src/backend/executor/nodeAppend.c b/src/backend/executor/nodeAppend.c index bed9bb8713..1d2fb35d55 100644 --- a/src/backend/executor/nodeAppend.c +++ b/src/backend/executor/nodeAppend.c @@ -88,10 +88,10 @@ exec_append_initialize_next(AppendState *appendstate) /* * if scanning in reverse, we start at the last scan in the list and * then proceed back to the first.. in any case we inform ExecAppend - * that we are at the end of the line by returning FALSE + * that we are at the end of the line by returning false */ appendstate->as_whichplan = 0; - return FALSE; + return false; } else if (whichplan >= appendstate->as_nplans) { @@ -99,11 +99,11 @@ exec_append_initialize_next(AppendState *appendstate) * as above, end the scan if we go beyond the last scan in our list.. */ appendstate->as_whichplan = appendstate->as_nplans - 1; - return FALSE; + return false; } else { - return TRUE; + return true; } } diff --git a/src/backend/executor/nodeGroup.c b/src/backend/executor/nodeGroup.c index ab4ae24a6b..6b68835ca1 100644 --- a/src/backend/executor/nodeGroup.c +++ b/src/backend/executor/nodeGroup.c @@ -73,7 +73,7 @@ ExecGroup(PlanState *pstate) if (TupIsNull(outerslot)) { /* empty input, so return nothing */ - node->grp_done = TRUE; + node->grp_done = true; return NULL; } /* Copy tuple into firsttupleslot */ @@ -116,7 +116,7 @@ ExecGroup(PlanState *pstate) if (TupIsNull(outerslot)) { /* no more groups, so we're done */ - node->grp_done = TRUE; + node->grp_done = true; return NULL; } @@ -177,7 +177,7 @@ ExecInitGroup(Group *node, EState *estate, int eflags) grpstate->ss.ps.plan = (Plan *) node; grpstate->ss.ps.state = estate; grpstate->ss.ps.ExecProcNode = ExecGroup; - grpstate->grp_done = FALSE; + grpstate->grp_done = false; /* * create expression context @@ -246,7 +246,7 @@ ExecReScanGroup(GroupState *node) { PlanState *outerPlan = outerPlanState(node); - node->grp_done = FALSE; + node->grp_done = false; /* must clear first tuple */ ExecClearTuple(node->ss.ss_ScanTupleSlot); diff --git a/src/backend/optimizer/util/predtest.c b/src/backend/optimizer/util/predtest.c index 536d24b698..134460cc13 100644 --- a/src/backend/optimizer/util/predtest.c +++ b/src/backend/optimizer/util/predtest.c @@ -1048,7 +1048,7 @@ arrayexpr_cleanup_fn(PredIterInfo info) * Does the predicate implication test for a "simple clause" predicate * and a "simple clause" restriction. * - * We return TRUE if able to prove the implication, FALSE if not. + * We return true if able to prove the implication, false if not. * * We have three strategies for determining whether one simple clause * implies another: @@ -1116,7 +1116,7 @@ predicate_implied_by_simple_clause(Expr *predicate, Node *clause, * Does the predicate refutation test for a "simple clause" predicate * and a "simple clause" restriction. * - * We return TRUE if able to prove the refutation, FALSE if not. + * We return true if able to prove the refutation, false if not. * * Unlike the implication case, checking for equal() clauses isn't * helpful. @@ -1360,12 +1360,12 @@ static const bool BT_implies_table[6][6] = { * The predicate operator: * LT LE EQ GE GT NE */ - {TRUE, TRUE, none, none, none, TRUE}, /* LT */ - {none, TRUE, none, none, none, none}, /* LE */ - {none, TRUE, TRUE, TRUE, none, none}, /* EQ */ - {none, none, none, TRUE, none, none}, /* GE */ - {none, none, none, TRUE, TRUE, TRUE}, /* GT */ - {none, none, none, none, none, TRUE} /* NE */ + {true, true, none, none, none, true}, /* LT */ + {none, true, none, none, none, none}, /* LE */ + {none, true, true, true, none, none}, /* EQ */ + {none, none, none, true, none, none}, /* GE */ + {none, none, none, true, true, true}, /* GT */ + {none, none, none, none, none, true} /* NE */ }; static const bool BT_refutes_table[6][6] = { @@ -1373,12 +1373,12 @@ static const bool BT_refutes_table[6][6] = { * The predicate operator: * LT LE EQ GE GT NE */ - {none, none, TRUE, TRUE, TRUE, none}, /* LT */ - {none, none, none, none, TRUE, none}, /* LE */ - {TRUE, none, none, none, TRUE, TRUE}, /* EQ */ - {TRUE, none, none, none, none, none}, /* GE */ - {TRUE, TRUE, TRUE, none, none, none}, /* GT */ - {none, none, TRUE, none, none, none} /* NE */ + {none, none, true, true, true, none}, /* LT */ + {none, none, none, none, true, none}, /* LE */ + {true, none, none, none, true, true}, /* EQ */ + {true, none, none, none, none, none}, /* GE */ + {true, true, true, none, none, none}, /* GT */ + {none, none, true, none, none, none} /* NE */ }; static const StrategyNumber BT_implic_table[6][6] = { @@ -1417,7 +1417,7 @@ static const StrategyNumber BT_refute_table[6][6] = { * When refute_it == false, we want to prove the predicate true; * when refute_it == true, we want to prove the predicate false. * (There is enough common code to justify handling these two cases - * in one routine.) We return TRUE if able to make the proof, FALSE + * in one routine.) We return true if able to make the proof, false * if not able to prove it. * * We can make proofs involving several expression forms (here "foo" and "bar" @@ -1661,7 +1661,7 @@ operator_predicate_proof(Expr *predicate, Node *clause, bool refute_it) * Assuming that EXPR1 clause_op EXPR2 is true, try to prove or refute * EXPR1 pred_op EXPR2. * - * Return TRUE if able to make the proof, false if not able to prove it. + * Return true if able to make the proof, false if not able to prove it. */ static bool operator_same_subexprs_proof(Oid pred_op, Oid clause_op, bool refute_it) diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index c303818c9b..14f5a0ac80 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -1005,7 +1005,7 @@ AlterOptRoleElem: } | INHERIT { - $$ = makeDefElem("inherit", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("inherit", (Node *)makeInteger(true), @1); } | CONNECTION LIMIT SignedIconst { @@ -1028,36 +1028,36 @@ AlterOptRoleElem: * size of the main parser. */ if (strcmp($1, "superuser") == 0) - $$ = makeDefElem("superuser", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("superuser", (Node *)makeInteger(true), @1); else if (strcmp($1, "nosuperuser") == 0) - $$ = makeDefElem("superuser", (Node *)makeInteger(FALSE), @1); + $$ = makeDefElem("superuser", (Node *)makeInteger(false), @1); else if (strcmp($1, "createrole") == 0) - $$ = makeDefElem("createrole", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("createrole", (Node *)makeInteger(true), @1); else if (strcmp($1, "nocreaterole") == 0) - $$ = makeDefElem("createrole", (Node *)makeInteger(FALSE), @1); + $$ = makeDefElem("createrole", (Node *)makeInteger(false), @1); else if (strcmp($1, "replication") == 0) - $$ = makeDefElem("isreplication", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("isreplication", (Node *)makeInteger(true), @1); else if (strcmp($1, "noreplication") == 0) - $$ = makeDefElem("isreplication", (Node *)makeInteger(FALSE), @1); + $$ = makeDefElem("isreplication", (Node *)makeInteger(false), @1); else if (strcmp($1, "createdb") == 0) - $$ = makeDefElem("createdb", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("createdb", (Node *)makeInteger(true), @1); else if (strcmp($1, "nocreatedb") == 0) - $$ = makeDefElem("createdb", (Node *)makeInteger(FALSE), @1); + $$ = makeDefElem("createdb", (Node *)makeInteger(false), @1); else if (strcmp($1, "login") == 0) - $$ = makeDefElem("canlogin", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("canlogin", (Node *)makeInteger(true), @1); else if (strcmp($1, "nologin") == 0) - $$ = makeDefElem("canlogin", (Node *)makeInteger(FALSE), @1); + $$ = makeDefElem("canlogin", (Node *)makeInteger(false), @1); else if (strcmp($1, "bypassrls") == 0) - $$ = makeDefElem("bypassrls", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("bypassrls", (Node *)makeInteger(true), @1); else if (strcmp($1, "nobypassrls") == 0) - $$ = makeDefElem("bypassrls", (Node *)makeInteger(FALSE), @1); + $$ = makeDefElem("bypassrls", (Node *)makeInteger(false), @1); else if (strcmp($1, "noinherit") == 0) { /* * Note that INHERIT is a keyword, so it's handled by main parser, but * NOINHERIT is handled here. */ - $$ = makeDefElem("inherit", (Node *)makeInteger(FALSE), @1); + $$ = makeDefElem("inherit", (Node *)makeInteger(false), @1); } else ereport(ERROR, @@ -1190,21 +1190,21 @@ DropRoleStmt: DROP ROLE role_list { DropRoleStmt *n = makeNode(DropRoleStmt); - n->missing_ok = FALSE; + n->missing_ok = false; n->roles = $3; $$ = (Node *)n; } | DROP ROLE IF_P EXISTS role_list { DropRoleStmt *n = makeNode(DropRoleStmt); - n->missing_ok = TRUE; + n->missing_ok = true; n->roles = $5; $$ = (Node *)n; } | DROP USER role_list { DropRoleStmt *n = makeNode(DropRoleStmt); - n->missing_ok = FALSE; + n->missing_ok = false; n->roles = $3; $$ = (Node *)n; } @@ -1212,20 +1212,20 @@ DropRoleStmt: { DropRoleStmt *n = makeNode(DropRoleStmt); n->roles = $5; - n->missing_ok = TRUE; + n->missing_ok = true; $$ = (Node *)n; } | DROP GROUP_P role_list { DropRoleStmt *n = makeNode(DropRoleStmt); - n->missing_ok = FALSE; + n->missing_ok = false; n->roles = $3; $$ = (Node *)n; } | DROP GROUP_P IF_P EXISTS role_list { DropRoleStmt *n = makeNode(DropRoleStmt); - n->missing_ok = TRUE; + n->missing_ok = true; n->roles = $5; $$ = (Node *)n; } @@ -1730,8 +1730,8 @@ constraints_set_list: ; constraints_set_mode: - DEFERRED { $$ = TRUE; } - | IMMEDIATE { $$ = FALSE; } + DEFERRED { $$ = true; } + | IMMEDIATE { $$ = false; } ; @@ -2172,7 +2172,7 @@ alter_table_cmd: n->subtype = AT_DropColumn; n->name = $5; n->behavior = $6; - n->missing_ok = TRUE; + n->missing_ok = true; $$ = (Node *)n; } /* ALTER TABLE DROP [COLUMN] [RESTRICT|CASCADE] */ @@ -2182,7 +2182,7 @@ alter_table_cmd: n->subtype = AT_DropColumn; n->name = $3; n->behavior = $4; - n->missing_ok = FALSE; + n->missing_ok = false; $$ = (Node *)n; } /* @@ -2250,7 +2250,7 @@ alter_table_cmd: n->subtype = AT_DropConstraint; n->name = $5; n->behavior = $6; - n->missing_ok = TRUE; + n->missing_ok = true; $$ = (Node *)n; } /* ALTER TABLE DROP CONSTRAINT [RESTRICT|CASCADE] */ @@ -2260,7 +2260,7 @@ alter_table_cmd: n->subtype = AT_DropConstraint; n->name = $3; n->behavior = $4; - n->missing_ok = FALSE; + n->missing_ok = false; $$ = (Node *)n; } /* ALTER TABLE SET WITH OIDS */ @@ -2768,7 +2768,7 @@ alter_type_cmd: n->subtype = AT_DropColumn; n->name = $5; n->behavior = $6; - n->missing_ok = TRUE; + n->missing_ok = true; $$ = (Node *)n; } /* ALTER TYPE DROP ATTRIBUTE [RESTRICT|CASCADE] */ @@ -2778,7 +2778,7 @@ alter_type_cmd: n->subtype = AT_DropColumn; n->name = $3; n->behavior = $4; - n->missing_ok = FALSE; + n->missing_ok = false; $$ = (Node *)n; } /* ALTER TYPE ALTER ATTRIBUTE [SET DATA] TYPE [RESTRICT|CASCADE] */ @@ -2898,13 +2898,13 @@ CopyStmt: COPY opt_binary qualified_name opt_column_list opt_oids ; copy_from: - FROM { $$ = TRUE; } - | TO { $$ = FALSE; } + FROM { $$ = true; } + | TO { $$ = false; } ; opt_program: - PROGRAM { $$ = TRUE; } - | /* EMPTY */ { $$ = FALSE; } + PROGRAM { $$ = true; } + | /* EMPTY */ { $$ = false; } ; /* @@ -2935,11 +2935,11 @@ copy_opt_item: } | OIDS { - $$ = makeDefElem("oids", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("oids", (Node *)makeInteger(true), @1); } | FREEZE { - $$ = makeDefElem("freeze", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("freeze", (Node *)makeInteger(true), @1); } | DELIMITER opt_as Sconst { @@ -2955,7 +2955,7 @@ copy_opt_item: } | HEADER_P { - $$ = makeDefElem("header", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("header", (Node *)makeInteger(true), @1); } | QUOTE opt_as Sconst { @@ -3000,7 +3000,7 @@ opt_binary: opt_oids: WITH OIDS { - $$ = makeDefElem("oids", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("oids", (Node *)makeInteger(true), @1); } | /*EMPTY*/ { $$ = NULL; } ; @@ -3654,8 +3654,8 @@ ConstraintElem: } ; -opt_no_inherit: NO INHERIT { $$ = TRUE; } - | /* EMPTY */ { $$ = FALSE; } +opt_no_inherit: NO INHERIT { $$ = true; } + | /* EMPTY */ { $$ = false; } ; opt_column_list: @@ -3932,9 +3932,9 @@ create_as_target: ; opt_with_data: - WITH DATA_P { $$ = TRUE; } - | WITH NO DATA_P { $$ = FALSE; } - | /*EMPTY*/ { $$ = TRUE; } + WITH DATA_P { $$ = true; } + | WITH NO DATA_P { $$ = false; } + | /*EMPTY*/ { $$ = true; } ; @@ -4085,11 +4085,11 @@ SeqOptElem: AS SimpleTypename } | CYCLE { - $$ = makeDefElem("cycle", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("cycle", (Node *)makeInteger(true), @1); } | NO CYCLE { - $$ = makeDefElem("cycle", (Node *)makeInteger(FALSE), @1); + $$ = makeDefElem("cycle", (Node *)makeInteger(false), @1); } | INCREMENT opt_by NumericOnly { @@ -4189,8 +4189,8 @@ CreatePLangStmt: ; opt_trusted: - TRUSTED { $$ = TRUE; } - | /*EMPTY*/ { $$ = FALSE; } + TRUSTED { $$ = true; } + | /*EMPTY*/ { $$ = false; } ; /* This ought to be just func_name, but that causes reduce/reduce conflicts @@ -4341,7 +4341,7 @@ create_extension_opt_item: } | CASCADE { - $$ = makeDefElem("cascade", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("cascade", (Node *)makeInteger(true), @1); } ; @@ -5205,9 +5205,9 @@ CreateTrigStmt: n->columns = (List *) lsecond($5); n->whenClause = $10; n->transitionRels = $8; - n->isconstraint = FALSE; - n->deferrable = FALSE; - n->initdeferred = FALSE; + n->isconstraint = false; + n->deferrable = false; + n->initdeferred = false; n->constrrel = NULL; $$ = (Node *)n; } @@ -5221,13 +5221,13 @@ CreateTrigStmt: n->relation = $8; n->funcname = $17; n->args = $19; - n->row = TRUE; + n->row = true; n->timing = TRIGGER_TYPE_AFTER; n->events = intVal(linitial($6)); n->columns = (List *) lsecond($6); n->whenClause = $14; n->transitionRels = NIL; - n->isconstraint = TRUE; + n->isconstraint = true; processCASbits($10, @10, "TRIGGER", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); @@ -5301,12 +5301,12 @@ TriggerTransition: ; TransitionOldOrNew: - NEW { $$ = TRUE; } - | OLD { $$ = FALSE; } + NEW { $$ = true; } + | OLD { $$ = false; } ; TransitionRowOrTable: - TABLE { $$ = TRUE; } + TABLE { $$ = true; } /* * According to the standard, lack of a keyword here implies ROW. * Support for that would require prohibiting ROW entirely here, @@ -5315,7 +5315,7 @@ TransitionRowOrTable: * next token. Requiring ROW seems cleanest and easiest to * explain. */ - | ROW { $$ = FALSE; } + | ROW { $$ = false; } ; TransitionRelName: @@ -5333,7 +5333,7 @@ TriggerForSpec: * If ROW/STATEMENT not specified, default to * STATEMENT, per SQL */ - $$ = FALSE; + $$ = false; } ; @@ -5343,8 +5343,8 @@ TriggerForOptEach: ; TriggerForType: - ROW { $$ = TRUE; } - | STATEMENT { $$ = FALSE; } + ROW { $$ = true; } + | STATEMENT { $$ = false; } ; TriggerWhen: @@ -5495,7 +5495,7 @@ CreateAssertStmt: CreateTrigStmt *n = makeNode(CreateTrigStmt); n->trigname = $3; n->args = list_make1($6); - n->isconstraint = TRUE; + n->isconstraint = true; processCASbits($8, @8, "ASSERTION", &n->deferrable, &n->initdeferred, NULL, NULL, yyscanner); @@ -5875,8 +5875,8 @@ opclass_item: } ; -opt_default: DEFAULT { $$ = TRUE; } - | /*EMPTY*/ { $$ = FALSE; } +opt_default: DEFAULT { $$ = true; } + | /*EMPTY*/ { $$ = false; } ; opt_opfamily: FAMILY any_name { $$ = $2; } @@ -5900,9 +5900,9 @@ opt_recheck: RECHECK errmsg("RECHECK is no longer required"), errhint("Update your data type."), parser_errposition(@1))); - $$ = TRUE; + $$ = true; } - | /*EMPTY*/ { $$ = FALSE; } + | /*EMPTY*/ { $$ = false; } ; @@ -6050,7 +6050,7 @@ DropStmt: DROP drop_type_any_name IF_P EXISTS any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = $2; - n->missing_ok = TRUE; + n->missing_ok = true; n->objects = $5; n->behavior = $6; n->concurrent = false; @@ -6060,7 +6060,7 @@ DropStmt: DROP drop_type_any_name IF_P EXISTS any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = $2; - n->missing_ok = FALSE; + n->missing_ok = false; n->objects = $3; n->behavior = $4; n->concurrent = false; @@ -6070,7 +6070,7 @@ DropStmt: DROP drop_type_any_name IF_P EXISTS any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = $2; - n->missing_ok = TRUE; + n->missing_ok = true; n->objects = $5; n->behavior = $6; n->concurrent = false; @@ -6080,7 +6080,7 @@ DropStmt: DROP drop_type_any_name IF_P EXISTS any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = $2; - n->missing_ok = FALSE; + n->missing_ok = false; n->objects = $3; n->behavior = $4; n->concurrent = false; @@ -6110,7 +6110,7 @@ DropStmt: DROP drop_type_any_name IF_P EXISTS any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TYPE; - n->missing_ok = FALSE; + n->missing_ok = false; n->objects = $3; n->behavior = $4; n->concurrent = false; @@ -6120,7 +6120,7 @@ DropStmt: DROP drop_type_any_name IF_P EXISTS any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_TYPE; - n->missing_ok = TRUE; + n->missing_ok = true; n->objects = $5; n->behavior = $6; n->concurrent = false; @@ -6130,7 +6130,7 @@ DropStmt: DROP drop_type_any_name IF_P EXISTS any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_DOMAIN; - n->missing_ok = FALSE; + n->missing_ok = false; n->objects = $3; n->behavior = $4; n->concurrent = false; @@ -6140,7 +6140,7 @@ DropStmt: DROP drop_type_any_name IF_P EXISTS any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_DOMAIN; - n->missing_ok = TRUE; + n->missing_ok = true; n->objects = $5; n->behavior = $6; n->concurrent = false; @@ -6150,7 +6150,7 @@ DropStmt: DROP drop_type_any_name IF_P EXISTS any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_INDEX; - n->missing_ok = FALSE; + n->missing_ok = false; n->objects = $4; n->behavior = $5; n->concurrent = true; @@ -6160,7 +6160,7 @@ DropStmt: DROP drop_type_any_name IF_P EXISTS any_name_list opt_drop_behavior { DropStmt *n = makeNode(DropStmt); n->removeType = OBJECT_INDEX; - n->missing_ok = TRUE; + n->missing_ok = true; n->objects = $6; n->behavior = $7; n->concurrent = true; @@ -6582,13 +6582,13 @@ security_label: Sconst { $$ = $1; } FetchStmt: FETCH fetch_args { FetchStmt *n = (FetchStmt *) $2; - n->ismove = FALSE; + n->ismove = false; $$ = (Node *)n; } | MOVE fetch_args { FetchStmt *n = (FetchStmt *) $2; - n->ismove = TRUE; + n->ismove = true; $$ = (Node *)n; } ; @@ -6998,8 +6998,8 @@ grantee: opt_grant_grant_option: - WITH GRANT OPTION { $$ = TRUE; } - | /*EMPTY*/ { $$ = FALSE; } + WITH GRANT OPTION { $$ = true; } + | /*EMPTY*/ { $$ = false; } ; /***************************************************************************** @@ -7044,8 +7044,8 @@ RevokeRoleStmt: } ; -opt_grant_admin_option: WITH ADMIN OPTION { $$ = TRUE; } - | /*EMPTY*/ { $$ = FALSE; } +opt_grant_admin_option: WITH ADMIN OPTION { $$ = true; } + | /*EMPTY*/ { $$ = false; } ; opt_granted_by: GRANTED BY RoleSpec { $$ = $3; } @@ -7208,13 +7208,13 @@ IndexStmt: CREATE opt_unique INDEX opt_concurrently opt_index_name ; opt_unique: - UNIQUE { $$ = TRUE; } - | /*EMPTY*/ { $$ = FALSE; } + UNIQUE { $$ = true; } + | /*EMPTY*/ { $$ = false; } ; opt_concurrently: - CONCURRENTLY { $$ = TRUE; } - | /*EMPTY*/ { $$ = FALSE; } + CONCURRENTLY { $$ = true; } + | /*EMPTY*/ { $$ = false; } ; opt_index_name: @@ -7342,8 +7342,8 @@ CreateFunctionStmt: ; opt_or_replace: - OR REPLACE { $$ = TRUE; } - | /*EMPTY*/ { $$ = FALSE; } + OR REPLACE { $$ = true; } + | /*EMPTY*/ { $$ = false; } ; func_args: '(' func_args_list ')' { $$ = $2; } @@ -7512,7 +7512,7 @@ func_type: Typename { $$ = $1; } { $$ = makeTypeNameFromNameList(lcons(makeString($2), $3)); $$->pct_type = true; - $$->setof = TRUE; + $$->setof = true; $$->location = @2; } ; @@ -7628,15 +7628,15 @@ createfunc_opt_list: common_func_opt_item: CALLED ON NULL_P INPUT_P { - $$ = makeDefElem("strict", (Node *)makeInteger(FALSE), @1); + $$ = makeDefElem("strict", (Node *)makeInteger(false), @1); } | RETURNS NULL_P ON NULL_P INPUT_P { - $$ = makeDefElem("strict", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("strict", (Node *)makeInteger(true), @1); } | STRICT_P { - $$ = makeDefElem("strict", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("strict", (Node *)makeInteger(true), @1); } | IMMUTABLE { @@ -7652,27 +7652,27 @@ common_func_opt_item: } | EXTERNAL SECURITY DEFINER { - $$ = makeDefElem("security", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("security", (Node *)makeInteger(true), @1); } | EXTERNAL SECURITY INVOKER { - $$ = makeDefElem("security", (Node *)makeInteger(FALSE), @1); + $$ = makeDefElem("security", (Node *)makeInteger(false), @1); } | SECURITY DEFINER { - $$ = makeDefElem("security", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("security", (Node *)makeInteger(true), @1); } | SECURITY INVOKER { - $$ = makeDefElem("security", (Node *)makeInteger(FALSE), @1); + $$ = makeDefElem("security", (Node *)makeInteger(false), @1); } | LEAKPROOF { - $$ = makeDefElem("leakproof", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("leakproof", (Node *)makeInteger(true), @1); } | NOT LEAKPROOF { - $$ = makeDefElem("leakproof", (Node *)makeInteger(FALSE), @1); + $$ = makeDefElem("leakproof", (Node *)makeInteger(false), @1); } | COST NumericOnly { @@ -7708,7 +7708,7 @@ createfunc_opt_item: } | WINDOW { - $$ = makeDefElem("window", (Node *)makeInteger(TRUE), @1); + $$ = makeDefElem("window", (Node *)makeInteger(true), @1); } | common_func_opt_item { @@ -7997,8 +7997,8 @@ DropCastStmt: DROP CAST opt_if_exists '(' Typename AS Typename ')' opt_drop_beha } ; -opt_if_exists: IF_P EXISTS { $$ = TRUE; } - | /*EMPTY*/ { $$ = FALSE; } +opt_if_exists: IF_P EXISTS { $$ = true; } + | /*EMPTY*/ { $$ = false; } ; @@ -8126,7 +8126,7 @@ AlterTblSpcStmt: makeNode(AlterTableSpaceOptionsStmt); n->tablespacename = $3; n->options = $5; - n->isReset = FALSE; + n->isReset = false; $$ = (Node *)n; } | ALTER TABLESPACE name RESET reloptions @@ -8135,7 +8135,7 @@ AlterTblSpcStmt: makeNode(AlterTableSpaceOptionsStmt); n->tablespacename = $3; n->options = $5; - n->isReset = TRUE; + n->isReset = true; $$ = (Node *)n; } ; @@ -9162,7 +9162,7 @@ CreatePublicationStmt: n->tables = (List *)$4; /* FOR ALL TABLES */ else - n->for_all_tables = TRUE; + n->for_all_tables = true; } $$ = (Node *)n; } @@ -9180,7 +9180,7 @@ publication_for_tables: } | FOR ALL TABLES { - $$ = (Node *) makeInteger(TRUE); + $$ = (Node *) makeInteger(true); } ; @@ -9315,7 +9315,7 @@ AlterSubscriptionStmt: n->kind = ALTER_SUBSCRIPTION_ENABLED; n->subname = $3; n->options = list_make1(makeDefElem("enabled", - (Node *)makeInteger(TRUE), @1)); + (Node *)makeInteger(true), @1)); $$ = (Node *)n; } | ALTER SUBSCRIPTION name DISABLE_P @@ -9325,7 +9325,7 @@ AlterSubscriptionStmt: n->kind = ALTER_SUBSCRIPTION_ENABLED; n->subname = $3; n->options = list_make1(makeDefElem("enabled", - (Node *)makeInteger(FALSE), @1)); + (Node *)makeInteger(false), @1)); $$ = (Node *)n; } ; @@ -9418,9 +9418,9 @@ event: SELECT { $$ = CMD_SELECT; } ; opt_instead: - INSTEAD { $$ = TRUE; } - | ALSO { $$ = FALSE; } - | /*EMPTY*/ { $$ = FALSE; } + INSTEAD { $$ = true; } + | ALSO { $$ = false; } + | /*EMPTY*/ { $$ = false; } ; @@ -9596,16 +9596,16 @@ transaction_mode_item: makeStringConst($3, @3), @1); } | READ ONLY { $$ = makeDefElem("transaction_read_only", - makeIntConst(TRUE, @1), @1); } + makeIntConst(true, @1), @1); } | READ WRITE { $$ = makeDefElem("transaction_read_only", - makeIntConst(FALSE, @1), @1); } + makeIntConst(false, @1), @1); } | DEFERRABLE { $$ = makeDefElem("transaction_deferrable", - makeIntConst(TRUE, @1), @1); } + makeIntConst(true, @1), @1); } | NOT DEFERRABLE { $$ = makeDefElem("transaction_deferrable", - makeIntConst(FALSE, @1), @1); } + makeIntConst(false, @1), @1); } ; /* Syntax with commas is SQL-spec, without commas is Postgres historical */ @@ -9844,14 +9844,14 @@ DropdbStmt: DROP DATABASE database_name { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = $3; - n->missing_ok = FALSE; + n->missing_ok = false; $$ = (Node *)n; } | DROP DATABASE IF_P EXISTS database_name { DropdbStmt *n = makeNode(DropdbStmt); n->dbname = $5; - n->missing_ok = TRUE; + n->missing_ok = true; $$ = (Node *)n; } ; @@ -10258,16 +10258,16 @@ analyze_keyword: ; opt_verbose: - VERBOSE { $$ = TRUE; } - | /*EMPTY*/ { $$ = FALSE; } + VERBOSE { $$ = true; } + | /*EMPTY*/ { $$ = false; } ; -opt_full: FULL { $$ = TRUE; } - | /*EMPTY*/ { $$ = FALSE; } +opt_full: FULL { $$ = true; } + | /*EMPTY*/ { $$ = false; } ; -opt_freeze: FREEZE { $$ = TRUE; } - | /*EMPTY*/ { $$ = FALSE; } +opt_freeze: FREEZE { $$ = true; } + | /*EMPTY*/ { $$ = false; } ; opt_name_list: @@ -10665,8 +10665,8 @@ lock_type: ACCESS SHARE { $$ = AccessShareLock; } | ACCESS EXCLUSIVE { $$ = AccessExclusiveLock; } ; -opt_nowait: NOWAIT { $$ = TRUE; } - | /*EMPTY*/ { $$ = FALSE; } +opt_nowait: NOWAIT { $$ = true; } + | /*EMPTY*/ { $$ = false; } ; opt_nowait_or_skip: @@ -11133,9 +11133,9 @@ opt_table: TABLE {} ; all_or_distinct: - ALL { $$ = TRUE; } - | DISTINCT { $$ = FALSE; } - | /*EMPTY*/ { $$ = FALSE; } + ALL { $$ = true; } + | DISTINCT { $$ = false; } + | /*EMPTY*/ { $$ = false; } ; /* We use (NIL) as a placeholder to indicate that all target expressions @@ -11564,7 +11564,7 @@ joined_table: /* CROSS JOIN is same as unqualified inner join */ JoinExpr *n = makeNode(JoinExpr); n->jointype = JOIN_INNER; - n->isNatural = FALSE; + n->isNatural = false; n->larg = $1; n->rarg = $4; n->usingClause = NIL; @@ -11575,7 +11575,7 @@ joined_table: { JoinExpr *n = makeNode(JoinExpr); n->jointype = $2; - n->isNatural = FALSE; + n->isNatural = false; n->larg = $1; n->rarg = $4; if ($5 != NULL && IsA($5, List)) @@ -11589,7 +11589,7 @@ joined_table: /* letting join_type reduce to empty doesn't work */ JoinExpr *n = makeNode(JoinExpr); n->jointype = JOIN_INNER; - n->isNatural = FALSE; + n->isNatural = false; n->larg = $1; n->rarg = $3; if ($4 != NULL && IsA($4, List)) @@ -11602,7 +11602,7 @@ joined_table: { JoinExpr *n = makeNode(JoinExpr); n->jointype = $3; - n->isNatural = TRUE; + n->isNatural = true; n->larg = $1; n->rarg = $5; n->usingClause = NIL; /* figure out which columns later... */ @@ -11614,7 +11614,7 @@ joined_table: /* letting join_type reduce to empty doesn't work */ JoinExpr *n = makeNode(JoinExpr); n->jointype = JOIN_INNER; - n->isNatural = TRUE; + n->isNatural = true; n->larg = $1; n->rarg = $4; n->usingClause = NIL; /* figure out which columns later... */ @@ -12084,7 +12084,7 @@ Typename: SimpleTypename opt_array_bounds { $$ = $2; $$->arrayBounds = $3; - $$->setof = TRUE; + $$->setof = true; } /* SQL standard syntax, currently only one-dimensional */ | SimpleTypename ARRAY '[' Iconst ']' @@ -12096,7 +12096,7 @@ Typename: SimpleTypename opt_array_bounds { $$ = $2; $$->arrayBounds = list_make1(makeInteger($5)); - $$->setof = TRUE; + $$->setof = true; } | SimpleTypename ARRAY { @@ -12107,7 +12107,7 @@ Typename: SimpleTypename opt_array_bounds { $$ = $2; $$->arrayBounds = list_make1(makeInteger(-1)); - $$->setof = TRUE; + $$->setof = true; } ; @@ -12394,8 +12394,8 @@ character: CHARACTER opt_varying ; opt_varying: - VARYING { $$ = TRUE; } - | /*EMPTY*/ { $$ = FALSE; } + VARYING { $$ = true; } + | /*EMPTY*/ { $$ = false; } ; /* @@ -12447,9 +12447,9 @@ ConstInterval: ; opt_timezone: - WITH_LA TIME ZONE { $$ = TRUE; } - | WITHOUT TIME ZONE { $$ = FALSE; } - | /*EMPTY*/ { $$ = FALSE; } + WITH_LA TIME ZONE { $$ = true; } + | WITHOUT TIME ZONE { $$ = false; } + | /*EMPTY*/ { $$ = false; } ; opt_interval: @@ -13210,14 +13210,14 @@ func_application: func_name '(' ')' | func_name '(' VARIADIC func_arg_expr opt_sort_clause ')' { FuncCall *n = makeFuncCall($1, list_make1($4), @1); - n->func_variadic = TRUE; + n->func_variadic = true; n->agg_order = $5; $$ = (Node *)n; } | func_name '(' func_arg_list ',' VARIADIC func_arg_expr opt_sort_clause ')' { FuncCall *n = makeFuncCall($1, lappend($3, $6), @1); - n->func_variadic = TRUE; + n->func_variadic = true; n->agg_order = $7; $$ = (Node *)n; } @@ -13235,7 +13235,7 @@ func_application: func_name '(' ')' { FuncCall *n = makeFuncCall($1, $4, @1); n->agg_order = $5; - n->agg_distinct = TRUE; + n->agg_distinct = true; $$ = (Node *)n; } | func_name '(' '*' ')' @@ -13251,7 +13251,7 @@ func_application: func_name '(' ')' * really was. */ FuncCall *n = makeFuncCall($1, NIL, @1); - n->agg_star = TRUE; + n->agg_star = true; $$ = (Node *)n; } ; @@ -13295,7 +13295,7 @@ func_expr: func_application within_group_clause filter_clause over_clause errmsg("cannot use VARIADIC with WITHIN GROUP"), parser_errposition(@2))); n->agg_order = $2; - n->agg_within_group = TRUE; + n->agg_within_group = true; } n->agg_filter = $3; n->over = $4; @@ -13585,9 +13585,9 @@ document_or_content: DOCUMENT_P { $$ = XMLOPTION_DOCUMENT; } | CONTENT_P { $$ = XMLOPTION_CONTENT; } ; -xml_whitespace_option: PRESERVE WHITESPACE_P { $$ = TRUE; } - | STRIP_P WHITESPACE_P { $$ = FALSE; } - | /*EMPTY*/ { $$ = FALSE; } +xml_whitespace_option: PRESERVE WHITESPACE_P { $$ = true; } + | STRIP_P WHITESPACE_P { $$ = false; } + | /*EMPTY*/ { $$ = false; } ; /* We allow several variants for SQL and other compatibility. */ @@ -14459,11 +14459,11 @@ AexprConst: Iconst } | TRUE_P { - $$ = makeBoolAConst(TRUE, @1); + $$ = makeBoolAConst(true, @1); } | FALSE_P { - $$ = makeBoolAConst(FALSE, @1); + $$ = makeBoolAConst(false, @1); } | NULL_P { diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 655da02c10..a905e3e1af 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -627,7 +627,7 @@ transformColumnDefinition(CreateStmtContext *cxt, ColumnDef *column) column->colname, cxt->relation->relname), parser_errposition(cxt->pstate, constraint->location))); - column->is_not_null = FALSE; + column->is_not_null = false; saw_nullable = true; break; @@ -639,7 +639,7 @@ transformColumnDefinition(CreateStmtContext *cxt, ColumnDef *column) column->colname, cxt->relation->relname), parser_errposition(cxt->pstate, constraint->location))); - column->is_not_null = TRUE; + column->is_not_null = true; saw_nullable = true; break; @@ -679,7 +679,7 @@ transformColumnDefinition(CreateStmtContext *cxt, ColumnDef *column) column->identity = constraint->generated_when; saw_identity = true; - column->is_not_null = TRUE; + column->is_not_null = true; break; } @@ -2009,7 +2009,7 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt) { /* found column in the new table; force it to be NOT NULL */ if (constraint->contype == CONSTR_PRIMARY) - column->is_not_null = TRUE; + column->is_not_null = true; } else if (SystemAttributeByName(key, cxt->hasoids) != NULL) { diff --git a/src/backend/replication/repl_gram.y b/src/backend/replication/repl_gram.y index a012447fa2..6e4ca10116 100644 --- a/src/backend/replication/repl_gram.y +++ b/src/backend/replication/repl_gram.y @@ -181,22 +181,22 @@ base_backup_opt: | K_PROGRESS { $$ = makeDefElem("progress", - (Node *)makeInteger(TRUE), -1); + (Node *)makeInteger(true), -1); } | K_FAST { $$ = makeDefElem("fast", - (Node *)makeInteger(TRUE), -1); + (Node *)makeInteger(true), -1); } | K_WAL { $$ = makeDefElem("wal", - (Node *)makeInteger(TRUE), -1); + (Node *)makeInteger(true), -1); } | K_NOWAIT { $$ = makeDefElem("nowait", - (Node *)makeInteger(TRUE), -1); + (Node *)makeInteger(true), -1); } | K_MAX_RATE UCONST { @@ -206,7 +206,7 @@ base_backup_opt: | K_TABLESPACE_MAP { $$ = makeDefElem("tablespace_map", - (Node *)makeInteger(TRUE), -1); + (Node *)makeInteger(true), -1); } ; @@ -247,22 +247,22 @@ create_slot_opt: K_EXPORT_SNAPSHOT { $$ = makeDefElem("export_snapshot", - (Node *)makeInteger(TRUE), -1); + (Node *)makeInteger(true), -1); } | K_NOEXPORT_SNAPSHOT { $$ = makeDefElem("export_snapshot", - (Node *)makeInteger(FALSE), -1); + (Node *)makeInteger(false), -1); } | K_USE_SNAPSHOT { $$ = makeDefElem("use_snapshot", - (Node *)makeInteger(TRUE), -1); + (Node *)makeInteger(true), -1); } | K_RESERVE_WAL { $$ = makeDefElem("reserve_wal", - (Node *)makeInteger(TRUE), -1); + (Node *)makeInteger(true), -1); } ; diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 15795b0c5a..572f413d6e 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -975,7 +975,7 @@ ReadBuffer_common(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, * * The returned buffer is pinned and is already marked as holding the * desired page. If it already did have the desired page, *foundPtr is - * set TRUE. Otherwise, *foundPtr is set FALSE and the buffer is marked + * set true. Otherwise, *foundPtr is set false and the buffer is marked * as IO_IN_PROGRESS; ReadBuffer will now need to do I/O to fill it. * * *foundPtr is actually redundant with the buffer's BM_VALID flag, but @@ -1025,7 +1025,7 @@ BufferAlloc(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, /* Can release the mapping lock as soon as we've pinned it */ LWLockRelease(newPartitionLock); - *foundPtr = TRUE; + *foundPtr = true; if (!valid) { @@ -1042,7 +1042,7 @@ BufferAlloc(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, * If we get here, previous attempts to read the buffer must * have failed ... but we shall bravely try again. */ - *foundPtr = FALSE; + *foundPtr = false; } } @@ -1237,7 +1237,7 @@ BufferAlloc(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, /* Can release the mapping lock as soon as we've pinned it */ LWLockRelease(newPartitionLock); - *foundPtr = TRUE; + *foundPtr = true; if (!valid) { @@ -1254,7 +1254,7 @@ BufferAlloc(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, * If we get here, previous attempts to read the buffer * must have failed ... but we shall bravely try again. */ - *foundPtr = FALSE; + *foundPtr = false; } } @@ -1324,9 +1324,9 @@ BufferAlloc(SMgrRelation smgr, char relpersistence, ForkNumber forkNum, * read it before we did, so there's nothing left for BufferAlloc() to do. */ if (StartBufferIO(buf, true)) - *foundPtr = FALSE; + *foundPtr = false; else - *foundPtr = TRUE; + *foundPtr = true; return buf; } @@ -1564,7 +1564,7 @@ ReleaseAndReadBuffer(Buffer buffer, * * Note that ResourceOwnerEnlargeBuffers must have been done already. * - * Returns TRUE if buffer is BM_VALID, else FALSE. This provision allows + * Returns true if buffer is BM_VALID, else false. This provision allows * some callers to avoid an extra spinlock cycle. */ static bool @@ -1688,7 +1688,7 @@ PinBuffer_Locked(BufferDesc *buf) * This should be applied only to shared buffers, never local ones. * * Most but not all callers want CurrentResourceOwner to be adjusted. - * Those that don't should pass fixOwner = FALSE. + * Those that don't should pass fixOwner = false. */ static void UnpinBuffer(BufferDesc *buf, bool fixOwner) @@ -3712,7 +3712,7 @@ HoldingBufferPinThatDelaysRecovery(void) * ConditionalLockBufferForCleanup - as above, but don't wait to get the lock * * We won't loop, but just check once to see if the pin count is OK. If - * not, return FALSE with no lock held. + * not, return false with no lock held. */ bool ConditionalLockBufferForCleanup(Buffer buffer) @@ -3868,8 +3868,8 @@ WaitIO(BufferDesc *buf) * and output operations only on buffers that are BM_VALID and BM_DIRTY, * so we can always tell if the work is already done. * - * Returns TRUE if we successfully marked the buffer as I/O busy, - * FALSE if someone else already did the work. + * Returns true if we successfully marked the buffer as I/O busy, + * false if someone else already did the work. */ static bool StartBufferIO(BufferDesc *buf, bool forInput) @@ -3929,7 +3929,7 @@ StartBufferIO(BufferDesc *buf, bool forInput) * We hold the buffer's io_in_progress lock * The buffer is Pinned * - * If clear_dirty is TRUE and BM_JUST_DIRTIED is not set, we clear the + * If clear_dirty is true and BM_JUST_DIRTIED is not set, we clear the * buffer's BM_DIRTY flag. This is appropriate when terminating a * successful write. The check on BM_JUST_DIRTIED is necessary to avoid * marking the buffer clean if it was re-dirtied while we were writing. diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c index 1d540e87e8..1930f0ee0b 100644 --- a/src/backend/storage/buffer/localbuf.c +++ b/src/backend/storage/buffer/localbuf.c @@ -145,11 +145,11 @@ LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum, ResourceOwnerRememberBuffer(CurrentResourceOwner, BufferDescriptorGetBuffer(bufHdr)); if (buf_state & BM_VALID) - *foundPtr = TRUE; + *foundPtr = true; else { /* Previous read attempt must have failed; try again */ - *foundPtr = FALSE; + *foundPtr = false; } return bufHdr; } @@ -268,7 +268,7 @@ LocalBufferAlloc(SMgrRelation smgr, ForkNumber forkNum, BlockNumber blockNum, buf_state += BUF_USAGECOUNT_ONE; pg_atomic_unlocked_write_u32(&bufHdr->state, buf_state); - *foundPtr = FALSE; + *foundPtr = false; return bufHdr; } diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c index 81c291f6e3..22522676f3 100644 --- a/src/backend/storage/ipc/shmem.c +++ b/src/backend/storage/ipc/shmem.c @@ -257,7 +257,7 @@ ShmemAllocUnlocked(Size size) /* * ShmemAddrIsValid -- test if an address refers to shared memory * - * Returns TRUE if the pointer points within the shared memory segment. + * Returns true if the pointer points within the shared memory segment. */ bool ShmemAddrIsValid(const void *addr) @@ -361,7 +361,7 @@ ShmemInitHash(const char *name, /* table string name for shmem index */ * for it. If it exists already, a pointer to the existing * structure is returned. * - * Returns: pointer to the object. *foundPtr is set TRUE if the object was + * Returns: pointer to the object. *foundPtr is set true if the object was * already in the shmem index (hence, already initialized). * * Note: before Postgres 9.0, this function returned NULL for some failure @@ -388,7 +388,7 @@ ShmemInitStruct(const char *name, Size size, bool *foundPtr) /* Must be initializing a (non-standalone) backend */ Assert(shmemseghdr->index != NULL); structPtr = shmemseghdr->index; - *foundPtr = TRUE; + *foundPtr = true; } else { @@ -403,7 +403,7 @@ ShmemInitStruct(const char *name, Size size, bool *foundPtr) Assert(shmemseghdr->index == NULL); structPtr = ShmemAlloc(size); shmemseghdr->index = structPtr; - *foundPtr = FALSE; + *foundPtr = false; } LWLockRelease(ShmemIndexLock); return structPtr; diff --git a/src/backend/storage/ipc/shmqueue.c b/src/backend/storage/ipc/shmqueue.c index 1026e67b94..da67495b03 100644 --- a/src/backend/storage/ipc/shmqueue.c +++ b/src/backend/storage/ipc/shmqueue.c @@ -40,7 +40,7 @@ SHMQueueInit(SHM_QUEUE *queue) } /* - * SHMQueueIsDetached -- TRUE if element is not currently + * SHMQueueIsDetached -- true if element is not currently * in a queue. */ bool @@ -174,7 +174,7 @@ SHMQueuePrev(const SHM_QUEUE *queue, const SHM_QUEUE *curElem, Size linkOffset) } /* - * SHMQueueEmpty -- TRUE if queue head is only element, FALSE otherwise + * SHMQueueEmpty -- true if queue head is only element, false otherwise */ bool SHMQueueEmpty(const SHM_QUEUE *queue) @@ -184,7 +184,7 @@ SHMQueueEmpty(const SHM_QUEUE *queue) if (queue->prev == queue) { Assert(queue->next == queue); - return TRUE; + return true; } - return FALSE; + return false; } diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index 2b26173924..5833086c62 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -768,7 +768,7 @@ LockAcquireExtended(const LOCKTAG *locktag, locallock->nLocks = 0; locallock->numLockOwners = 0; locallock->maxLockOwners = 8; - locallock->holdsStrongLockCount = FALSE; + locallock->holdsStrongLockCount = false; locallock->lockOwners = NULL; /* in case next line fails */ locallock->lockOwners = (LOCALLOCKOWNER *) MemoryContextAlloc(TopMemoryContext, @@ -1264,7 +1264,7 @@ RemoveLocalLock(LOCALLOCK *locallock) SpinLockAcquire(&FastPathStrongRelationLocks->mutex); Assert(FastPathStrongRelationLocks->count[fasthashcode] > 0); FastPathStrongRelationLocks->count[fasthashcode]--; - locallock->holdsStrongLockCount = FALSE; + locallock->holdsStrongLockCount = false; SpinLockRelease(&FastPathStrongRelationLocks->mutex); } @@ -1578,7 +1578,7 @@ static void BeginStrongLockAcquire(LOCALLOCK *locallock, uint32 fasthashcode) { Assert(StrongLockInProgress == NULL); - Assert(locallock->holdsStrongLockCount == FALSE); + Assert(locallock->holdsStrongLockCount == false); /* * Adding to a memory location is not atomic, so we take a spinlock to @@ -1591,7 +1591,7 @@ BeginStrongLockAcquire(LOCALLOCK *locallock, uint32 fasthashcode) SpinLockAcquire(&FastPathStrongRelationLocks->mutex); FastPathStrongRelationLocks->count[fasthashcode]++; - locallock->holdsStrongLockCount = TRUE; + locallock->holdsStrongLockCount = true; StrongLockInProgress = locallock; SpinLockRelease(&FastPathStrongRelationLocks->mutex); } @@ -1620,11 +1620,11 @@ AbortStrongLockAcquire(void) return; fasthashcode = FastPathStrongLockHashPartition(locallock->hashcode); - Assert(locallock->holdsStrongLockCount == TRUE); + Assert(locallock->holdsStrongLockCount == true); SpinLockAcquire(&FastPathStrongRelationLocks->mutex); Assert(FastPathStrongRelationLocks->count[fasthashcode] > 0); FastPathStrongRelationLocks->count[fasthashcode]--; - locallock->holdsStrongLockCount = FALSE; + locallock->holdsStrongLockCount = false; StrongLockInProgress = NULL; SpinLockRelease(&FastPathStrongRelationLocks->mutex); } @@ -1857,7 +1857,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock) { elog(WARNING, "you don't own a lock of type %s", lockMethodTable->lockModeNames[lockmode]); - return FALSE; + return false; } /* @@ -1896,7 +1896,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock) /* don't release a lock belonging to another owner */ elog(WARNING, "you don't own a lock of type %s", lockMethodTable->lockModeNames[lockmode]); - return FALSE; + return false; } } @@ -1907,7 +1907,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock) locallock->nLocks--; if (locallock->nLocks > 0) - return TRUE; + return true; /* Attempt fast release of any lock eligible for the fast path. */ if (EligibleForRelationFastPath(locktag, lockmode) && @@ -1926,7 +1926,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock) if (released) { RemoveLocalLock(locallock); - return TRUE; + return true; } } @@ -1984,7 +1984,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock) elog(WARNING, "you don't own a lock of type %s", lockMethodTable->lockModeNames[lockmode]); RemoveLocalLock(locallock); - return FALSE; + return false; } /* @@ -1999,7 +1999,7 @@ LockRelease(const LOCKTAG *locktag, LOCKMODE lockmode, bool sessionLock) LWLockRelease(partitionLock); RemoveLocalLock(locallock); - return TRUE; + return true; } /* @@ -3137,7 +3137,7 @@ AtPrepare_Locks(void) * entry. We must retain the count until the prepared transaction is * committed or rolled back. */ - locallock->holdsStrongLockCount = FALSE; + locallock->holdsStrongLockCount = false; /* * Create a 2PC record. diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index a3d7dc3697..efa37644fc 100644 --- a/src/backend/utils/adt/datetime.c +++ b/src/backend/utils/adt/datetime.c @@ -791,10 +791,10 @@ DecodeDateTime(char **field, int *ftype, int nf, int val; int dterr; int mer = HR24; - bool haveTextMonth = FALSE; - bool isjulian = FALSE; - bool is2digits = FALSE; - bool bc = FALSE; + bool haveTextMonth = false; + bool isjulian = false; + bool is2digits = false; + bool bc = false; pg_tz *namedTz = NULL; pg_tz *abbrevTz = NULL; pg_tz *valtz; @@ -840,7 +840,7 @@ DecodeDateTime(char **field, int *ftype, int nf, return DTERR_FIELD_OVERFLOW; j2date(val, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); - isjulian = TRUE; + isjulian = true; /* Get the time zone from the end of the string */ dterr = DecodeTimezone(cp, tzp); @@ -1087,7 +1087,7 @@ DecodeDateTime(char **field, int *ftype, int nf, return DTERR_FIELD_OVERFLOW; tmask = DTK_DATE_M; j2date(val, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); - isjulian = TRUE; + isjulian = true; /* fractional Julian Day? */ if (*cp == '.') @@ -1271,7 +1271,7 @@ DecodeDateTime(char **field, int *ftype, int nf, tm->tm_mday = tm->tm_mon; tmask = DTK_M(DAY); } - haveTextMonth = TRUE; + haveTextMonth = true; tm->tm_mon = val; break; @@ -1751,9 +1751,9 @@ DecodeTimeOnly(char **field, int *ftype, int nf, int i; int val; int dterr; - bool isjulian = FALSE; - bool is2digits = FALSE; - bool bc = FALSE; + bool isjulian = false; + bool is2digits = false; + bool bc = false; int mer = HR24; pg_tz *namedTz = NULL; pg_tz *abbrevTz = NULL; @@ -1991,7 +1991,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf, return DTERR_FIELD_OVERFLOW; tmask = DTK_DATE_M; j2date(val, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); - isjulian = TRUE; + isjulian = true; if (*cp == '.') { @@ -2086,7 +2086,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf, else { dterr = DecodeNumber(flen, field[i], - FALSE, + false, (fmask | DTK_DATE_M), &tmask, tm, fsec, &is2digits); @@ -2362,7 +2362,7 @@ DecodeTimeOnly(char **field, int *ftype, int nf, * str: field to be parsed * fmask: bitmask for field types already seen * *tmask: receives bitmask for fields found here - * *is2digits: set to TRUE if we find 2-digit year + * *is2digits: set to true if we find 2-digit year * *tm: field values are stored into appropriate members of this struct */ static int @@ -2374,7 +2374,7 @@ DecodeDate(char *str, int fmask, int *tmask, bool *is2digits, int i, len; int dterr; - bool haveTextMonth = FALSE; + bool haveTextMonth = false; int type, val, dmask = 0; @@ -2424,7 +2424,7 @@ DecodeDate(char *str, int fmask, int *tmask, bool *is2digits, { case MONTH: tm->tm_mon = val; - haveTextMonth = TRUE; + haveTextMonth = true; break; default: @@ -2755,7 +2755,7 @@ DecodeNumber(int flen, char *str, bool haveTextMonth, int fmask, *tmask = DTK_M(DAY); /* YEAR is already set */ tm->tm_mday = tm->tm_year; tm->tm_year = val; - *is2digits = FALSE; + *is2digits = false; } else { @@ -2859,7 +2859,7 @@ DecodeNumberField(int len, char *str, int fmask, *(str + (len - 4)) = '\0'; tm->tm_year = atoi(str); if ((len - 4) == 2) - *is2digits = TRUE; + *is2digits = true; return DTK_DATE; } @@ -3095,7 +3095,7 @@ int DecodeInterval(char **field, int *ftype, int nf, int range, int *dtype, struct pg_tm *tm, fsec_t *fsec) { - bool is_before = FALSE; + bool is_before = false; char *cp; int fmask = 0, tmask, @@ -3350,7 +3350,7 @@ DecodeInterval(char **field, int *ftype, int nf, int range, break; case AGO: - is_before = TRUE; + is_before = true; type = val; break; @@ -4193,7 +4193,7 @@ AddPostgresIntPart(char *cp, int value, const char *units, * tad bizarre but it's how it worked before... */ *is_before = (value < 0); - *is_zero = FALSE; + *is_zero = false; return cp + strlen(cp); } @@ -4213,7 +4213,7 @@ AddVerboseIntPart(char *cp, int value, const char *units, else if (*is_before) value = -value; sprintf(cp, " %d %s%s", value, units, (value == 1) ? "" : "s"); - *is_zero = FALSE; + *is_zero = false; return cp + strlen(cp); } @@ -4247,8 +4247,8 @@ EncodeInterval(struct pg_tm *tm, fsec_t fsec, int style, char *str) int hour = tm->tm_hour; int min = tm->tm_min; int sec = tm->tm_sec; - bool is_before = FALSE; - bool is_zero = TRUE; + bool is_before = false; + bool is_zero = true; /* * The sign of year and month are guaranteed to match, since they are @@ -4403,7 +4403,7 @@ EncodeInterval(struct pg_tm *tm, fsec_t fsec, int style, char *str) if (sec < 0 || (sec == 0 && fsec < 0)) { if (is_zero) - is_before = TRUE; + is_before = true; else if (!is_before) *cp++ = '-'; } @@ -4412,7 +4412,7 @@ EncodeInterval(struct pg_tm *tm, fsec_t fsec, int style, char *str) cp = AppendSeconds(cp, sec, fsec, MAX_INTERVAL_PRECISION, false); sprintf(cp, " sec%s", (abs(sec) != 1 || fsec != 0) ? "s" : ""); - is_zero = FALSE; + is_zero = false; } /* identically zero? then put in a unitless zero... */ if (is_zero) diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index 46f45f6654..56952d29a8 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -718,99 +718,99 @@ typedef enum */ static const KeyWord DCH_keywords[] = { /* name, len, id, is_digit, date_mode */ - {"A.D.", 4, DCH_A_D, FALSE, FROM_CHAR_DATE_NONE}, /* A */ - {"A.M.", 4, DCH_A_M, FALSE, FROM_CHAR_DATE_NONE}, - {"AD", 2, DCH_AD, FALSE, FROM_CHAR_DATE_NONE}, - {"AM", 2, DCH_AM, FALSE, FROM_CHAR_DATE_NONE}, - {"B.C.", 4, DCH_B_C, FALSE, FROM_CHAR_DATE_NONE}, /* B */ - {"BC", 2, DCH_BC, FALSE, FROM_CHAR_DATE_NONE}, - {"CC", 2, DCH_CC, TRUE, FROM_CHAR_DATE_NONE}, /* C */ - {"DAY", 3, DCH_DAY, FALSE, FROM_CHAR_DATE_NONE}, /* D */ - {"DDD", 3, DCH_DDD, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"DD", 2, DCH_DD, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"DY", 2, DCH_DY, FALSE, FROM_CHAR_DATE_NONE}, - {"Day", 3, DCH_Day, FALSE, FROM_CHAR_DATE_NONE}, - {"Dy", 2, DCH_Dy, FALSE, FROM_CHAR_DATE_NONE}, - {"D", 1, DCH_D, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"FX", 2, DCH_FX, FALSE, FROM_CHAR_DATE_NONE}, /* F */ - {"HH24", 4, DCH_HH24, TRUE, FROM_CHAR_DATE_NONE}, /* H */ - {"HH12", 4, DCH_HH12, TRUE, FROM_CHAR_DATE_NONE}, - {"HH", 2, DCH_HH, TRUE, FROM_CHAR_DATE_NONE}, - {"IDDD", 4, DCH_IDDD, TRUE, FROM_CHAR_DATE_ISOWEEK}, /* I */ - {"ID", 2, DCH_ID, TRUE, FROM_CHAR_DATE_ISOWEEK}, - {"IW", 2, DCH_IW, TRUE, FROM_CHAR_DATE_ISOWEEK}, - {"IYYY", 4, DCH_IYYY, TRUE, FROM_CHAR_DATE_ISOWEEK}, - {"IYY", 3, DCH_IYY, TRUE, FROM_CHAR_DATE_ISOWEEK}, - {"IY", 2, DCH_IY, TRUE, FROM_CHAR_DATE_ISOWEEK}, - {"I", 1, DCH_I, TRUE, FROM_CHAR_DATE_ISOWEEK}, - {"J", 1, DCH_J, TRUE, FROM_CHAR_DATE_NONE}, /* J */ - {"MI", 2, DCH_MI, TRUE, FROM_CHAR_DATE_NONE}, /* M */ - {"MM", 2, DCH_MM, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"MONTH", 5, DCH_MONTH, FALSE, FROM_CHAR_DATE_GREGORIAN}, - {"MON", 3, DCH_MON, FALSE, FROM_CHAR_DATE_GREGORIAN}, - {"MS", 2, DCH_MS, TRUE, FROM_CHAR_DATE_NONE}, - {"Month", 5, DCH_Month, FALSE, FROM_CHAR_DATE_GREGORIAN}, - {"Mon", 3, DCH_Mon, FALSE, FROM_CHAR_DATE_GREGORIAN}, - {"OF", 2, DCH_OF, FALSE, FROM_CHAR_DATE_NONE}, /* O */ - {"P.M.", 4, DCH_P_M, FALSE, FROM_CHAR_DATE_NONE}, /* P */ - {"PM", 2, DCH_PM, FALSE, FROM_CHAR_DATE_NONE}, - {"Q", 1, DCH_Q, TRUE, FROM_CHAR_DATE_NONE}, /* Q */ - {"RM", 2, DCH_RM, FALSE, FROM_CHAR_DATE_GREGORIAN}, /* R */ - {"SSSS", 4, DCH_SSSS, TRUE, FROM_CHAR_DATE_NONE}, /* S */ - {"SS", 2, DCH_SS, TRUE, FROM_CHAR_DATE_NONE}, - {"TZ", 2, DCH_TZ, FALSE, FROM_CHAR_DATE_NONE}, /* T */ - {"US", 2, DCH_US, TRUE, FROM_CHAR_DATE_NONE}, /* U */ - {"WW", 2, DCH_WW, TRUE, FROM_CHAR_DATE_GREGORIAN}, /* W */ - {"W", 1, DCH_W, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"Y,YYY", 5, DCH_Y_YYY, TRUE, FROM_CHAR_DATE_GREGORIAN}, /* Y */ - {"YYYY", 4, DCH_YYYY, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"YYY", 3, DCH_YYY, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"YY", 2, DCH_YY, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"Y", 1, DCH_Y, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"a.d.", 4, DCH_a_d, FALSE, FROM_CHAR_DATE_NONE}, /* a */ - {"a.m.", 4, DCH_a_m, FALSE, FROM_CHAR_DATE_NONE}, - {"ad", 2, DCH_ad, FALSE, FROM_CHAR_DATE_NONE}, - {"am", 2, DCH_am, FALSE, FROM_CHAR_DATE_NONE}, - {"b.c.", 4, DCH_b_c, FALSE, FROM_CHAR_DATE_NONE}, /* b */ - {"bc", 2, DCH_bc, FALSE, FROM_CHAR_DATE_NONE}, - {"cc", 2, DCH_CC, TRUE, FROM_CHAR_DATE_NONE}, /* c */ - {"day", 3, DCH_day, FALSE, FROM_CHAR_DATE_NONE}, /* d */ - {"ddd", 3, DCH_DDD, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"dd", 2, DCH_DD, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"dy", 2, DCH_dy, FALSE, FROM_CHAR_DATE_NONE}, - {"d", 1, DCH_D, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"fx", 2, DCH_FX, FALSE, FROM_CHAR_DATE_NONE}, /* f */ - {"hh24", 4, DCH_HH24, TRUE, FROM_CHAR_DATE_NONE}, /* h */ - {"hh12", 4, DCH_HH12, TRUE, FROM_CHAR_DATE_NONE}, - {"hh", 2, DCH_HH, TRUE, FROM_CHAR_DATE_NONE}, - {"iddd", 4, DCH_IDDD, TRUE, FROM_CHAR_DATE_ISOWEEK}, /* i */ - {"id", 2, DCH_ID, TRUE, FROM_CHAR_DATE_ISOWEEK}, - {"iw", 2, DCH_IW, TRUE, FROM_CHAR_DATE_ISOWEEK}, - {"iyyy", 4, DCH_IYYY, TRUE, FROM_CHAR_DATE_ISOWEEK}, - {"iyy", 3, DCH_IYY, TRUE, FROM_CHAR_DATE_ISOWEEK}, - {"iy", 2, DCH_IY, TRUE, FROM_CHAR_DATE_ISOWEEK}, - {"i", 1, DCH_I, TRUE, FROM_CHAR_DATE_ISOWEEK}, - {"j", 1, DCH_J, TRUE, FROM_CHAR_DATE_NONE}, /* j */ - {"mi", 2, DCH_MI, TRUE, FROM_CHAR_DATE_NONE}, /* m */ - {"mm", 2, DCH_MM, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"month", 5, DCH_month, FALSE, FROM_CHAR_DATE_GREGORIAN}, - {"mon", 3, DCH_mon, FALSE, FROM_CHAR_DATE_GREGORIAN}, - {"ms", 2, DCH_MS, TRUE, FROM_CHAR_DATE_NONE}, - {"p.m.", 4, DCH_p_m, FALSE, FROM_CHAR_DATE_NONE}, /* p */ - {"pm", 2, DCH_pm, FALSE, FROM_CHAR_DATE_NONE}, - {"q", 1, DCH_Q, TRUE, FROM_CHAR_DATE_NONE}, /* q */ - {"rm", 2, DCH_rm, FALSE, FROM_CHAR_DATE_GREGORIAN}, /* r */ - {"ssss", 4, DCH_SSSS, TRUE, FROM_CHAR_DATE_NONE}, /* s */ - {"ss", 2, DCH_SS, TRUE, FROM_CHAR_DATE_NONE}, - {"tz", 2, DCH_tz, FALSE, FROM_CHAR_DATE_NONE}, /* t */ - {"us", 2, DCH_US, TRUE, FROM_CHAR_DATE_NONE}, /* u */ - {"ww", 2, DCH_WW, TRUE, FROM_CHAR_DATE_GREGORIAN}, /* w */ - {"w", 1, DCH_W, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"y,yyy", 5, DCH_Y_YYY, TRUE, FROM_CHAR_DATE_GREGORIAN}, /* y */ - {"yyyy", 4, DCH_YYYY, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"yyy", 3, DCH_YYY, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"yy", 2, DCH_YY, TRUE, FROM_CHAR_DATE_GREGORIAN}, - {"y", 1, DCH_Y, TRUE, FROM_CHAR_DATE_GREGORIAN}, + {"A.D.", 4, DCH_A_D, false, FROM_CHAR_DATE_NONE}, /* A */ + {"A.M.", 4, DCH_A_M, false, FROM_CHAR_DATE_NONE}, + {"AD", 2, DCH_AD, false, FROM_CHAR_DATE_NONE}, + {"AM", 2, DCH_AM, false, FROM_CHAR_DATE_NONE}, + {"B.C.", 4, DCH_B_C, false, FROM_CHAR_DATE_NONE}, /* B */ + {"BC", 2, DCH_BC, false, FROM_CHAR_DATE_NONE}, + {"CC", 2, DCH_CC, true, FROM_CHAR_DATE_NONE}, /* C */ + {"DAY", 3, DCH_DAY, false, FROM_CHAR_DATE_NONE}, /* D */ + {"DDD", 3, DCH_DDD, true, FROM_CHAR_DATE_GREGORIAN}, + {"DD", 2, DCH_DD, true, FROM_CHAR_DATE_GREGORIAN}, + {"DY", 2, DCH_DY, false, FROM_CHAR_DATE_NONE}, + {"Day", 3, DCH_Day, false, FROM_CHAR_DATE_NONE}, + {"Dy", 2, DCH_Dy, false, FROM_CHAR_DATE_NONE}, + {"D", 1, DCH_D, true, FROM_CHAR_DATE_GREGORIAN}, + {"FX", 2, DCH_FX, false, FROM_CHAR_DATE_NONE}, /* F */ + {"HH24", 4, DCH_HH24, true, FROM_CHAR_DATE_NONE}, /* H */ + {"HH12", 4, DCH_HH12, true, FROM_CHAR_DATE_NONE}, + {"HH", 2, DCH_HH, true, FROM_CHAR_DATE_NONE}, + {"IDDD", 4, DCH_IDDD, true, FROM_CHAR_DATE_ISOWEEK}, /* I */ + {"ID", 2, DCH_ID, true, FROM_CHAR_DATE_ISOWEEK}, + {"IW", 2, DCH_IW, true, FROM_CHAR_DATE_ISOWEEK}, + {"IYYY", 4, DCH_IYYY, true, FROM_CHAR_DATE_ISOWEEK}, + {"IYY", 3, DCH_IYY, true, FROM_CHAR_DATE_ISOWEEK}, + {"IY", 2, DCH_IY, true, FROM_CHAR_DATE_ISOWEEK}, + {"I", 1, DCH_I, true, FROM_CHAR_DATE_ISOWEEK}, + {"J", 1, DCH_J, true, FROM_CHAR_DATE_NONE}, /* J */ + {"MI", 2, DCH_MI, true, FROM_CHAR_DATE_NONE}, /* M */ + {"MM", 2, DCH_MM, true, FROM_CHAR_DATE_GREGORIAN}, + {"MONTH", 5, DCH_MONTH, false, FROM_CHAR_DATE_GREGORIAN}, + {"MON", 3, DCH_MON, false, FROM_CHAR_DATE_GREGORIAN}, + {"MS", 2, DCH_MS, true, FROM_CHAR_DATE_NONE}, + {"Month", 5, DCH_Month, false, FROM_CHAR_DATE_GREGORIAN}, + {"Mon", 3, DCH_Mon, false, FROM_CHAR_DATE_GREGORIAN}, + {"OF", 2, DCH_OF, false, FROM_CHAR_DATE_NONE}, /* O */ + {"P.M.", 4, DCH_P_M, false, FROM_CHAR_DATE_NONE}, /* P */ + {"PM", 2, DCH_PM, false, FROM_CHAR_DATE_NONE}, + {"Q", 1, DCH_Q, true, FROM_CHAR_DATE_NONE}, /* Q */ + {"RM", 2, DCH_RM, false, FROM_CHAR_DATE_GREGORIAN}, /* R */ + {"SSSS", 4, DCH_SSSS, true, FROM_CHAR_DATE_NONE}, /* S */ + {"SS", 2, DCH_SS, true, FROM_CHAR_DATE_NONE}, + {"TZ", 2, DCH_TZ, false, FROM_CHAR_DATE_NONE}, /* T */ + {"US", 2, DCH_US, true, FROM_CHAR_DATE_NONE}, /* U */ + {"WW", 2, DCH_WW, true, FROM_CHAR_DATE_GREGORIAN}, /* W */ + {"W", 1, DCH_W, true, FROM_CHAR_DATE_GREGORIAN}, + {"Y,YYY", 5, DCH_Y_YYY, true, FROM_CHAR_DATE_GREGORIAN}, /* Y */ + {"YYYY", 4, DCH_YYYY, true, FROM_CHAR_DATE_GREGORIAN}, + {"YYY", 3, DCH_YYY, true, FROM_CHAR_DATE_GREGORIAN}, + {"YY", 2, DCH_YY, true, FROM_CHAR_DATE_GREGORIAN}, + {"Y", 1, DCH_Y, true, FROM_CHAR_DATE_GREGORIAN}, + {"a.d.", 4, DCH_a_d, false, FROM_CHAR_DATE_NONE}, /* a */ + {"a.m.", 4, DCH_a_m, false, FROM_CHAR_DATE_NONE}, + {"ad", 2, DCH_ad, false, FROM_CHAR_DATE_NONE}, + {"am", 2, DCH_am, false, FROM_CHAR_DATE_NONE}, + {"b.c.", 4, DCH_b_c, false, FROM_CHAR_DATE_NONE}, /* b */ + {"bc", 2, DCH_bc, false, FROM_CHAR_DATE_NONE}, + {"cc", 2, DCH_CC, true, FROM_CHAR_DATE_NONE}, /* c */ + {"day", 3, DCH_day, false, FROM_CHAR_DATE_NONE}, /* d */ + {"ddd", 3, DCH_DDD, true, FROM_CHAR_DATE_GREGORIAN}, + {"dd", 2, DCH_DD, true, FROM_CHAR_DATE_GREGORIAN}, + {"dy", 2, DCH_dy, false, FROM_CHAR_DATE_NONE}, + {"d", 1, DCH_D, true, FROM_CHAR_DATE_GREGORIAN}, + {"fx", 2, DCH_FX, false, FROM_CHAR_DATE_NONE}, /* f */ + {"hh24", 4, DCH_HH24, true, FROM_CHAR_DATE_NONE}, /* h */ + {"hh12", 4, DCH_HH12, true, FROM_CHAR_DATE_NONE}, + {"hh", 2, DCH_HH, true, FROM_CHAR_DATE_NONE}, + {"iddd", 4, DCH_IDDD, true, FROM_CHAR_DATE_ISOWEEK}, /* i */ + {"id", 2, DCH_ID, true, FROM_CHAR_DATE_ISOWEEK}, + {"iw", 2, DCH_IW, true, FROM_CHAR_DATE_ISOWEEK}, + {"iyyy", 4, DCH_IYYY, true, FROM_CHAR_DATE_ISOWEEK}, + {"iyy", 3, DCH_IYY, true, FROM_CHAR_DATE_ISOWEEK}, + {"iy", 2, DCH_IY, true, FROM_CHAR_DATE_ISOWEEK}, + {"i", 1, DCH_I, true, FROM_CHAR_DATE_ISOWEEK}, + {"j", 1, DCH_J, true, FROM_CHAR_DATE_NONE}, /* j */ + {"mi", 2, DCH_MI, true, FROM_CHAR_DATE_NONE}, /* m */ + {"mm", 2, DCH_MM, true, FROM_CHAR_DATE_GREGORIAN}, + {"month", 5, DCH_month, false, FROM_CHAR_DATE_GREGORIAN}, + {"mon", 3, DCH_mon, false, FROM_CHAR_DATE_GREGORIAN}, + {"ms", 2, DCH_MS, true, FROM_CHAR_DATE_NONE}, + {"p.m.", 4, DCH_p_m, false, FROM_CHAR_DATE_NONE}, /* p */ + {"pm", 2, DCH_pm, false, FROM_CHAR_DATE_NONE}, + {"q", 1, DCH_Q, true, FROM_CHAR_DATE_NONE}, /* q */ + {"rm", 2, DCH_rm, false, FROM_CHAR_DATE_GREGORIAN}, /* r */ + {"ssss", 4, DCH_SSSS, true, FROM_CHAR_DATE_NONE}, /* s */ + {"ss", 2, DCH_SS, true, FROM_CHAR_DATE_NONE}, + {"tz", 2, DCH_tz, false, FROM_CHAR_DATE_NONE}, /* t */ + {"us", 2, DCH_US, true, FROM_CHAR_DATE_NONE}, /* u */ + {"ww", 2, DCH_WW, true, FROM_CHAR_DATE_GREGORIAN}, /* w */ + {"w", 1, DCH_W, true, FROM_CHAR_DATE_GREGORIAN}, + {"y,yyy", 5, DCH_Y_YYY, true, FROM_CHAR_DATE_GREGORIAN}, /* y */ + {"yyyy", 4, DCH_YYYY, true, FROM_CHAR_DATE_GREGORIAN}, + {"yyy", 3, DCH_YYY, true, FROM_CHAR_DATE_GREGORIAN}, + {"yy", 2, DCH_YY, true, FROM_CHAR_DATE_GREGORIAN}, + {"y", 1, DCH_Y, true, FROM_CHAR_DATE_GREGORIAN}, /* last */ {NULL, 0, 0, 0, 0} @@ -1102,7 +1102,7 @@ NUMDesc_prepare(NUMDesc *num, FormatNode *n) case NUM_D: num->flag |= NUM_F_LDECIMAL; - num->need_locale = TRUE; + num->need_locale = true; /* FALLTHROUGH */ case NUM_DEC: if (IS_DECIMAL(num)) @@ -1133,13 +1133,13 @@ NUMDesc_prepare(NUMDesc *num, FormatNode *n) { num->lsign = NUM_LSIGN_PRE; num->pre_lsign_num = num->pre; - num->need_locale = TRUE; + num->need_locale = true; num->flag |= NUM_F_LSIGN; } else if (num->lsign == NUM_LSIGN_NONE) { num->lsign = NUM_LSIGN_POST; - num->need_locale = TRUE; + num->need_locale = true; num->flag |= NUM_F_LSIGN; } break; @@ -1188,7 +1188,7 @@ NUMDesc_prepare(NUMDesc *num, FormatNode *n) case NUM_L: case NUM_G: - num->need_locale = TRUE; + num->need_locale = true; break; case NUM_V: @@ -2072,17 +2072,17 @@ dump_index(const KeyWord *k, const int *index) #endif /* DEBUG */ /* ---------- - * Return TRUE if next format picture is not digit value + * Return true if next format picture is not digit value * ---------- */ static bool is_next_separator(FormatNode *n) { if (n->type == NODE_TYPE_END) - return FALSE; + return false; if (n->type == NODE_TYPE_ACTION && S_THth(n->suffix)) - return TRUE; + return true; /* * Next node @@ -2091,19 +2091,19 @@ is_next_separator(FormatNode *n) /* end of format string is treated like a non-digit separator */ if (n->type == NODE_TYPE_END) - return TRUE; + return true; if (n->type == NODE_TYPE_ACTION) { if (n->key->is_digit) - return FALSE; + return false; - return TRUE; + return true; } else if (isdigit((unsigned char) n->character)) - return FALSE; + return false; - return TRUE; /* some non-digit input (separator) */ + return true; /* some non-digit input (separator) */ } @@ -3397,7 +3397,7 @@ datetime_to_char_body(TmToChar *tmtc, text *fmt, bool is_interval, Oid collid) * Allocate new memory if format picture is bigger than static cache * and do not use cache (call parser always) */ - incache = FALSE; + incache = false; format = (FormatNode *) palloc((fmt_len + 1) * sizeof(FormatNode)); @@ -3411,7 +3411,7 @@ datetime_to_char_body(TmToChar *tmtc, text *fmt, bool is_interval, Oid collid) */ DCHCacheEntry *ent = DCH_cache_fetch(fmt_str); - incache = TRUE; + incache = true; format = ent->format; } @@ -3642,7 +3642,7 @@ do_to_timestamp(text *date_txt, text *fmt, * Allocate new memory if format picture is bigger than static * cache and do not use cache (call parser always) */ - incache = FALSE; + incache = false; format = (FormatNode *) palloc((fmt_len + 1) * sizeof(FormatNode)); @@ -3656,7 +3656,7 @@ do_to_timestamp(text *date_txt, text *fmt, */ DCHCacheEntry *ent = DCH_cache_fetch(fmt_str); - incache = TRUE; + incache = true; format = ent->format; } @@ -4245,7 +4245,7 @@ get_last_relevant_decnum(char *num) static void NUM_numpart_from_char(NUMProc *Np, int id, int input_len) { - bool isread = FALSE; + bool isread = false; #ifdef DEBUG_TO_FROM_CHAR elog(DEBUG_elog_output, " --- scan start --- id=%s", @@ -4346,13 +4346,13 @@ NUM_numpart_from_char(NUMProc *Np, int id, int input_len) else Np->read_pre++; - isread = TRUE; + isread = true; #ifdef DEBUG_TO_FROM_CHAR elog(DEBUG_elog_output, "Read digit (%c)", *Np->inout_p); #endif } - else if (IS_DECIMAL(Np->Num) && Np->read_dec == FALSE) + else if (IS_DECIMAL(Np->Num) && Np->read_dec == false) { /* * We need not test IS_LDECIMAL(Np->Num) explicitly here, because @@ -4370,8 +4370,8 @@ NUM_numpart_from_char(NUMProc *Np, int id, int input_len) Np->inout_p += x - 1; *Np->number_p = '.'; Np->number_p++; - Np->read_dec = TRUE; - isread = TRUE; + Np->read_dec = true; + isread = true; } } @@ -4429,11 +4429,11 @@ NUM_numpart_from_char(NUMProc *Np, int id, int input_len) * * FM9.999999MI -> 5.01- * - * if (.... && IS_LSIGN(Np->Num)==FALSE) prevents read wrong formats + * if (.... && IS_LSIGN(Np->Num)==false) prevents read wrong formats * like to_number('1 -', '9S') where sign is not anchored to last * number. */ - else if (isread == FALSE && IS_LSIGN(Np->Num) == FALSE && + else if (isread == false && IS_LSIGN(Np->Num) == false && (IS_PLUS(Np->Num) || IS_MINUS(Np->Num))) { #ifdef DEBUG_TO_FROM_CHAR @@ -4451,7 +4451,7 @@ NUM_numpart_from_char(NUMProc *Np, int id, int input_len) } #define IS_PREDEC_SPACE(_n) \ - (IS_ZERO((_n)->Num)==FALSE && \ + (IS_ZERO((_n)->Num)==false && \ (_n)->number == (_n)->number_p && \ *(_n)->number == '0' && \ (_n)->Num->post != 0) @@ -4483,15 +4483,15 @@ NUM_numpart_to_char(NUMProc *Np, int id) Np->number_p, Np->inout); #endif - Np->num_in = FALSE; + Np->num_in = false; /* * Write sign if real number will write to output Note: IS_PREDEC_SPACE() * handle "9.9" --> " .1" */ - if (Np->sign_wrote == FALSE && + if (Np->sign_wrote == false && (Np->num_curr >= Np->out_pre_spaces || (IS_ZERO(Np->Num) && Np->Num->zero_start == Np->num_curr)) && - (IS_PREDEC_SPACE(Np) == FALSE || (Np->last_relevant && *Np->last_relevant == '.'))) + (IS_PREDEC_SPACE(Np) == false || (Np->last_relevant && *Np->last_relevant == '.'))) { if (IS_LSIGN(Np->Num)) { @@ -4502,14 +4502,14 @@ NUM_numpart_to_char(NUMProc *Np, int id) else strcpy(Np->inout_p, Np->L_positive_sign); Np->inout_p += strlen(Np->inout_p); - Np->sign_wrote = TRUE; + Np->sign_wrote = true; } } else if (IS_BRACKET(Np->Num)) { *Np->inout_p = Np->sign == '+' ? ' ' : '<'; ++Np->inout_p; - Np->sign_wrote = TRUE; + Np->sign_wrote = true; } else if (Np->sign == '+') { @@ -4518,13 +4518,13 @@ NUM_numpart_to_char(NUMProc *Np, int id) *Np->inout_p = ' '; /* Write + */ ++Np->inout_p; } - Np->sign_wrote = TRUE; + Np->sign_wrote = true; } else if (Np->sign == '-') { /* Write - */ *Np->inout_p = '-'; ++Np->inout_p; - Np->sign_wrote = TRUE; + Np->sign_wrote = true; } } @@ -4555,7 +4555,7 @@ NUM_numpart_to_char(NUMProc *Np, int id) */ *Np->inout_p = '0'; /* Write '0' */ ++Np->inout_p; - Np->num_in = TRUE; + Np->num_in = true; } else { @@ -4613,7 +4613,7 @@ NUM_numpart_to_char(NUMProc *Np, int id) { *Np->inout_p = *Np->number_p; /* Write DIGIT */ ++Np->inout_p; - Np->num_in = TRUE; + Np->num_in = true; } } /* do no exceed string length */ @@ -4628,7 +4628,7 @@ NUM_numpart_to_char(NUMProc *Np, int id) if (Np->num_curr + 1 == end) { - if (Np->sign_wrote == TRUE && IS_BRACKET(Np->Num)) + if (Np->sign_wrote == true && IS_BRACKET(Np->Num)) { *Np->inout_p = Np->sign == '+' ? ' ' : '>'; ++Np->inout_p; @@ -4665,7 +4665,7 @@ NUM_processor(FormatNode *node, NUMDesc *Num, char *inout, Np->last_relevant = NULL; Np->read_post = 0; Np->read_pre = 0; - Np->read_dec = FALSE; + Np->read_dec = false; if (Np->Num->zero_start) --Np->Num->zero_start; @@ -4712,10 +4712,10 @@ NUM_processor(FormatNode *node, NUMDesc *Num, char *inout, /* MI/PL/SG - write sign itself and not in number */ if (IS_PLUS(Np->Num) || IS_MINUS(Np->Num)) { - if (IS_PLUS(Np->Num) && IS_MINUS(Np->Num) == FALSE) - Np->sign_wrote = FALSE; /* need sign */ + if (IS_PLUS(Np->Num) && IS_MINUS(Np->Num) == false) + Np->sign_wrote = false; /* need sign */ else - Np->sign_wrote = TRUE; /* needn't sign */ + Np->sign_wrote = true; /* needn't sign */ } else { @@ -4729,17 +4729,17 @@ NUM_processor(FormatNode *node, NUMDesc *Num, char *inout, else if (Np->sign != '+' && IS_PLUS(Np->Num)) Np->Num->flag &= ~NUM_F_PLUS; - if (Np->sign == '+' && IS_FILLMODE(Np->Num) && IS_LSIGN(Np->Num) == FALSE) - Np->sign_wrote = TRUE; /* needn't sign */ + if (Np->sign == '+' && IS_FILLMODE(Np->Num) && IS_LSIGN(Np->Num) == false) + Np->sign_wrote = true; /* needn't sign */ else - Np->sign_wrote = FALSE; /* need sign */ + Np->sign_wrote = false; /* need sign */ if (Np->Num->lsign == NUM_LSIGN_PRE && Np->Num->pre == Np->Num->pre_lsign_num) Np->Num->lsign = NUM_LSIGN_POST; } } else - Np->sign = FALSE; + Np->sign = false; /* * Count @@ -4768,7 +4768,7 @@ NUM_processor(FormatNode *node, NUMDesc *Num, char *inout, } } - if (Np->sign_wrote == FALSE && Np->out_pre_spaces == 0) + if (Np->sign_wrote == false && Np->out_pre_spaces == 0) ++Np->num_count; } else diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c index 0348855b11..70f3d319cc 100644 --- a/src/backend/utils/adt/geo_ops.c +++ b/src/backend/utils/adt/geo_ops.c @@ -1530,7 +1530,7 @@ path_close(PG_FUNCTION_ARGS) { PATH *path = PG_GETARG_PATH_P_COPY(0); - path->closed = TRUE; + path->closed = true; PG_RETURN_PATH_P(path); } @@ -1540,7 +1540,7 @@ path_open(PG_FUNCTION_ARGS) { PATH *path = PG_GETARG_PATH_P_COPY(0); - path->closed = FALSE; + path->closed = false; PG_RETURN_PATH_P(path); } @@ -4499,7 +4499,7 @@ poly_path(PG_FUNCTION_ARGS) SET_VARSIZE(path, size); path->npts = poly->npts; - path->closed = TRUE; + path->closed = true; /* prevent instability in unused pad bytes */ path->dummy = 0; @@ -5401,7 +5401,7 @@ plist_same(int npts, Point *p1, Point *p2) printf("plist_same- ii = %d/%d after forward match\n", ii, npts); #endif if (ii == npts) - return TRUE; + return true; /* match not found forwards? then look backwards */ for (ii = 1, j = i - 1; ii < npts; ii++, j--) @@ -5421,11 +5421,11 @@ plist_same(int npts, Point *p1, Point *p2) printf("plist_same- ii = %d/%d after reverse match\n", ii, npts); #endif if (ii == npts) - return TRUE; + return true; } } - return FALSE; + return false; } diff --git a/src/backend/utils/adt/network_gist.c b/src/backend/utils/adt/network_gist.c index a0097dae9c..a1607e8793 100644 --- a/src/backend/utils/adt/network_gist.c +++ b/src/backend/utils/adt/network_gist.c @@ -561,13 +561,13 @@ inet_gist_compress(PG_FUNCTION_ARGS) gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } else { gistentryinit(*retval, (Datum) 0, entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } } else @@ -610,7 +610,7 @@ inet_gist_fetch(PG_FUNCTION_ARGS) retval = palloc(sizeof(GISTENTRY)); gistentryinit(*retval, InetPGetDatum(dst), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); PG_RETURN_POINTER(retval); } diff --git a/src/backend/utils/adt/numeric.c b/src/backend/utils/adt/numeric.c index ddc44d5179..10638c362b 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -5517,7 +5517,7 @@ zero_var(NumericVar *var) static const char * set_var_from_str(const char *str, const char *cp, NumericVar *dest) { - bool have_dp = FALSE; + bool have_dp = false; int i; unsigned char *decdigits; int sign = NUMERIC_POS; @@ -5548,7 +5548,7 @@ set_var_from_str(const char *str, const char *cp, NumericVar *dest) if (*cp == '.') { - have_dp = TRUE; + have_dp = true; cp++; } @@ -5581,7 +5581,7 @@ set_var_from_str(const char *str, const char *cp, NumericVar *dest) (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("invalid input syntax for type %s: \"%s\"", "numeric", str))); - have_dp = TRUE; + have_dp = true; cp++; } else @@ -6150,7 +6150,7 @@ apply_typmod(NumericVar *var, int32 typmod) /* * Convert numeric to int8, rounding if needed. * - * If overflow, return FALSE (no error is raised). Return TRUE if okay. + * If overflow, return false (no error is raised). Return true if okay. */ static bool numericvar_to_int64(const NumericVar *var, int64 *result) @@ -6269,7 +6269,7 @@ int64_to_numericvar(int64 val, NumericVar *var) /* * Convert numeric to int128, rounding if needed. * - * If overflow, return FALSE (no error is raised). Return TRUE if okay. + * If overflow, return false (no error is raised). Return true if okay. */ static bool numericvar_to_int128(const NumericVar *var, int128 *result) diff --git a/src/backend/utils/adt/tsginidx.c b/src/backend/utils/adt/tsginidx.c index 83a939dfd5..aba456ed88 100644 --- a/src/backend/utils/adt/tsginidx.c +++ b/src/backend/utils/adt/tsginidx.c @@ -295,7 +295,7 @@ gin_tsquery_consistent(PG_FUNCTION_ARGS) /* int32 nkeys = PG_GETARG_INT32(3); */ Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); bool *recheck = (bool *) PG_GETARG_POINTER(5); - bool res = FALSE; + bool res = false; /* Initially assume query doesn't require recheck */ *recheck = false; diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c index d8b86f6393..6b4a734d41 100644 --- a/src/backend/utils/adt/tsgistidx.c +++ b/src/backend/utils/adt/tsgistidx.c @@ -240,7 +240,7 @@ gtsvector_compress(PG_FUNCTION_ARGS) retval = (GISTENTRY *) palloc(sizeof(GISTENTRY)); gistentryinit(*retval, PointerGetDatum(res), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } else if (ISSIGNKEY(DatumGetPointer(entry->key)) && !ISALLTRUE(DatumGetPointer(entry->key))) @@ -264,7 +264,7 @@ gtsvector_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); } @@ -281,7 +281,7 @@ gtsvector_decompress(PG_FUNCTION_ARGS) gistentryinit(*retval, PointerGetDatum(key), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); PG_RETURN_POINTER(retval); } diff --git a/src/backend/utils/adt/tsquery_gist.c b/src/backend/utils/adt/tsquery_gist.c index 85518dc7d9..0f31c4d28f 100644 --- a/src/backend/utils/adt/tsquery_gist.c +++ b/src/backend/utils/adt/tsquery_gist.c @@ -37,7 +37,7 @@ gtsquery_compress(PG_FUNCTION_ARGS) gistentryinit(*retval, TSQuerySignGetDatum(sign), entry->rel, entry->page, - entry->offset, FALSE); + entry->offset, false); } PG_RETURN_POINTER(retval); @@ -80,7 +80,7 @@ gtsquery_consistent(PG_FUNCTION_ARGS) retval = (key & sq) != 0; break; default: - retval = FALSE; + retval = false; } PG_RETURN_BOOL(retval); } diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index bc9f09a086..7b7ee65c64 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -3953,9 +3953,9 @@ static int num_guc_variables; static int size_guc_variables; -static bool guc_dirty; /* TRUE if need to do commit/abort work */ +static bool guc_dirty; /* true if need to do commit/abort work */ -static bool reporting_enabled; /* TRUE to enable GUC_REPORT */ +static bool reporting_enabled; /* true to enable GUC_REPORT */ static int GUCNestLevel = 0; /* 1 when in main transaction */ @@ -4377,7 +4377,7 @@ add_placeholder_variable(const char *name, int elevel) /* * Look up option NAME. If it exists, return a pointer to its record, - * else return NULL. If create_placeholders is TRUE, we'll create a + * else return NULL. If create_placeholders is true, we'll create a * placeholder record for a valid-looking custom variable name. */ static struct config_generic * @@ -5646,7 +5646,7 @@ config_enum_lookup_by_value(struct config_enum *record, int val) * Lookup the value for an enum option with the selected name * (case-insensitive). * If the enum option is found, sets the retval value and returns - * true. If it's not found, return FALSE and retval is set to 0. + * true. If it's not found, return false and retval is set to 0. */ bool config_enum_lookup_by_name(struct config_enum *record, const char *value, @@ -5659,12 +5659,12 @@ config_enum_lookup_by_name(struct config_enum *record, const char *value, if (pg_strcasecmp(value, entry->name) == 0) { *retval = entry->val; - return TRUE; + return true; } } *retval = 0; - return FALSE; + return false; } @@ -8374,7 +8374,7 @@ show_config_by_name(PG_FUNCTION_ARGS) /* * show_config_by_name_missing_ok - equiv to SHOW X command but implemented as * a function. If X does not exist, suppress the error and just return NULL - * if missing_ok is TRUE. + * if missing_ok is true. */ Datum show_config_by_name_missing_ok(PG_FUNCTION_ARGS) @@ -9703,7 +9703,7 @@ GUCArrayReset(ArrayType *array) * or NULL for the Delete/Reset cases. If skipIfNoPermissions is true, it's * not an error to have no permissions to set the option. * - * Returns TRUE if OK, FALSE if skipIfNoPermissions is true and user does not + * Returns true if OK, false if skipIfNoPermissions is true and user does not * have permission to change this option (all other error cases result in an * error being thrown). */ @@ -9729,7 +9729,7 @@ validate_option_array_item(const char *name, const char *value, * define_custom_variable assumes we checked that. * * name is not known and can't be created as a placeholder. Throw error, - * unless skipIfNoPermissions is true, in which case return FALSE. + * unless skipIfNoPermissions is true, in which case return false. */ gconf = find_option(name, true, WARNING); if (!gconf) diff --git a/src/interfaces/ecpg/ecpglib/misc.c b/src/interfaces/ecpg/ecpglib/misc.c index 2084d7fe60..a0257c8957 100644 --- a/src/interfaces/ecpg/ecpglib/misc.c +++ b/src/interfaces/ecpg/ecpglib/misc.c @@ -225,13 +225,13 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction) { res = PQexec(con->connection, "begin transaction"); if (!ecpg_check_PQresult(res, lineno, con->connection, ECPG_COMPAT_PGSQL)) - return FALSE; + return false; PQclear(res); } res = PQexec(con->connection, transaction); if (!ecpg_check_PQresult(res, lineno, con->connection, ECPG_COMPAT_PGSQL)) - return FALSE; + return false; PQclear(res); } diff --git a/src/interfaces/ecpg/pgtypeslib/datetime.c b/src/interfaces/ecpg/pgtypeslib/datetime.c index 33c9011a71..c2f78f5a56 100644 --- a/src/interfaces/ecpg/pgtypeslib/datetime.c +++ b/src/interfaces/ecpg/pgtypeslib/datetime.c @@ -59,7 +59,7 @@ PGTYPESdate_from_asc(char *str, char **endptr) char *realptr; char **ptr = (endptr != NULL) ? endptr : &realptr; - bool EuroDates = FALSE; + bool EuroDates = false; errno = 0; if (strlen(str) > MAXDATELEN) @@ -105,7 +105,7 @@ PGTYPESdate_to_asc(date dDate) *tm = &tt; char buf[MAXDATELEN + 1]; int DateStyle = 1; - bool EuroDates = FALSE; + bool EuroDates = false; j2date(dDate + date2j(2000, 1, 1), &(tm->tm_year), &(tm->tm_mon), &(tm->tm_mday)); EncodeDateOnly(tm, DateStyle, buf, EuroDates); diff --git a/src/interfaces/ecpg/pgtypeslib/dt_common.c b/src/interfaces/ecpg/pgtypeslib/dt_common.c index be72fce8c5..994389f4a1 100644 --- a/src/interfaces/ecpg/pgtypeslib/dt_common.c +++ b/src/interfaces/ecpg/pgtypeslib/dt_common.c @@ -1144,7 +1144,7 @@ DecodeNumberField(int len, char *str, int fmask, tm->tm_mon = atoi(str + 2); *(str + 2) = '\0'; tm->tm_year = atoi(str + 0); - *is2digits = TRUE; + *is2digits = true; return DTK_DATE; } @@ -1156,7 +1156,7 @@ DecodeNumberField(int len, char *str, int fmask, *(str + 2) = '\0'; tm->tm_mon = 1; tm->tm_year = atoi(str + 0); - *is2digits = TRUE; + *is2digits = true; return DTK_DATE; } @@ -1314,8 +1314,8 @@ DecodeDate(char *str, int fmask, int *tmask, struct tm *tm, bool EuroDates) int nf = 0; int i, len; - bool bc = FALSE; - bool is2digits = FALSE; + bool bc = false; + bool is2digits = false; int type, val, dmask = 0; @@ -1792,9 +1792,9 @@ DecodeDateTime(char **field, int *ftype, int nf, int i; int val; int mer = HR24; - bool haveTextMonth = FALSE; - bool is2digits = FALSE; - bool bc = FALSE; + bool haveTextMonth = false; + bool is2digits = false; + bool bc = false; int t = 0; int *tzp = &t; @@ -2200,7 +2200,7 @@ DecodeDateTime(char **field, int *ftype, int nf, tm->tm_mday = tm->tm_mon; tmask = DTK_M(DAY); } - haveTextMonth = TRUE; + haveTextMonth = true; tm->tm_mon = val; break; diff --git a/src/interfaces/ecpg/pgtypeslib/interval.c b/src/interfaces/ecpg/pgtypeslib/interval.c index 4a7227e926..41976a188a 100644 --- a/src/interfaces/ecpg/pgtypeslib/interval.c +++ b/src/interfaces/ecpg/pgtypeslib/interval.c @@ -338,7 +338,7 @@ DecodeInterval(char **field, int *ftype, int nf, /* int range, */ { int IntervalStyle = INTSTYLE_POSTGRES_VERBOSE; int range = INTERVAL_FULL_RANGE; - bool is_before = FALSE; + bool is_before = false; char *cp; int fmask = 0, tmask, @@ -583,7 +583,7 @@ DecodeInterval(char **field, int *ftype, int nf, /* int range, */ break; case AGO: - is_before = TRUE; + is_before = true; type = val; break; @@ -705,7 +705,7 @@ AddVerboseIntPart(char *cp, int value, const char *units, else if (*is_before) value = -value; sprintf(cp, " %d %s%s", value, units, (value == 1) ? "" : "s"); - *is_zero = FALSE; + *is_zero = false; return cp + strlen(cp); } @@ -728,7 +728,7 @@ AddPostgresIntPart(char *cp, int value, const char *units, * tad bizarre but it's how it worked before... */ *is_before = (value < 0); - *is_zero = FALSE; + *is_zero = false; return cp + strlen(cp); } @@ -779,8 +779,8 @@ EncodeInterval(struct /* pg_ */ tm *tm, fsec_t fsec, int style, char *str) int hour = tm->tm_hour; int min = tm->tm_min; int sec = tm->tm_sec; - bool is_before = FALSE; - bool is_zero = TRUE; + bool is_before = false; + bool is_zero = true; /* * The sign of year and month are guaranteed to match, since they are @@ -926,7 +926,7 @@ EncodeInterval(struct /* pg_ */ tm *tm, fsec_t fsec, int style, char *str) if (sec < 0 || (sec == 0 && fsec < 0)) { if (is_zero) - is_before = TRUE; + is_before = true; else if (!is_before) *cp++ = '-'; } @@ -936,7 +936,7 @@ EncodeInterval(struct /* pg_ */ tm *tm, fsec_t fsec, int style, char *str) cp += strlen(cp); sprintf(cp, " sec%s", (abs(sec) != 1 || fsec != 0) ? "s" : ""); - is_zero = FALSE; + is_zero = false; } /* identically zero? then put in a unitless zero... */ if (is_zero) diff --git a/src/interfaces/ecpg/pgtypeslib/numeric.c b/src/interfaces/ecpg/pgtypeslib/numeric.c index a8619168ff..6643242ab1 100644 --- a/src/interfaces/ecpg/pgtypeslib/numeric.c +++ b/src/interfaces/ecpg/pgtypeslib/numeric.c @@ -162,7 +162,7 @@ PGTYPESdecimal_new(void) static int set_var_from_str(char *str, char **ptr, numeric *dest) { - bool have_dp = FALSE; + bool have_dp = false; int i = 0; errno = 0; @@ -214,7 +214,7 @@ set_var_from_str(char *str, char **ptr, numeric *dest) if (*(*ptr) == '.') { - have_dp = TRUE; + have_dp = true; (*ptr)++; } @@ -241,7 +241,7 @@ set_var_from_str(char *str, char **ptr, numeric *dest) errno = PGTYPES_NUM_BAD_NUMERIC; return -1; } - have_dp = TRUE; + have_dp = true; (*ptr)++; } else diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l index fc450f30ab..8986ff8415 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -987,12 +987,12 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+ return S_ANYTHING; } } -{exec_sql}{ifdef}{space}* { ifcond = TRUE; BEGIN(xcond); } +{exec_sql}{ifdef}{space}* { ifcond = true; BEGIN(xcond); } {informix_special}{ifdef}{space}* { /* are we simulating Informix? */ if (INFORMIX_MODE) { - ifcond = TRUE; + ifcond = true; BEGIN(xcond); } else @@ -1001,12 +1001,12 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+ return S_ANYTHING; } } -{exec_sql}{ifndef}{space}* { ifcond = FALSE; BEGIN(xcond); } +{exec_sql}{ifndef}{space}* { ifcond = false; BEGIN(xcond); } {informix_special}{ifndef}{space}* { /* are we simulating Informix? */ if (INFORMIX_MODE) { - ifcond = FALSE; + ifcond = false; BEGIN(xcond); } else @@ -1024,7 +1024,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+ else preproc_tos--; - ifcond = TRUE; BEGIN(xcond); + ifcond = true; BEGIN(xcond); } {informix_special}{elif}{space}* { /* are we simulating Informix? */ @@ -1037,7 +1037,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+ else preproc_tos--; - ifcond = TRUE; + ifcond = true; BEGIN(xcond); } else @@ -1052,7 +1052,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+ mmfatal(PARSE_ERROR, "more than one EXEC SQL ELSE"); else { - stacked_if_value[preproc_tos].else_branch = TRUE; + stacked_if_value[preproc_tos].else_branch = true; stacked_if_value[preproc_tos].condition = (stacked_if_value[preproc_tos-1].condition && !stacked_if_value[preproc_tos].condition); @@ -1071,7 +1071,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+ mmfatal(PARSE_ERROR, "more than one EXEC SQL ELSE"); else { - stacked_if_value[preproc_tos].else_branch = TRUE; + stacked_if_value[preproc_tos].else_branch = true; stacked_if_value[preproc_tos].condition = (stacked_if_value[preproc_tos-1].condition && !stacked_if_value[preproc_tos].condition); @@ -1145,7 +1145,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+ defptr = defptr->next); preproc_tos++; - stacked_if_value[preproc_tos].else_branch = FALSE; + stacked_if_value[preproc_tos].else_branch = false; stacked_if_value[preproc_tos].condition = (defptr ? ifcond : !ifcond) && stacked_if_value[preproc_tos-1].condition; } @@ -1259,9 +1259,9 @@ lex_init(void) preproc_tos = 0; yylineno = 1; - ifcond = TRUE; + ifcond = true; stacked_if_value[preproc_tos].condition = ifcond; - stacked_if_value[preproc_tos].else_branch = FALSE; + stacked_if_value[preproc_tos].else_branch = false; /* initialize literal buffer to a reasonable but expansible size */ if (literalbuf == NULL) @@ -1406,7 +1406,7 @@ parse_include(void) } /* - * ecpg_isspace() --- return TRUE if flex scanner considers char whitespace + * ecpg_isspace() --- return true if flex scanner considers char whitespace */ static bool ecpg_isspace(char ch) diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index c580d91135..23d353c4a4 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -3587,7 +3587,7 @@ closePGconn(PGconn *conn) * Don't call PQsetnonblocking() because it will fail if it's unable to * flush the connection. */ - conn->nonblocking = FALSE; + conn->nonblocking = false; /* * Close the connection, reset all transient state, flush I/O buffers. @@ -3782,8 +3782,8 @@ PQfreeCancel(PGcancel *cancel) * PQcancel and PQrequestCancel: attempt to request cancellation of the * current operation. * - * The return value is TRUE if the cancel request was successfully - * dispatched, FALSE if not (in which case an error message is available). + * The return value is true if the cancel request was successfully + * dispatched, false if not (in which case an error message is available). * Note: successful dispatch is no guarantee that there will be any effect at * the backend. The application must read the operation result as usual. * @@ -3872,7 +3872,7 @@ internal_cancel(SockAddr *raddr, int be_pid, int be_key, /* All done */ closesocket(tmpsock); SOCK_ERRNO_SET(save_errno); - return TRUE; + return true; cancel_errReturn: @@ -3890,13 +3890,13 @@ internal_cancel(SockAddr *raddr, int be_pid, int be_key, if (tmpsock != PGINVALID_SOCKET) closesocket(tmpsock); SOCK_ERRNO_SET(save_errno); - return FALSE; + return false; } /* * PQcancel: request query cancel * - * Returns TRUE if able to send the cancel request, FALSE if not. + * Returns true if able to send the cancel request, false if not. * * On failure, an error message is stored in *errbuf, which must be of size * errbufsize (recommended size is 256 bytes). *errbuf is not changed on @@ -3908,7 +3908,7 @@ PQcancel(PGcancel *cancel, char *errbuf, int errbufsize) if (!cancel) { strlcpy(errbuf, "PQcancel() -- no cancel object supplied", errbufsize); - return FALSE; + return false; } return internal_cancel(&cancel->raddr, cancel->be_pid, cancel->be_key, @@ -3918,7 +3918,7 @@ PQcancel(PGcancel *cancel, char *errbuf, int errbufsize) /* * PQrequestCancel: old, not thread-safe function for requesting query cancel * - * Returns TRUE if able to send the cancel request, FALSE if not. + * Returns true if able to send the cancel request, false if not. * * On failure, the error message is saved in conn->errorMessage; this means * that this can't be used when there might be other active operations on @@ -3934,7 +3934,7 @@ PQrequestCancel(PGconn *conn) /* Check we have an open connection */ if (!conn) - return FALSE; + return false; if (conn->sock == PGINVALID_SOCKET) { @@ -3943,7 +3943,7 @@ PQrequestCancel(PGconn *conn) conn->errorMessage.maxlen); conn->errorMessage.len = strlen(conn->errorMessage.data); - return FALSE; + return false; } r = internal_cancel(&conn->raddr, conn->be_pid, conn->be_key, @@ -4772,7 +4772,7 @@ conninfo_init(PQExpBuffer errorMessage) * Returns a malloc'd PQconninfoOption array, if parsing is successful. * Otherwise, NULL is returned and an error message is left in errorMessage. * - * If use_defaults is TRUE, default values are filled in (from a service file, + * If use_defaults is true, default values are filled in (from a service file, * environment variables, etc). */ static PQconninfoOption * @@ -4995,7 +4995,7 @@ conninfo_parse(const char *conninfo, PQExpBuffer errorMessage, * If not successful, NULL is returned and an error message is * left in errorMessage. * Defaults are supplied (from a service file, environment variables, etc) - * for unspecified options, but only if use_defaults is TRUE. + * for unspecified options, but only if use_defaults is true. * * If expand_dbname is non-zero, and the value passed for the first occurrence * of "dbname" keyword is a connection string (as indicated by @@ -5166,7 +5166,7 @@ conninfo_array_parse(const char *const *keywords, const char *const *values, * * Defaults are obtained from a service file, environment variables, etc. * - * Returns TRUE if successful, otherwise FALSE; errorMessage, if supplied, + * Returns true if successful, otherwise false; errorMessage, if supplied, * is filled in upon failure. Note that failure to locate a default value * is not an error condition here --- we just leave the option's value as * NULL. @@ -5817,7 +5817,7 @@ conninfo_getval(PQconninfoOption *connOptions, * * If not successful, returns NULL and fills errorMessage accordingly. * However, if the reason of failure is an invalid keyword being passed and - * ignoreMissing is TRUE, errorMessage will be left untouched. + * ignoreMissing is true, errorMessage will be left untouched. */ static PQconninfoOption * conninfo_storeval(PQconninfoOption *connOptions, diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index c24bce62dd..66530870d4 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -231,17 +231,17 @@ PQsetResultAttrs(PGresult *res, int numAttributes, PGresAttDesc *attDescs) /* If attrs already exist, they cannot be overwritten. */ if (!res || res->numAttributes > 0) - return FALSE; + return false; /* ignore no-op request */ if (numAttributes <= 0 || !attDescs) - return TRUE; + return true; res->attDescs = (PGresAttDesc *) PQresultAlloc(res, numAttributes * sizeof(PGresAttDesc)); if (!res->attDescs) - return FALSE; + return false; res->numAttributes = numAttributes; memcpy(res->attDescs, attDescs, numAttributes * sizeof(PGresAttDesc)); @@ -256,13 +256,13 @@ PQsetResultAttrs(PGresult *res, int numAttributes, PGresAttDesc *attDescs) res->attDescs[i].name = res->null_field; if (!res->attDescs[i].name) - return FALSE; + return false; if (res->attDescs[i].format == 0) res->binary = 0; } - return TRUE; + return true; } /* @@ -368,7 +368,7 @@ PQcopyResult(const PGresult *src, int flags) PQclear(dest); return NULL; } - dest->events[i].resultInitialized = TRUE; + dest->events[i].resultInitialized = true; } } @@ -398,7 +398,7 @@ dupEvents(PGEvent *events, int count) newEvents[i].proc = events[i].proc; newEvents[i].passThrough = events[i].passThrough; newEvents[i].data = NULL; - newEvents[i].resultInitialized = FALSE; + newEvents[i].resultInitialized = false; newEvents[i].name = strdup(events[i].name); if (!newEvents[i].name) { @@ -428,7 +428,7 @@ PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len) /* Note that this check also protects us against null "res" */ if (!check_field_number(res, field_num)) - return FALSE; + return false; /* Invalid tup_num, must be <= ntups */ if (tup_num < 0 || tup_num > res->ntups) @@ -436,7 +436,7 @@ PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len) pqInternalNotice(&res->noticeHooks, "row number %d is out of range 0..%d", tup_num, res->ntups); - return FALSE; + return false; } /* need to allocate a new tuple? */ @@ -447,7 +447,7 @@ PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len) tup = (PGresAttValue *) pqResultAlloc(res, res->numAttributes * sizeof(PGresAttValue), - TRUE); + true); if (!tup) goto fail; @@ -479,7 +479,7 @@ PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len) } else { - attval->value = (char *) pqResultAlloc(res, len + 1, TRUE); + attval->value = (char *) pqResultAlloc(res, len + 1, true); if (!attval->value) goto fail; attval->len = len; @@ -487,7 +487,7 @@ PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len) attval->value[len] = '\0'; } - return TRUE; + return true; /* * Report failure via pqInternalNotice. If preceding code didn't provide @@ -498,7 +498,7 @@ PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len) errmsg = libpq_gettext("out of memory"); pqInternalNotice(&res->noticeHooks, "%s", errmsg); - return FALSE; + return false; } /* @@ -510,7 +510,7 @@ PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len) void * PQresultAlloc(PGresult *res, size_t nBytes) { - return pqResultAlloc(res, nBytes, TRUE); + return pqResultAlloc(res, nBytes, true); } /* @@ -622,7 +622,7 @@ pqResultAlloc(PGresult *res, size_t nBytes, bool isBinary) char * pqResultStrdup(PGresult *res, const char *str) { - char *space = (char *) pqResultAlloc(res, strlen(str) + 1, FALSE); + char *space = (char *) pqResultAlloc(res, strlen(str) + 1, false); if (space) strcpy(space, str); @@ -852,7 +852,7 @@ pqInternalNotice(const PGNoticeHooks *hooks, const char *fmt,...) * Result text is always just the primary message + newline. If we can't * allocate it, don't bother invoking the receiver. */ - res->errMsg = (char *) pqResultAlloc(res, strlen(msgBuf) + 2, FALSE); + res->errMsg = (char *) pqResultAlloc(res, strlen(msgBuf) + 2, false); if (res->errMsg) { sprintf(res->errMsg, "%s\n", msgBuf); @@ -868,7 +868,7 @@ pqInternalNotice(const PGNoticeHooks *hooks, const char *fmt,...) /* * pqAddTuple * add a row pointer to the PGresult structure, growing it if necessary - * Returns TRUE if OK, FALSE if an error prevented adding the row + * Returns true if OK, false if an error prevented adding the row * * On error, *errmsgp can be set to an error string to be returned. * If it is left NULL, the error is presumed to be "out of memory". @@ -903,7 +903,7 @@ pqAddTuple(PGresult *res, PGresAttValue *tup, const char **errmsgp) else { *errmsgp = libpq_gettext("PGresult cannot support more than INT_MAX tuples"); - return FALSE; + return false; } /* @@ -915,7 +915,7 @@ pqAddTuple(PGresult *res, PGresAttValue *tup, const char **errmsgp) if (newSize > SIZE_MAX / sizeof(PGresAttValue *)) { *errmsgp = libpq_gettext("size_t overflow"); - return FALSE; + return false; } #endif @@ -926,13 +926,13 @@ pqAddTuple(PGresult *res, PGresAttValue *tup, const char **errmsgp) newTuples = (PGresAttValue **) realloc(res->tuples, newSize * sizeof(PGresAttValue *)); if (!newTuples) - return FALSE; /* malloc or realloc failed */ + return false; /* malloc or realloc failed */ res->tupArrSize = newSize; res->tuples = newTuples; } res->tuples[res->ntups] = tup; res->ntups++; - return TRUE; + return true; } /* @@ -947,7 +947,7 @@ pqSaveMessageField(PGresult *res, char code, const char *value) pqResultAlloc(res, offsetof(PGMessageField, contents) + strlen(value) + 1, - TRUE); + true); if (!pfield) return; /* out of memory? */ pfield->code = code; @@ -1111,7 +1111,7 @@ pqRowProcessor(PGconn *conn, const char **errmsgp) * memory for gettext() to do anything. */ tup = (PGresAttValue *) - pqResultAlloc(res, nfields * sizeof(PGresAttValue), TRUE); + pqResultAlloc(res, nfields * sizeof(PGresAttValue), true); if (tup == NULL) goto fail; @@ -1725,14 +1725,14 @@ parseInput(PGconn *conn) /* * PQisBusy - * Return TRUE if PQgetResult would block waiting for input. + * Return true if PQgetResult would block waiting for input. */ int PQisBusy(PGconn *conn) { if (!conn) - return FALSE; + return false; /* Parse any available data, if our state permits. */ parseInput(conn); @@ -1771,7 +1771,7 @@ PQgetResult(PGconn *conn) */ while ((flushResult = pqFlush(conn)) > 0) { - if (pqWait(FALSE, TRUE, conn)) + if (pqWait(false, true, conn)) { flushResult = -1; break; @@ -1780,7 +1780,7 @@ PQgetResult(PGconn *conn) /* Wait for some more data, and load it. */ if (flushResult || - pqWait(TRUE, FALSE, conn) || + pqWait(true, false, conn) || pqReadData(conn) < 0) { /* @@ -1844,7 +1844,7 @@ PQgetResult(PGconn *conn) res->resultStatus = PGRES_FATAL_ERROR; break; } - res->events[i].resultInitialized = TRUE; + res->events[i].resultInitialized = true; } } @@ -2746,22 +2746,22 @@ PQbinaryTuples(const PGresult *res) /* * Helper routines to range-check field numbers and tuple numbers. - * Return TRUE if OK, FALSE if not + * Return true if OK, false if not */ static int check_field_number(const PGresult *res, int field_num) { if (!res) - return FALSE; /* no way to display error message... */ + return false; /* no way to display error message... */ if (field_num < 0 || field_num >= res->numAttributes) { pqInternalNotice(&res->noticeHooks, "column number %d is out of range 0..%d", field_num, res->numAttributes - 1); - return FALSE; + return false; } - return TRUE; + return true; } static int @@ -2769,38 +2769,38 @@ check_tuple_field_number(const PGresult *res, int tup_num, int field_num) { if (!res) - return FALSE; /* no way to display error message... */ + return false; /* no way to display error message... */ if (tup_num < 0 || tup_num >= res->ntups) { pqInternalNotice(&res->noticeHooks, "row number %d is out of range 0..%d", tup_num, res->ntups - 1); - return FALSE; + return false; } if (field_num < 0 || field_num >= res->numAttributes) { pqInternalNotice(&res->noticeHooks, "column number %d is out of range 0..%d", field_num, res->numAttributes - 1); - return FALSE; + return false; } - return TRUE; + return true; } static int check_param_number(const PGresult *res, int param_num) { if (!res) - return FALSE; /* no way to display error message... */ + return false; /* no way to display error message... */ if (param_num < 0 || param_num >= res->numParameters) { pqInternalNotice(&res->noticeHooks, "parameter number %d is out of range 0..%d", param_num, res->numParameters - 1); - return FALSE; + return false; } - return TRUE; + return true; } /* @@ -3177,8 +3177,8 @@ PQparamtype(const PGresult *res, int param_num) /* PQsetnonblocking: - * sets the PGconn's database connection non-blocking if the arg is TRUE - * or makes it blocking if the arg is FALSE, this will not protect + * sets the PGconn's database connection non-blocking if the arg is true + * or makes it blocking if the arg is false, this will not protect * you from PQexec(), you'll only be safe when using the non-blocking API. * Needs to be called only on a connected database connection. */ @@ -3190,7 +3190,7 @@ PQsetnonblocking(PGconn *conn, int arg) if (!conn || conn->status == CONNECTION_BAD) return -1; - barg = (arg ? TRUE : FALSE); + barg = (arg ? true : false); /* early out if the socket is already in the state requested */ if (barg == conn->nonblocking) @@ -3213,7 +3213,7 @@ PQsetnonblocking(PGconn *conn, int arg) /* * return the blocking status of the database connection - * TRUE == nonblocking, FALSE == blocking + * true == nonblocking, false == blocking */ int PQisnonblocking(const PGconn *conn) diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index cac6359585..f10c1f87ff 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -936,7 +936,7 @@ pqSendSome(PGconn *conn, int len) break; } - if (pqWait(TRUE, TRUE, conn)) + if (pqWait(true, true, conn)) { result = -1; break; diff --git a/src/interfaces/libpq/fe-protocol2.c b/src/interfaces/libpq/fe-protocol2.c index 83f74f3985..3f7018ac40 100644 --- a/src/interfaces/libpq/fe-protocol2.c +++ b/src/interfaces/libpq/fe-protocol2.c @@ -584,7 +584,7 @@ pqParseInput2(PGconn *conn) if (conn->result != NULL) { /* Read another tuple of a normal query response */ - if (getAnotherTuple(conn, FALSE)) + if (getAnotherTuple(conn, false)) return; /* getAnotherTuple() moves inStart itself */ continue; @@ -602,7 +602,7 @@ pqParseInput2(PGconn *conn) if (conn->result != NULL) { /* Read another tuple of a normal query response */ - if (getAnotherTuple(conn, TRUE)) + if (getAnotherTuple(conn, true)) return; /* getAnotherTuple() moves inStart itself */ continue; @@ -680,7 +680,7 @@ getRowDescriptions(PGconn *conn) if (nfields > 0) { result->attDescs = (PGresAttDesc *) - pqResultAlloc(result, nfields * sizeof(PGresAttDesc), TRUE); + pqResultAlloc(result, nfields * sizeof(PGresAttDesc), true); if (!result->attDescs) { errmsg = NULL; /* means "out of memory", see below */ @@ -1219,7 +1219,7 @@ pqGetCopyData2(PGconn *conn, char **buffer, int async) if (async) return 0; /* Need to load more data */ - if (pqWait(TRUE, FALSE, conn) || + if (pqWait(true, false, conn) || pqReadData(conn) < 0) return -2; } @@ -1264,7 +1264,7 @@ pqGetline2(PGconn *conn, char *s, int maxlen) else { /* need to load more data */ - if (pqWait(TRUE, FALSE, conn) || + if (pqWait(true, false, conn) || pqReadData(conn) < 0) { result = EOF; @@ -1485,7 +1485,7 @@ pqFunctionCall2(PGconn *conn, Oid fnid, if (needInput) { /* Wait for some data to arrive (or for the channel to close) */ - if (pqWait(TRUE, FALSE, conn) || + if (pqWait(true, false, conn) || pqReadData(conn) < 0) break; } diff --git a/src/interfaces/libpq/fe-protocol3.c b/src/interfaces/libpq/fe-protocol3.c index 7da5fb28fb..c2a2c631c9 100644 --- a/src/interfaces/libpq/fe-protocol3.c +++ b/src/interfaces/libpq/fe-protocol3.c @@ -511,7 +511,7 @@ getRowDescriptions(PGconn *conn, int msgLength) if (nfields > 0) { result->attDescs = (PGresAttDesc *) - pqResultAlloc(result, nfields * sizeof(PGresAttDesc), TRUE); + pqResultAlloc(result, nfields * sizeof(PGresAttDesc), true); if (!result->attDescs) { errmsg = NULL; /* means "out of memory", see below */ @@ -669,7 +669,7 @@ getParamDescriptions(PGconn *conn, int msgLength) if (nparams > 0) { result->paramDescs = (PGresParamDesc *) - pqResultAlloc(result, nparams * sizeof(PGresParamDesc), TRUE); + pqResultAlloc(result, nparams * sizeof(PGresParamDesc), true); if (!result->paramDescs) goto advance_and_error; MemSet(result->paramDescs, 0, nparams * sizeof(PGresParamDesc)); @@ -1467,7 +1467,7 @@ getCopyStart(PGconn *conn, ExecStatusType copytype) if (nfields > 0) { result->attDescs = (PGresAttDesc *) - pqResultAlloc(result, nfields * sizeof(PGresAttDesc), TRUE); + pqResultAlloc(result, nfields * sizeof(PGresAttDesc), true); if (!result->attDescs) goto failure; MemSet(result->attDescs, 0, nfields * sizeof(PGresAttDesc)); @@ -1658,7 +1658,7 @@ pqGetCopyData3(PGconn *conn, char **buffer, int async) if (async) return 0; /* Need to load more data */ - if (pqWait(TRUE, FALSE, conn) || + if (pqWait(true, false, conn) || pqReadData(conn) < 0) return -2; continue; @@ -1716,7 +1716,7 @@ pqGetline3(PGconn *conn, char *s, int maxlen) while ((status = PQgetlineAsync(conn, s, maxlen - 1)) == 0) { /* need to load more data */ - if (pqWait(TRUE, FALSE, conn) || + if (pqWait(true, false, conn) || pqReadData(conn) < 0) { *s = '\0'; @@ -1969,7 +1969,7 @@ pqFunctionCall3(PGconn *conn, Oid fnid, if (needInput) { /* Wait for some data to arrive (or for the channel to close) */ - if (pqWait(TRUE, FALSE, conn) || + if (pqWait(true, false, conn) || pqReadData(conn) < 0) break; } diff --git a/src/interfaces/libpq/libpq-events.c b/src/interfaces/libpq/libpq-events.c index e533017a03..883e2af8f4 100644 --- a/src/interfaces/libpq/libpq-events.c +++ b/src/interfaces/libpq/libpq-events.c @@ -44,12 +44,12 @@ PQregisterEventProc(PGconn *conn, PGEventProc proc, PGEventRegister regevt; if (!proc || !conn || !name || !*name) - return FALSE; /* bad arguments */ + return false; /* bad arguments */ for (i = 0; i < conn->nEvents; i++) { if (conn->events[i].proc == proc) - return FALSE; /* already registered */ + return false; /* already registered */ } if (conn->nEvents >= conn->eventArraySize) @@ -64,7 +64,7 @@ PQregisterEventProc(PGconn *conn, PGEventProc proc, e = (PGEvent *) malloc(newSize * sizeof(PGEvent)); if (!e) - return FALSE; + return false; conn->eventArraySize = newSize; conn->events = e; @@ -73,10 +73,10 @@ PQregisterEventProc(PGconn *conn, PGEventProc proc, conn->events[conn->nEvents].proc = proc; conn->events[conn->nEvents].name = strdup(name); if (!conn->events[conn->nEvents].name) - return FALSE; + return false; conn->events[conn->nEvents].passThrough = passThrough; conn->events[conn->nEvents].data = NULL; - conn->events[conn->nEvents].resultInitialized = FALSE; + conn->events[conn->nEvents].resultInitialized = false; conn->nEvents++; regevt.conn = conn; @@ -84,10 +84,10 @@ PQregisterEventProc(PGconn *conn, PGEventProc proc, { conn->nEvents--; free(conn->events[conn->nEvents].name); - return FALSE; + return false; } - return TRUE; + return true; } /* @@ -100,18 +100,18 @@ PQsetInstanceData(PGconn *conn, PGEventProc proc, void *data) int i; if (!conn || !proc) - return FALSE; + return false; for (i = 0; i < conn->nEvents; i++) { if (conn->events[i].proc == proc) { conn->events[i].data = data; - return TRUE; + return true; } } - return FALSE; + return false; } /* @@ -144,18 +144,18 @@ PQresultSetInstanceData(PGresult *result, PGEventProc proc, void *data) int i; if (!result || !proc) - return FALSE; + return false; for (i = 0; i < result->nEvents; i++) { if (result->events[i].proc == proc) { result->events[i].data = data; - return TRUE; + return true; } } - return FALSE; + return false; } /* @@ -187,7 +187,7 @@ PQfireResultCreateEvents(PGconn *conn, PGresult *res) int i; if (!res) - return FALSE; + return false; for (i = 0; i < res->nEvents; i++) { @@ -199,11 +199,11 @@ PQfireResultCreateEvents(PGconn *conn, PGresult *res) evt.result = res; if (!res->events[i].proc(PGEVT_RESULTCREATE, &evt, res->events[i].passThrough)) - return FALSE; + return false; - res->events[i].resultInitialized = TRUE; + res->events[i].resultInitialized = true; } } - return TRUE; + return true; } diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 9716697259..75b1d2aa4d 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -5491,12 +5491,12 @@ exec_for_query(PLpgSQL_execstate *estate, PLpgSQL_stmt_forq *stmt, * a Datum by directly calling ExecEvalExpr(). * * If successful, store results into *result, *isNull, *rettype, *rettypmod - * and return TRUE. If the expression cannot be handled by simple evaluation, - * return FALSE. + * and return true. If the expression cannot be handled by simple evaluation, + * return false. * * Because we only store one execution tree for a simple expression, we * can't handle recursion cases. So, if we see the tree is already busy - * with an evaluation in the current xact, we just return FALSE and let the + * with an evaluation in the current xact, we just return false and let the * caller run the expression the hard way. (Other alternatives such as * creating a new tree for a recursive call either introduce memory leaks, * or add enough bookkeeping to be doubtful wins anyway.) Another case that @@ -6309,7 +6309,7 @@ exec_cast_value(PLpgSQL_execstate *estate, * or NULL if the cast is a mere no-op relabeling. If there's work to be * done, the cast_exprstate field contains an expression evaluation tree * based on a CaseTestExpr input, and the cast_in_use field should be set - * TRUE while executing it. + * true while executing it. * ---------- */ static plpgsql_CastHashEntry * -- 2.11.0 (Apple Git-81)