Commit 2d8a1e22 authored by Robert Haas's avatar Robert Haas

Various minor corrections of and improvements to comments.

Aleksander Alekseev
parent aa698d75
...@@ -210,7 +210,7 @@ gin_trgm_consistent(PG_FUNCTION_ARGS) ...@@ -210,7 +210,7 @@ gin_trgm_consistent(PG_FUNCTION_ARGS)
* And again, c (ntrue) is a lower bound of len2, but c <= len1 * And again, c (ntrue) is a lower bound of len2, but c <= len1
* just by definition and, consequently, upper bound of * just by definition and, consequently, upper bound of
* similarity is just c / len1. * similarity is just c / len1.
* So, independly on DIVUNION the upper bound formula is the same. * So, independently on DIVUNION the upper bound formula is the same.
*/ */
res = (nkeys == 0) ? false : res = (nkeys == 0) ? false :
(((((float4) ntrue) / ((float4) nkeys))) >= nlimit); (((((float4) ntrue) / ((float4) nkeys))) >= nlimit);
...@@ -330,7 +330,7 @@ gin_trgm_triconsistent(PG_FUNCTION_ARGS) ...@@ -330,7 +330,7 @@ gin_trgm_triconsistent(PG_FUNCTION_ARGS)
else else
{ {
/* /*
* As trigramsMatchGraph implements a montonic boolean function, * As trigramsMatchGraph implements a monotonic boolean function,
* promoting all GIN_MAYBE keys to GIN_TRUE will give a * promoting all GIN_MAYBE keys to GIN_TRUE will give a
* conservative result. * conservative result.
*/ */
......
...@@ -628,7 +628,7 @@ calc_word_similarity(char *str1, int slen1, char *str2, int slen2, ...@@ -628,7 +628,7 @@ calc_word_similarity(char *str1, int slen1, char *str2, int slen2,
/* /*
* Extract the next non-wildcard part of a search string, ie, a word bounded * Extract the next non-wildcard part of a search string, i.e. a word bounded
* by '_' or '%' meta-characters, non-word characters or string end. * by '_' or '%' meta-characters, non-word characters or string end.
* *
* str: source string, of length lenstr bytes (need not be null-terminated) * str: source string, of length lenstr bytes (need not be null-terminated)
......
...@@ -258,7 +258,7 @@ timestamp_recv(PG_FUNCTION_ARGS) ...@@ -258,7 +258,7 @@ timestamp_recv(PG_FUNCTION_ARGS)
errmsg("timestamp cannot be NaN"))); errmsg("timestamp cannot be NaN")));
#endif #endif
/* rangecheck: see if timestamp_out would like it */ /* range check: see if timestamp_out would like it */
if (TIMESTAMP_NOT_FINITE(timestamp)) if (TIMESTAMP_NOT_FINITE(timestamp))
/* ok */ ; /* ok */ ;
else if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL, NULL) != 0 || else if (timestamp2tm(timestamp, NULL, tm, &fsec, NULL, NULL) != 0 ||
...@@ -792,7 +792,7 @@ timestamptz_recv(PG_FUNCTION_ARGS) ...@@ -792,7 +792,7 @@ timestamptz_recv(PG_FUNCTION_ARGS)
timestamp = (TimestampTz) pq_getmsgfloat8(buf); timestamp = (TimestampTz) pq_getmsgfloat8(buf);
#endif #endif
/* rangecheck: see if timestamptz_out would like it */ /* range check: see if timestamptz_out would like it */
if (TIMESTAMP_NOT_FINITE(timestamp)) if (TIMESTAMP_NOT_FINITE(timestamp))
/* ok */ ; /* ok */ ;
else if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0 || else if (timestamp2tm(timestamp, &tz, tm, &fsec, NULL, NULL) != 0 ||
...@@ -1435,7 +1435,7 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod) ...@@ -1435,7 +1435,7 @@ AdjustIntervalForTypmod(Interval *interval, int32 typmod)
else else
elog(ERROR, "unrecognized interval typmod: %d", typmod); elog(ERROR, "unrecognized interval typmod: %d", typmod);
/* Need to adjust subsecond precision? */ /* Need to adjust sub-second precision? */
if (precision != INTERVAL_FULL_PRECISION) if (precision != INTERVAL_FULL_PRECISION)
{ {
if (precision < 0 || precision > MAX_INTERVAL_PRECISION) if (precision < 0 || precision > MAX_INTERVAL_PRECISION)
...@@ -1635,7 +1635,7 @@ IntegerTimestampToTimestampTz(int64 timestamp) ...@@ -1635,7 +1635,7 @@ IntegerTimestampToTimestampTz(int64 timestamp)
* Both inputs must be ordinary finite timestamps (in current usage, * Both inputs must be ordinary finite timestamps (in current usage,
* they'll be results from GetCurrentTimestamp()). * they'll be results from GetCurrentTimestamp()).
* *
* We expect start_time <= stop_time. If not, we return zeroes; for current * We expect start_time <= stop_time. If not, we return zeros; for current
* callers there is no need to be tense about which way division rounds on * callers there is no need to be tense about which way division rounds on
* negative inputs. * negative inputs.
*/ */
...@@ -2276,7 +2276,7 @@ timestamp_hash(PG_FUNCTION_ARGS) ...@@ -2276,7 +2276,7 @@ timestamp_hash(PG_FUNCTION_ARGS)
/* /*
* Crosstype comparison functions for timestamp vs timestamptz * Cross-type comparison functions for timestamp vs timestamptz
*/ */
Datum Datum
...@@ -2678,7 +2678,7 @@ overlaps_timestamp(PG_FUNCTION_ARGS) ...@@ -2678,7 +2678,7 @@ overlaps_timestamp(PG_FUNCTION_ARGS)
{ {
/* /*
* For ts1 = ts2 the spec says te1 <> te2 OR te1 = te2, which is a * For ts1 = ts2 the spec says te1 <> te2 OR te1 = te2, which is a
* rather silly way of saying "true if both are nonnull, else null". * rather silly way of saying "true if both are non-null, else null".
*/ */
if (te1IsNull || te2IsNull) if (te1IsNull || te2IsNull)
PG_RETURN_NULL(); PG_RETURN_NULL();
...@@ -2996,7 +2996,7 @@ timestamp_pl_interval(PG_FUNCTION_ARGS) ...@@ -2996,7 +2996,7 @@ timestamp_pl_interval(PG_FUNCTION_ARGS)
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE), (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range"))); errmsg("timestamp out of range")));
/* Add days by converting to and from julian */ /* Add days by converting to and from Julian */
julian = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) + span->day; julian = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) + span->day;
j2date(julian, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); j2date(julian, &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
...@@ -3104,7 +3104,7 @@ timestamptz_pl_interval(PG_FUNCTION_ARGS) ...@@ -3104,7 +3104,7 @@ timestamptz_pl_interval(PG_FUNCTION_ARGS)
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE), (errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
errmsg("timestamp out of range"))); errmsg("timestamp out of range")));
/* Add days by converting to and from julian */ /* Add days by converting to and from Julian */
julian = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) + span->day; julian = date2j(tm->tm_year, tm->tm_mon, tm->tm_mday) + span->day;
j2date(julian, &tm->tm_year, &tm->tm_mon, &tm->tm_mday); j2date(julian, &tm->tm_year, &tm->tm_mon, &tm->tm_mday);
...@@ -3309,7 +3309,7 @@ interval_mul(PG_FUNCTION_ARGS) ...@@ -3309,7 +3309,7 @@ interval_mul(PG_FUNCTION_ARGS)
/* /*
* The above correctly handles the whole-number part of the month and day * The above correctly handles the whole-number part of the month and day
* products, but we have to do something with any fractional part * products, but we have to do something with any fractional part
* resulting when the factor is nonintegral. We cascade the fractions * resulting when the factor is non-integral. We cascade the fractions
* down to lower units using the conversion factors DAYS_PER_MONTH and * down to lower units using the conversion factors DAYS_PER_MONTH and
* SECS_PER_DAY. Note we do NOT cascade up, since we are not forced to do * SECS_PER_DAY. Note we do NOT cascade up, since we are not forced to do
* so by the representation. The user can choose to cascade up later, * so by the representation. The user can choose to cascade up later,
...@@ -3319,7 +3319,7 @@ interval_mul(PG_FUNCTION_ARGS) ...@@ -3319,7 +3319,7 @@ interval_mul(PG_FUNCTION_ARGS)
/* /*
* Fractional months full days into days. * Fractional months full days into days.
* *
* Floating point calculation are inherently inprecise, so these * Floating point calculation are inherently imprecise, so these
* calculations are crafted to produce the most reliable result possible. * calculations are crafted to produce the most reliable result possible.
* TSROUND() is needed to more accurately produce whole numbers where * TSROUND() is needed to more accurately produce whole numbers where
* appropriate. * appropriate.
......
...@@ -1634,7 +1634,7 @@ static struct config_bool ConfigureNamesBool[] = ...@@ -1634,7 +1634,7 @@ static struct config_bool ConfigureNamesBool[] =
{ {
{"syslog_sequence_numbers", PGC_SIGHUP, LOGGING_WHERE, {"syslog_sequence_numbers", PGC_SIGHUP, LOGGING_WHERE,
gettext_noop("Add sequence number to syslog messags to avoid duplicate suppression."), gettext_noop("Add sequence number to syslog messages to avoid duplicate suppression."),
NULL NULL
}, },
&syslog_sequence_numbers, &syslog_sequence_numbers,
...@@ -2681,7 +2681,7 @@ static struct config_int ConfigureNamesInt[] = ...@@ -2681,7 +2681,7 @@ static struct config_int ConfigureNamesInt[] =
{ {
{"ssl_renegotiation_limit", PGC_USERSET, CONN_AUTH_SECURITY, {"ssl_renegotiation_limit", PGC_USERSET, CONN_AUTH_SECURITY,
gettext_noop("SSL regenotiation is no longer supported; this can only be 0."), gettext_noop("SSL renegotiation is no longer supported; this can only be 0."),
NULL, NULL,
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE, GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE,
}, },
...@@ -4059,7 +4059,7 @@ get_guc_variables(void) ...@@ -4059,7 +4059,7 @@ get_guc_variables(void)
/* /*
* Build the sorted array. This is split out so that it could be * Build the sorted array. This is split out so that it could be
* re-executed after startup (eg, we could allow loadable modules to * re-executed after startup (e.g., we could allow loadable modules to
* add vars, and then we'd need to re-sort). * add vars, and then we'd need to re-sort).
*/ */
void void
...@@ -5904,7 +5904,7 @@ set_config_option(const char *name, const char *value, ...@@ -5904,7 +5904,7 @@ set_config_option(const char *name, const char *value,
* don't re-read the config file during backend start. * don't re-read the config file during backend start.
* *
* In EXEC_BACKEND builds, this works differently: we load all * In EXEC_BACKEND builds, this works differently: we load all
* nondefault settings from the CONFIG_EXEC_PARAMS file during * non-default settings from the CONFIG_EXEC_PARAMS file during
* backend start. In that case we must accept PGC_SIGHUP * backend start. In that case we must accept PGC_SIGHUP
* settings, so as to have the same value as if we'd forked * settings, so as to have the same value as if we'd forked
* from the postmaster. This can also happen when using * from the postmaster. This can also happen when using
...@@ -6663,7 +6663,7 @@ GetConfigOptionResetString(const char *name) ...@@ -6663,7 +6663,7 @@ GetConfigOptionResetString(const char *name)
* We need to be told the name of the variable the args are for, because * We need to be told the name of the variable the args are for, because
* the flattening rules vary (ugh). * the flattening rules vary (ugh).
* *
* The result is NULL if args is NIL (ie, SET ... TO DEFAULT), otherwise * The result is NULL if args is NIL (i.e., SET ... TO DEFAULT), otherwise
* a palloc'd string. * a palloc'd string.
*/ */
static char * static char *
...@@ -7994,7 +7994,7 @@ GetConfigOptionByNum(int varnum, const char **values, bool *noshow) ...@@ -7994,7 +7994,7 @@ GetConfigOptionByNum(int varnum, const char **values, bool *noshow)
/* source */ /* source */
values[8] = GucSource_Names[conf->source]; values[8] = GucSource_Names[conf->source];
/* now get the type specifc attributes */ /* now get the type specific attributes */
switch (conf->vartype) switch (conf->vartype)
{ {
case PGC_BOOL: case PGC_BOOL:
...@@ -9531,7 +9531,7 @@ validate_option_array_item(const char *name, const char *value, ...@@ -9531,7 +9531,7 @@ validate_option_array_item(const char *name, const char *value,
* There are three cases to consider: * There are three cases to consider:
* *
* name is a known GUC variable. Check the value normally, check * name is a known GUC variable. Check the value normally, check
* permissions normally (ie, allow if variable is USERSET, or if it's * permissions normally (i.e., allow if variable is USERSET, or if it's
* SUSET and user is superuser). * SUSET and user is superuser).
* *
* name is not known, but exists or can be created as a placeholder (i.e., * name is not known, but exists or can be created as a placeholder (i.e.,
......
...@@ -2742,7 +2742,7 @@ batchmemtuples(Tuplesortstate *state) ...@@ -2742,7 +2742,7 @@ batchmemtuples(Tuplesortstate *state)
/* /*
* Refund STANDARDCHUNKHEADERSIZE per tuple. * Refund STANDARDCHUNKHEADERSIZE per tuple.
* *
* This sometimes fails to make memory use prefectly balanced, but it * This sometimes fails to make memory use perfectly balanced, but it
* should never make the situation worse. Note that Assert-enabled builds * should never make the situation worse. Note that Assert-enabled builds
* get a larger refund, due to a varying STANDARDCHUNKHEADERSIZE. * get a larger refund, due to a varying STANDARDCHUNKHEADERSIZE.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment