1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-03 09:13:20 +03:00

Change TRUE/FALSE to true/false

The lower case spellings are C and C++ standard and are used in most
parts of the PostgreSQL sources.  The upper case spellings are only used
in some files/modules.  So standardize on the standard spellings.

The APIs for ICU, Perl, and Windows define their own TRUE and FALSE, so
those are left as is when using those APIs.

In code comments, we use the lower-case spelling for the C concepts and
keep the upper-case spelling for the SQL concepts.

Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
Peter Eisentraut
2017-08-16 00:22:32 -04:00
parent 4497f2f3b3
commit 2eb4a831e5
216 changed files with 1168 additions and 1168 deletions

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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;

View File

@@ -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)

View File

@@ -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

View File

@@ -989,12 +989,12 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
return S_ANYTHING;
}
}
<C,xskip>{exec_sql}{ifdef}{space}* { ifcond = TRUE; BEGIN(xcond); }
<C,xskip>{exec_sql}{ifdef}{space}* { ifcond = true; BEGIN(xcond); }
<C,xskip>{informix_special}{ifdef}{space}* {
/* are we simulating Informix? */
if (INFORMIX_MODE)
{
ifcond = TRUE;
ifcond = true;
BEGIN(xcond);
}
else
@@ -1003,12 +1003,12 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
return S_ANYTHING;
}
}
<C,xskip>{exec_sql}{ifndef}{space}* { ifcond = FALSE; BEGIN(xcond); }
<C,xskip>{exec_sql}{ifndef}{space}* { ifcond = false; BEGIN(xcond); }
<C,xskip>{informix_special}{ifndef}{space}* {
/* are we simulating Informix? */
if (INFORMIX_MODE)
{
ifcond = FALSE;
ifcond = false;
BEGIN(xcond);
}
else
@@ -1026,7 +1026,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
else
preproc_tos--;
ifcond = TRUE; BEGIN(xcond);
ifcond = true; BEGIN(xcond);
}
<C,xskip>{informix_special}{elif}{space}* {
/* are we simulating Informix? */
@@ -1039,7 +1039,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
else
preproc_tos--;
ifcond = TRUE;
ifcond = true;
BEGIN(xcond);
}
else
@@ -1054,7 +1054,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);
@@ -1073,7 +1073,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);
@@ -1147,7 +1147,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;
}
@@ -1265,9 +1265,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)
@@ -1412,7 +1412,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)