diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2017-08-16 00:22:32 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2017-11-08 11:37:28 -0500 |
commit | 2eb4a831e5fb5d8fc17e13aea56e04af3efe27b4 (patch) | |
tree | b46993cceb7cd8b848e39a45c1bb8c73dc67b221 /src/backend/utils/adt | |
parent | 4497f2f3b30fa5cd48898033c351bfcf01ce73e2 (diff) | |
download | postgresql-2eb4a831e5fb5d8fc17e13aea56e04af3efe27b4.tar.gz postgresql-2eb4a831e5fb5d8fc17e13aea56e04af3efe27b4.zip |
Change TRUE/FALSE to true/false
The lower case spellings are C and C++ standard and are used in most
parts of the PostgreSQL sources. The upper case spellings are only used
in some files/modules. So standardize on the standard spellings.
The APIs for ICU, Perl, and Windows define their own TRUE and FALSE, so
those are left as is when using those APIs.
In code comments, we use the lower-case spelling for the C concepts and
keep the upper-case spelling for the SQL concepts.
Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r-- | src/backend/utils/adt/arrayfuncs.c | 6 | ||||
-rw-r--r-- | src/backend/utils/adt/datetime.c | 50 | ||||
-rw-r--r-- | src/backend/utils/adt/formatting.c | 272 | ||||
-rw-r--r-- | src/backend/utils/adt/geo_ops.c | 12 | ||||
-rw-r--r-- | src/backend/utils/adt/misc.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/network_gist.c | 6 | ||||
-rw-r--r-- | src/backend/utils/adt/numeric.c | 10 | ||||
-rw-r--r-- | src/backend/utils/adt/regexp.c | 8 | ||||
-rw-r--r-- | src/backend/utils/adt/regproc.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/ri_triggers.c | 8 | ||||
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 18 | ||||
-rw-r--r-- | src/backend/utils/adt/selfuncs.c | 24 | ||||
-rw-r--r-- | src/backend/utils/adt/tsginidx.c | 2 | ||||
-rw-r--r-- | src/backend/utils/adt/tsgistidx.c | 6 | ||||
-rw-r--r-- | src/backend/utils/adt/tsquery_gist.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/varlena.c | 4 | ||||
-rw-r--r-- | src/backend/utils/adt/xml.c | 2 |
17 files changed, 218 insertions, 218 deletions
diff --git a/src/backend/utils/adt/arrayfuncs.c b/src/backend/utils/adt/arrayfuncs.c index b4c31ef65c2..ac21241f69a 100644 --- a/src/backend/utils/adt/arrayfuncs.c +++ b/src/backend/utils/adt/arrayfuncs.c @@ -706,7 +706,7 @@ ArrayCount(const char *str, int *dim, char typdelim) * Outputs: * values[]: filled with converted data values. * nulls[]: filled with is-null markers. - * *hasnulls: set TRUE iff there are any null elements. + * *hasnulls: set true iff there are any null elements. * *nbytes: set to total size of data area needed (including alignment * padding but not including array header overhead). * @@ -946,7 +946,7 @@ ReadArrayStr(char *arrayStr, * nulls: array of is-null flags (can be NULL if no nulls) * nitems: number of Datums to be copied * typbyval, typlen, typalign: info about element datatype - * freedata: if TRUE and element type is pass-by-ref, pfree data values + * freedata: if true and element type is pass-by-ref, pfree data values * referenced by Datums after copying them. * * If the input data is of varlena type, the caller must have ensured that @@ -1419,7 +1419,7 @@ array_recv(PG_FUNCTION_ARGS) * Outputs: * values[]: filled with converted data values. * nulls[]: filled with is-null markers. - * *hasnulls: set TRUE iff there are any null elements. + * *hasnulls: set true iff there are any null elements. * *nbytes: set to total size of data area needed (including alignment * padding but not including array header overhead). * diff --git a/src/backend/utils/adt/datetime.c b/src/backend/utils/adt/datetime.c index a3d7dc3697a..efa37644fc9 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 7877af2d6be..50254f23888 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: @@ -2066,17 +2066,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 @@ -2085,19 +2085,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) */ } @@ -3391,7 +3391,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)); @@ -3405,7 +3405,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; } @@ -3636,7 +3636,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)); @@ -3650,7 +3650,7 @@ do_to_timestamp(text *date_txt, text *fmt, */ DCHCacheEntry *ent = DCH_cache_fetch(fmt_str); - incache = TRUE; + incache = true; format = ent->format; } @@ -4239,7 +4239,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", @@ -4340,13 +4340,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 @@ -4364,8 +4364,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; } } @@ -4423,11 +4423,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 @@ -4445,7 +4445,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) @@ -4477,15 +4477,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)) { @@ -4496,14 +4496,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 == '+') { @@ -4512,13 +4512,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; } } @@ -4549,7 +4549,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 { @@ -4607,7 +4607,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 */ @@ -4622,7 +4622,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; @@ -4659,7 +4659,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; @@ -4706,10 +4706,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 { @@ -4723,17 +4723,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 @@ -4762,7 +4762,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 e13389a6cc7..9dbe5db2b2b 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/misc.c b/src/backend/utils/adt/misc.c index 62341b84d1c..1980ff5ac72 100644 --- a/src/backend/utils/adt/misc.c +++ b/src/backend/utils/adt/misc.c @@ -47,7 +47,7 @@ /* * Common subroutine for num_nulls() and num_nonnulls(). - * Returns TRUE if successful, FALSE if function should return NULL. + * Returns true if successful, false if function should return NULL. * If successful, total argument count and number of nulls are * returned into *nargs and *nulls. */ diff --git a/src/backend/utils/adt/network_gist.c b/src/backend/utils/adt/network_gist.c index 0e36b7685de..c4cafba5036 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 @@ -602,7 +602,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 2cd14f34012..82e6f4483bd 100644 --- a/src/backend/utils/adt/numeric.c +++ b/src/backend/utils/adt/numeric.c @@ -5527,7 +5527,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; @@ -5558,7 +5558,7 @@ set_var_from_str(const char *str, const char *cp, NumericVar *dest) if (*cp == '.') { - have_dp = TRUE; + have_dp = true; cp++; } @@ -5591,7 +5591,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 @@ -6160,7 +6160,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) @@ -6279,7 +6279,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/regexp.c b/src/backend/utils/adt/regexp.c index 139bb583b1c..e858b5910f5 100644 --- a/src/backend/utils/adt/regexp.c +++ b/src/backend/utils/adt/regexp.c @@ -247,7 +247,7 @@ RE_compile_and_cache(text *text_re, int cflags, Oid collation) /* * RE_wchar_execute - execute a RE on pg_wchar data * - * Returns TRUE on match, FALSE on no match + * Returns true on match, false on no match * * re --- the compiled pattern as returned by RE_compile_and_cache * data --- the data to match against (need not be null-terminated) @@ -291,7 +291,7 @@ RE_wchar_execute(regex_t *re, pg_wchar *data, int data_len, /* * RE_execute - execute a RE * - * Returns TRUE on match, FALSE on no match + * Returns true on match, false on no match * * re --- the compiled pattern as returned by RE_compile_and_cache * dat --- the data to match against (need not be null-terminated) @@ -323,7 +323,7 @@ RE_execute(regex_t *re, char *dat, int dat_len, /* * RE_compile_and_execute - compile and execute a RE * - * Returns TRUE on match, FALSE on no match + * Returns true on match, false on no match * * text_re --- the pattern, expressed as a TEXT object * dat --- the data to match against (need not be null-terminated) @@ -1294,7 +1294,7 @@ build_regexp_split_result(regexp_matches_ctx *splitctx) * regexp_fixed_prefix - extract fixed prefix, if any, for a regexp * * The result is NULL if there is no fixed prefix, else a palloc'd string. - * If it is an exact match, not just a prefix, *exact is returned as TRUE. + * If it is an exact match, not just a prefix, *exact is returned as true. */ char * regexp_fixed_prefix(text *text_re, bool case_insensitive, Oid collation, diff --git a/src/backend/utils/adt/regproc.c b/src/backend/utils/adt/regproc.c index 6fe81fab7e4..afd0c00b8ad 100644 --- a/src/backend/utils/adt/regproc.c +++ b/src/backend/utils/adt/regproc.c @@ -1728,7 +1728,7 @@ stringToQualifiedNameList(const char *string) * the argtypes array should be of size FUNC_MAX_ARGS). The function or * operator name is returned to *names as a List of Strings. * - * If allowNone is TRUE, accept "NONE" and return it as InvalidOid (this is + * If allowNone is true, accept "NONE" and return it as InvalidOid (this is * for unary operators). */ static void diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c index ba0e3ad87d2..4badb5fd7cf 100644 --- a/src/backend/utils/adt/ri_triggers.c +++ b/src/backend/utils/adt/ri_triggers.c @@ -2075,8 +2075,8 @@ RI_FKey_setdefault_upd(PG_FUNCTION_ARGS) * * Check if we really need to fire the RI trigger for an update to a PK * relation. This is called by the AFTER trigger queue manager to see if - * it can skip queuing an instance of an RI trigger. Returns TRUE if the - * trigger must be fired, FALSE if we can prove the constraint will still + * it can skip queuing an instance of an RI trigger. Returns true if the + * trigger must be fired, false if we can prove the constraint will still * be satisfied. * ---------- */ @@ -2132,8 +2132,8 @@ RI_FKey_pk_upd_check_required(Trigger *trigger, Relation pk_rel, * * Check if we really need to fire the RI trigger for an update to an FK * relation. This is called by the AFTER trigger queue manager to see if - * it can skip queuing an instance of an RI trigger. Returns TRUE if the - * trigger must be fired, FALSE if we can prove the constraint will still + * it can skip queuing an instance of an RI trigger. Returns true if the + * trigger must be fired, false if we can prove the constraint will still * be satisfied. * ---------- */ diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index cc6cec7877d..752cef09e66 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -112,7 +112,7 @@ typedef struct int prettyFlags; /* enabling of pretty-print functions */ int wrapColumn; /* max line length, or -1 for no limit */ int indentLevel; /* current indent level for prettyprint */ - bool varprefix; /* TRUE to print prefixes on Vars */ + bool varprefix; /* true to print prefixes on Vars */ ParseExprKind special_exprkind; /* set only for exprkinds needing special * handling */ } deparse_context; @@ -130,7 +130,7 @@ typedef struct * rtable_columns holds the column alias names to be used for each RTE. * * In some cases we need to make names of merged JOIN USING columns unique - * across the whole query, not only per-RTE. If so, unique_using is TRUE + * across the whole query, not only per-RTE. If so, unique_using is true * and using_names is a list of C strings representing names already assigned * to USING columns. * @@ -3012,9 +3012,9 @@ deparse_expression(Node *expr, List *dpcontext, * for interpreting Vars in the node tree. It can be NIL if no Vars are * expected. * - * forceprefix is TRUE to force all Vars to be prefixed with their table names. + * forceprefix is true to force all Vars to be prefixed with their table names. * - * showimplicit is TRUE to force all implicit casts to be shown explicitly. + * showimplicit is true to force all implicit casts to be shown explicitly. * * Tries to pretty up the output according to prettyFlags and startIndent. * @@ -3587,7 +3587,7 @@ set_using_names(deparse_namespace *dpns, Node *jtnode, List *parentUsing) * If there's a USING clause, select the USING column names and push * those names down to the children. We have two strategies: * - * If dpns->unique_using is TRUE, we force all USING names to be + * If dpns->unique_using is true, we force all USING names to be * unique across the whole query level. In principle we'd only need * the names of dangerous USING columns to be globally unique, but to * safely assign all USING names in a single pass, we have to enforce @@ -3600,7 +3600,7 @@ set_using_names(deparse_namespace *dpns, Node *jtnode, List *parentUsing) * this simplifies the logic and seems likely to lead to less aliasing * overall. * - * If dpns->unique_using is FALSE, we only need USING names to be + * If dpns->unique_using is false, we only need USING names to be * unique within their own join RTE. We still need to honor * pushed-down names, though. * @@ -5167,7 +5167,7 @@ get_simple_values_rte(Query *query) ListCell *lc; /* - * We want to return TRUE even if the Query also contains OLD or NEW rule + * We want to return true even if the Query also contains OLD or NEW rule * RTEs. So the idea is to scan the rtable and see if there is only one * inFromCl RTE that is a VALUES RTE. */ @@ -6416,7 +6416,7 @@ get_utility_query_def(Query *query, deparse_context *context) * the Var's varlevelsup has to be interpreted with respect to a context * above the current one; levelsup indicates the offset. * - * If istoplevel is TRUE, the Var is at the top level of a SELECT's + * If istoplevel is true, the Var is at the top level of a SELECT's * targetlist, which means we need special treatment of whole-row Vars. * Instead of the normal "tab.*", we'll print "tab.*::typename", which is a * dirty hack to prevent "tab.*" from being expanded into multiple columns. @@ -10612,7 +10612,7 @@ generate_qualified_relation_name(Oid relid) * means a FuncExpr or Aggref, not some other way of calling a function), then * has_variadic must specify whether variadic arguments have been merged, * and *use_variadic_p will be set to indicate whether to print VARIADIC in - * the output. For non-FuncExpr cases, has_variadic should be FALSE and + * the output. For non-FuncExpr cases, has_variadic should be false and * use_variadic_p can be NULL. * * The result includes all necessary quoting and schema-prefixing. diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 7361e9d43ca..4bbb4a850eb 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -790,7 +790,7 @@ ineq_histogram_selectivity(PlannerInfo *root, * hand! (For example, we might have a '<=' operator rather than the '<' * operator that will appear in staop.) For now, assume that whatever * appears in pg_statistic is sorted the same way our operator sorts, or - * the reverse way if isgt is TRUE. + * the reverse way if isgt is true. */ if (HeapTupleIsValid(vardata->statsTuple) && statistic_proc_security_check(vardata, opproc->fn_oid) && @@ -3814,7 +3814,7 @@ estimate_hash_bucket_stats(PlannerInfo *root, Node *hashkey, double nbuckets, * * Varinfos that aren't for simple Vars are ignored. * - * Return TRUE if we're able to find a match, FALSE otherwise. + * Return true if we're able to find a match, false otherwise. */ static bool estimate_multivariate_ndistinct(PlannerInfo *root, RelOptInfo *rel, @@ -4527,12 +4527,12 @@ convert_timevalue_to_scalar(Datum value, Oid typid) * args: clause argument list * varRelid: see specs for restriction selectivity functions * - * Outputs: (these are valid only if TRUE is returned) + * Outputs: (these are valid only if true is returned) * *vardata: gets information about variable (see examine_variable) * *other: gets other clause argument, aggressively reduced to a constant - * *varonleft: set TRUE if variable is on the left, FALSE if on the right + * *varonleft: set true if variable is on the left, false if on the right * - * Returns TRUE if a variable is identified, otherwise FALSE. + * Returns true if a variable is identified, otherwise false. * * Note: if there are Vars on both sides of the clause, we must fail, because * callers are expecting that the other side will act like a pseudoconstant. @@ -4648,12 +4648,12 @@ get_join_variables(PlannerInfo *root, List *args, SpecialJoinInfo *sjinfo, * atttype, atttypmod: actual type/typmod of the "var" expression. This is * commonly the same as the exposed type of the variable argument, * but can be different in binary-compatible-type cases. - * isunique: TRUE if we were able to match the var to a unique index or a + * isunique: true if we were able to match the var to a unique index or a * single-column DISTINCT clause, implying its values are unique for * this query. (Caution: this should be trusted for statistical * purposes only, since we do not check indimmediate nor verify that * the exact same definition of equality applies.) - * acl_ok: TRUE if current user has permission to read the column(s) + * acl_ok: true if current user has permission to read the column(s) * underlying the pg_statistic entry. This is consulted by * statistic_proc_security_check(). * @@ -5060,7 +5060,7 @@ statistic_proc_security_check(VariableStatData *vardata, Oid func_oid) * Estimate the number of distinct values of a variable. * * vardata: results of examine_variable - * *isdefault: set to TRUE if the result is a default rather than based on + * *isdefault: set to true if the result is a default rather than based on * anything meaningful. * * NB: be careful to produce a positive integral result, since callers may @@ -5193,8 +5193,8 @@ get_variable_numdistinct(VariableStatData *vardata, bool *isdefault) /* * get_variable_range * Estimate the minimum and maximum value of the specified variable. - * If successful, store values in *min and *max, and return TRUE. - * If no data available, return FALSE. + * If successful, store values in *min and *max, and return true. + * If no data available, return false. * * sortop is the "<" comparison operator to use. This should generally * be "<" not ">", as only the former is likely to be found in pg_statistic. @@ -5327,9 +5327,9 @@ get_variable_range(PlannerInfo *root, VariableStatData *vardata, Oid sortop, * Attempt to identify the current *actual* minimum and/or maximum * of the specified variable, by looking for a suitable btree index * and fetching its low and/or high values. - * If successful, store values in *min and *max, and return TRUE. + * If successful, store values in *min and *max, and return true. * (Either pointer can be NULL if that endpoint isn't needed.) - * If no data available, return FALSE. + * If no data available, return false. * * sortop is the "<" comparison operator to use. */ diff --git a/src/backend/utils/adt/tsginidx.c b/src/backend/utils/adt/tsginidx.c index 83a939dfd5c..aba456ed880 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 578af5d5126..3295f7252b9 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); } @@ -285,7 +285,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 05bc0d6adb3..04134d14adb 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); @@ -79,7 +79,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/adt/varlena.c b/src/backend/utils/adt/varlena.c index 4b5483dbb97..4674ee2938a 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -3255,7 +3255,7 @@ textToQualifiedNameList(text *textval) * namelist: filled with a palloc'd list of pointers to identifiers within * rawstring. Caller should list_free() this even on error return. * - * Returns TRUE if okay, FALSE if there is a syntax error in the string. + * Returns true if okay, false if there is a syntax error in the string. * * Note that an empty string is considered okay here, though not in * textToQualifiedNameList. @@ -3383,7 +3383,7 @@ SplitIdentifierString(char *rawstring, char separator, * namelist: filled with a palloc'd list of directory names. * Caller should list_free_deep() this even on error return. * - * Returns TRUE if okay, FALSE if there is a syntax error in the string. + * Returns true if okay, false if there is a syntax error in the string. * * Note that an empty string is considered okay here. */ diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c index 24229c2dff7..c9d07f2ae9b 100644 --- a/src/backend/utils/adt/xml.c +++ b/src/backend/utils/adt/xml.c @@ -4376,7 +4376,7 @@ XmlTableSetColumnFilter(TableFuncScanState *state, char *path, int colnum) /* * XmlTableFetchRow * Prepare the next "current" tuple for upcoming GetValue calls. - * Returns FALSE if the row-filter expression returned no more rows. + * Returns false if the row-filter expression returned no more rows. */ static bool XmlTableFetchRow(TableFuncScanState *state) |