Content-Length: 1826624 | pFad | http://github.com/tonybelloni/postgres/commit/2eb4a831e5fb5d8fc17e13aea56e04af3efe27b4

C8 Change TRUE/FALSE to true/false · tonybelloni/postgres@2eb4a83 · GitHub
Skip to content

Commit 2eb4a83

Browse files
committed
Change TRUE/FALSE to true/false
The lower case spellings are C and C++ standard and are used in most parts of the PostgreSQL sources. The upper case spellings are only used in some files/modules. So standardize on the standard spellings. The APIs for ICU, Perl, and Windows define their own TRUE and FALSE, so those are left as is when using those APIs. In code comments, we use the lower-case spelling for the C concepts and keep the upper-case spelling for the SQL concepts. Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
1 parent 4497f2f commit 2eb4a83

File tree

216 files changed

+1168
-1168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+1168
-1168
lines changed

contrib/btree_gist/btree_bit.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static const gbtree_vinfo tinfo =
111111
{
112112
gbt_t_bit,
113113
0,
114-
TRUE,
114+
true,
115115
gbt_bitgt,
116116
gbt_bitge,
117117
gbt_biteq,
@@ -152,13 +152,13 @@ gbt_bit_consistent(PG_FUNCTION_ARGS)
152152

153153
if (GIST_LEAF(entry))
154154
retval = gbt_var_consistent(&r, query, strategy, PG_GET_COLLATION(),
155-
TRUE, &tinfo, fcinfo->flinfo);
155+
true, &tinfo, fcinfo->flinfo);
156156
else
157157
{
158158
bytea *q = gbt_bit_xfrm((bytea *) query);
159159

160160
retval = gbt_var_consistent(&r, q, strategy, PG_GET_COLLATION(),
161-
FALSE, &tinfo, fcinfo->flinfo);
161+
false, &tinfo, fcinfo->flinfo);
162162
}
163163
PG_RETURN_BOOL(retval);
164164
}

contrib/btree_gist/btree_bytea.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static const gbtree_vinfo tinfo =
7575
{
7676
gbt_t_bytea,
7777
0,
78-
TRUE,
78+
true,
7979
gbt_byteagt,
8080
gbt_byteage,
8181
gbt_byteaeq,

contrib/btree_gist/btree_inet.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ gbt_inet_compress(PG_FUNCTION_ARGS)
105105
r->upper = r->lower;
106106
gistentryinit(*retval, PointerGetDatum(r),
107107
entry->rel, entry->page,
108-
entry->offset, FALSE);
108+
entry->offset, false);
109109
}
110110
else
111111
retval = entry;

contrib/btree_gist/btree_interval.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ gbt_intv_compress(PG_FUNCTION_ARGS)
169169
}
170170
gistentryinit(*retval, PointerGetDatum(r),
171171
entry->rel, entry->page,
172-
entry->offset, FALSE);
172+
entry->offset, false);
173173
}
174174

175175
PG_RETURN_POINTER(retval);
@@ -201,7 +201,7 @@ gbt_intv_decompress(PG_FUNCTION_ARGS)
201201

202202
gistentryinit(*retval, PointerGetDatum(r),
203203
entry->rel, entry->page,
204-
entry->offset, FALSE);
204+
entry->offset, false);
205205
}
206206
PG_RETURN_POINTER(retval);
207207
}

contrib/btree_gist/btree_numeric.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static const gbtree_vinfo tinfo =
7979
{
8080
gbt_t_numeric,
8181
0,
82-
FALSE,
82+
false,
8383
gbt_numeric_gt,
8484
gbt_numeric_ge,
8585
gbt_numeric_eq,

contrib/btree_gist/btree_text.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static gbtree_vinfo tinfo =
8080
{
8181
gbt_t_text,
8282
0,
83-
FALSE,
83+
false,
8484
gbt_textgt,
8585
gbt_textge,
8686
gbt_texteq,
@@ -128,7 +128,7 @@ gbt_bpchar_compress(PG_FUNCTION_ARGS)
128128

129129
gistentryinit(trim, d,
130130
entry->rel, entry->page,
131-
entry->offset, TRUE);
131+
entry->offset, true);
132132
retval = gbt_var_compress(&trim, &tinfo);
133133
}
134134
else

contrib/btree_gist/btree_time.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ gbt_timetz_compress(PG_FUNCTION_ARGS)
183183
r->lower = r->upper = tmp;
184184
gistentryinit(*retval, PointerGetDatum(r),
185185
entry->rel, entry->page,
186-
entry->offset, FALSE);
186+
entry->offset, false);
187187
}
188188
else
189189
retval = entry;

contrib/btree_gist/btree_ts.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ gbt_tstz_compress(PG_FUNCTION_ARGS)
230230
r->lower = r->upper = gmt;
231231
gistentryinit(*retval, PointerGetDatum(r),
232232
entry->rel, entry->page,
233-
entry->offset, FALSE);
233+
entry->offset, false);
234234
}
235235
else
236236
retval = entry;

contrib/btree_gist/btree_utils_num.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ gbt_num_compress(GISTENTRY *entry, const gbtree_ninfo *tinfo)
8686
memcpy((void *) &r[tinfo->size], leaf, tinfo->size);
8787
retval = palloc(sizeof(GISTENTRY));
8888
gistentryinit(*retval, PointerGetDatum(r), entry->rel, entry->page,
89-
entry->offset, FALSE);
89+
entry->offset, false);
9090
}
9191
else
9292
retval = entry;
@@ -150,7 +150,7 @@ gbt_num_fetch(GISTENTRY *entry, const gbtree_ninfo *tinfo)
150150

151151
retval = palloc(sizeof(GISTENTRY));
152152
gistentryinit(*retval, datum, entry->rel, entry->page, entry->offset,
153-
FALSE);
153+
false);
154154
return retval;
155155
}
156156

contrib/btree_gist/btree_utils_var.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ gbt_var_decompress(PG_FUNCTION_ARGS)
4545

4646
gistentryinit(*retval, PointerGetDatum(key),
4747
entry->rel, entry->page,
48-
entry->offset, FALSE);
48+
entry->offset, false);
4949

5050
PG_RETURN_POINTER(retval);
5151
}
@@ -169,7 +169,7 @@ gbt_var_node_cp_len(const GBT_VARKEY *node, const gbtree_vinfo *tinfo)
169169
static bool
170170
gbt_bytea_pf_match(const bytea *pf, const bytea *query, const gbtree_vinfo *tinfo)
171171
{
172-
bool out = FALSE;
172+
bool out = false;
173173
int32 qlen = VARSIZE(query) - VARHDRSZ;
174174
int32 nlen = VARSIZE(pf) - VARHDRSZ;
175175

@@ -294,7 +294,7 @@ gbt_var_compress(GISTENTRY *entry, const gbtree_vinfo *tinfo)
294294
retval = palloc(sizeof(GISTENTRY));
295295
gistentryinit(*retval, PointerGetDatum(r),
296296
entry->rel, entry->page,
297-
entry->offset, TRUE);
297+
entry->offset, true);
298298
}
299299
else
300300
retval = entry;
@@ -314,7 +314,7 @@ gbt_var_fetch(PG_FUNCTION_ARGS)
314314
retval = palloc(sizeof(GISTENTRY));
315315
gistentryinit(*retval, PointerGetDatum(r.lower),
316316
entry->rel, entry->page,
317-
entry->offset, TRUE);
317+
entry->offset, true);
318318

319319
PG_RETURN_POINTER(retval);
320320
}
@@ -561,7 +561,7 @@ gbt_var_consistent(GBT_VARKEY_R *key,
561561
const gbtree_vinfo *tinfo,
562562
FmgrInfo *flinfo)
563563
{
564-
bool retval = FALSE;
564+
bool retval = false;
565565

566566
switch (strategy)
567567
{
@@ -607,7 +607,7 @@ gbt_var_consistent(GBT_VARKEY_R *key,
607607
tinfo->f_eq(query, key->upper, collation, flinfo));
608608
break;
609609
default:
610-
retval = FALSE;
610+
retval = false;
611611
}
612612

613613
return retval;

contrib/btree_gist/btree_uuid.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ gbt_uuid_compress(PG_FUNCTION_ARGS)
114114
memcpy((void *) (r + UUID_LEN), (void *) key, UUID_LEN);
115115
gistentryinit(*retval, PointerGetDatum(r),
116116
entry->rel, entry->page,
117-
entry->offset, FALSE);
117+
entry->offset, false);
118118
}
119119
else
120120
retval = entry;

contrib/cube/cube.c

+18-18
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ cube_out(PG_FUNCTION_ARGS)
309309
/*
310310
** The GiST Consistent method for boxes
311311
** Should return false if for all data items x below entry,
312-
** the predicate x op query == FALSE, where op is the oper
312+
** the predicate x op query == false, where op is the oper
313313
** corresponding to strategy in the pg_amop table.
314314
*/
315315
Datum
@@ -396,7 +396,7 @@ g_cube_decompress(PG_FUNCTION_ARGS)
396396

397397
gistentryinit(*retval, PointerGetDatum(key),
398398
entry->rel, entry->page,
399-
entry->offset, FALSE);
399+
entry->offset, false);
400400
PG_RETURN_POINTER(retval);
401401
}
402402
PG_RETURN_POINTER(entry);
@@ -590,9 +590,9 @@ g_cube_same(PG_FUNCTION_ARGS)
590590
bool *result = (bool *) PG_GETARG_POINTER(2);
591591

592592
if (cube_cmp_v0(b1, b2) == 0)
593-
*result = TRUE;
593+
*result = true;
594594
else
595-
*result = FALSE;
595+
*result = false;
596596

597597
PG_RETURN_NDBOX_P(result);
598598
}
@@ -624,7 +624,7 @@ g_cube_leaf_consistent(NDBOX *key,
624624
retval = cube_contains_v0(query, key);
625625
break;
626626
default:
627-
retval = FALSE;
627+
retval = false;
628628
}
629629
return retval;
630630
}
@@ -651,7 +651,7 @@ g_cube_internal_consistent(NDBOX *key,
651651
retval = (bool) cube_overlap_v0(key, query);
652652
break;
653653
default:
654-
retval = FALSE;
654+
retval = false;
655655
}
656656
return retval;
657657
}
@@ -1059,7 +1059,7 @@ cube_contains_v0(NDBOX *a, NDBOX *b)
10591059
int i;
10601060

10611061
if ((a == NULL) || (b == NULL))
1062-
return FALSE;
1062+
return false;
10631063

10641064
if (DIM(a) < DIM(b))
10651065
{
@@ -1071,9 +1071,9 @@ cube_contains_v0(NDBOX *a, NDBOX *b)
10711071
for (i = DIM(a); i < DIM(b); i++)
10721072
{
10731073
if (LL_COORD(b, i) != 0)
1074-
return FALSE;
1074+
return false;
10751075
if (UR_COORD(b, i) != 0)
1076-
return FALSE;
1076+
return false;
10771077
}
10781078
}
10791079

@@ -1082,13 +1082,13 @@ cube_contains_v0(NDBOX *a, NDBOX *b)
10821082
{
10831083
if (Min(LL_COORD(a, i), UR_COORD(a, i)) >
10841084
Min(LL_COORD(b, i), UR_COORD(b, i)))
1085-
return FALSE;
1085+
return false;
10861086
if (Max(LL_COORD(a, i), UR_COORD(a, i)) <
10871087
Max(LL_COORD(b, i), UR_COORD(b, i)))
1088-
return FALSE;
1088+
return false;
10891089
}
10901090

1091-
return TRUE;
1091+
return true;
10921092
}
10931093

10941094
Datum
@@ -1129,7 +1129,7 @@ cube_overlap_v0(NDBOX *a, NDBOX *b)
11291129
int i;
11301130

11311131
if ((a == NULL) || (b == NULL))
1132-
return FALSE;
1132+
return false;
11331133

11341134
/* swap the box pointers if needed */
11351135
if (DIM(a) < DIM(b))
@@ -1144,21 +1144,21 @@ cube_overlap_v0(NDBOX *a, NDBOX *b)
11441144
for (i = 0; i < DIM(b); i++)
11451145
{
11461146
if (Min(LL_COORD(a, i), UR_COORD(a, i)) > Max(LL_COORD(b, i), UR_COORD(b, i)))
1147-
return FALSE;
1147+
return false;
11481148
if (Max(LL_COORD(a, i), UR_COORD(a, i)) < Min(LL_COORD(b, i), UR_COORD(b, i)))
1149-
return FALSE;
1149+
return false;
11501150
}
11511151

11521152
/* compare to zero those dimensions in (a) absent in (b) */
11531153
for (i = DIM(b); i < DIM(a); i++)
11541154
{
11551155
if (Min(LL_COORD(a, i), UR_COORD(a, i)) > 0)
1156-
return FALSE;
1156+
return false;
11571157
if (Max(LL_COORD(a, i), UR_COORD(a, i)) < 0)
1158-
return FALSE;
1158+
return false;
11591159
}
11601160

1161-
return TRUE;
1161+
return true;
11621162
}
11631163

11641164

contrib/dblink/dblink.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ dblink_init(void)
243243
pconn = (remoteConn *) MemoryContextAlloc(TopMemoryContext, sizeof(remoteConn));
244244
pconn->conn = NULL;
245245
pconn->openCursorCount = 0;
246-
pconn->newXactForCursor = FALSE;
246+
pconn->newXactForCursor = false;
247247
}
248248
}
249249

@@ -423,7 +423,7 @@ dblink_open(PG_FUNCTION_ARGS)
423423
if (PQresultStatus(res) != PGRES_COMMAND_OK)
424424
dblink_res_internalerror(conn, res, "begin error");
425425
PQclear(res);
426-
rconn->newXactForCursor = TRUE;
426+
rconn->newXactForCursor = true;
427427

428428
/*
429429
* Since transaction state was IDLE, we force cursor count to
@@ -523,7 +523,7 @@ dblink_close(PG_FUNCTION_ARGS)
523523
/* if count is zero, commit the transaction */
524524
if (rconn->openCursorCount == 0)
525525
{
526-
rconn->newXactForCursor = FALSE;
526+
rconn->newXactForCursor = false;
527527

528528
res = PQexec(conn, "COMMIT");
529529
if (PQresultStatus(res) != PGRES_COMMAND_OK)

contrib/file_fdw/file_fdw.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ fileIsForeignScanParallelSafe(PlannerInfo *root, RelOptInfo *rel,
824824
*
825825
* Check to see if it's useful to convert only a subset of the file's columns
826826
* to binary. If so, construct a list of the column names to be converted,
827-
* return that at *columns, and return TRUE. (Note that it's possible to
827+
* return that at *columns, and return true. (Note that it's possible to
828828
* determine that no columns need be converted, for instance with a COUNT(*)
829829
* query. So we can't use returning a NIL list to indicate failure.)
830830
*/

contrib/fuzzystrmatch/fuzzystrmatch.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ soundex_code(char letter)
8787
phoned_word -- The final phonized word. (We'll allocate the
8888
memory.)
8989
Output
90-
error -- A simple error flag, returns TRUE or FALSE
90+
error -- A simple error flag, returns true or false
9191
9292
NOTES: ALL non-alpha characters are ignored, this includes whitespace,
9393
although non-alpha characters will break up phonemes.

contrib/hstore/hstore_gist.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ ghstore_compress(PG_FUNCTION_ARGS)
144144
gistentryinit(*retval, PointerGetDatum(res),
145145
entry->rel, entry->page,
146146
entry->offset,
147-
FALSE);
147+
false);
148148
}
149149
else if (!ISALLTRUE(DatumGetPointer(entry->key)))
150150
{
@@ -166,7 +166,7 @@ ghstore_compress(PG_FUNCTION_ARGS)
166166
gistentryinit(*retval, PointerGetDatum(res),
167167
entry->rel, entry->page,
168168
entry->offset,
169-
FALSE);
169+
false);
170170
}
171171

172172
PG_RETURN_POINTER(retval);
@@ -570,7 +570,7 @@ ghstore_consistent(PG_FUNCTION_ARGS)
570570
continue;
571571
crc = crc32_sz(VARDATA(key_datums[i]), VARSIZE(key_datums[i]) - VARHDRSZ);
572572
if (!(GETBIT(sign, HASHVAL(crc))))
573-
res = FALSE;
573+
res = false;
574574
}
575575
}
576576
else if (strategy == HStoreExistsAnyStrategyNumber)
@@ -585,7 +585,7 @@ ghstore_consistent(PG_FUNCTION_ARGS)
585585
TEXTOID, -1, false, 'i',
586586
&key_datums, &key_nulls, &key_count);
587587

588-
res = FALSE;
588+
res = false;
589589

590590
for (i = 0; !res && i < key_count; ++i)
591591
{
@@ -595,7 +595,7 @@ ghstore_consistent(PG_FUNCTION_ARGS)
595595
continue;
596596
crc = crc32_sz(VARDATA(key_datums[i]), VARSIZE(key_datums[i]) - VARHDRSZ);
597597
if (GETBIT(sign, HASHVAL(crc)))
598-
res = TRUE;
598+
res = true;
599599
}
600600
}
601601
else

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/tonybelloni/postgres/commit/2eb4a831e5fb5d8fc17e13aea56e04af3efe27b4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy