summaryrefslogtreecommitdiff
path: root/src/backend/tsearch
diff options
context:
space:
mode:
authorTom Lane2017-06-21 19:18:54 +0000
committerTom Lane2017-06-21 19:19:25 +0000
commitc7b8998ebbf310a156aa38022555a24d98fdbfb4 (patch)
treee85979fb1213a731b7b557f8a830df541f26b135 /src/backend/tsearch
parentf669c09989bda894d6ba01634ccb229f0687c08a (diff)
Phase 2 of pgindent updates.
Change pg_bsd_indent to follow upstream rules for placement of comments to the right of code, and remove pgindent hack that caused comments following #endif to not obey the general rule. Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using the published version of pg_bsd_indent, but a hacked-up version that tried to minimize the amount of movement of comments to the right of code. The situation of interest is where such a comment has to be moved to the right of its default placement at column 33 because there's code there. BSD indent has always moved right in units of tab stops in such cases --- but in the previous incarnation, indent was working in 8-space tab stops, while now it knows we use 4-space tabs. So the net result is that in about half the cases, such comments are placed one tab stop left of before. This is better all around: it leaves more room on the line for comment text, and it means that in such cases the comment uniformly starts at the next 4-space tab stop after the code, rather than sometimes one and sometimes two tabs after. Also, ensure that comments following #endif are indented the same as comments following other preprocessor commands such as #else. That inconsistency turns out to have been self-inflicted damage from a poorly-thought-through post-indent "fixup" in pgindent. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
Diffstat (limited to 'src/backend/tsearch')
-rw-r--r--src/backend/tsearch/dict_thesaurus.c2
-rw-r--r--src/backend/tsearch/spell.c2
-rw-r--r--src/backend/tsearch/ts_locale.c14
-rw-r--r--src/backend/tsearch/ts_typanalyze.c2
-rw-r--r--src/backend/tsearch/wparser_def.c14
5 files changed, 17 insertions, 17 deletions
diff --git a/src/backend/tsearch/dict_thesaurus.c b/src/backend/tsearch/dict_thesaurus.c
index 9a01075d4e..ccf057b5d6 100644
--- a/src/backend/tsearch/dict_thesaurus.c
+++ b/src/backend/tsearch/dict_thesaurus.c
@@ -405,7 +405,7 @@ compileTheLexeme(DictThesaurus *d)
{
TSLexeme *ptr;
- if (strcmp(d->wrds[i].lexeme, "?") == 0) /* Is stop word marker? */
+ if (strcmp(d->wrds[i].lexeme, "?") == 0) /* Is stop word marker? */
newwrds = addCompiledLexeme(newwrds, &nnw, &tnm, NULL, d->wrds[i].entries, 0);
else
{
diff --git a/src/backend/tsearch/spell.c b/src/backend/tsearch/spell.c
index 817237ce4d..3bcc93fa1b 100644
--- a/src/backend/tsearch/spell.c
+++ b/src/backend/tsearch/spell.c
@@ -827,7 +827,7 @@ get_nextfield(char **str, char *next)
*next = '\0';
- return (state == PAE_INMASK); /* OK if we got a nonempty field */
+ return (state == PAE_INMASK); /* OK if we got a nonempty field */
}
/*
diff --git a/src/backend/tsearch/ts_locale.c b/src/backend/tsearch/ts_locale.c
index 19d2cc3f30..2cc084770d 100644
--- a/src/backend/tsearch/ts_locale.c
+++ b/src/backend/tsearch/ts_locale.c
@@ -28,7 +28,7 @@ t_isdigit(const char *ptr)
{
int clen = pg_mblen(ptr);
wchar_t character[2];
- Oid collation = DEFAULT_COLLATION_OID; /* TODO */
+ Oid collation = DEFAULT_COLLATION_OID; /* TODO */
pg_locale_t mylocale = 0; /* TODO */
if (clen == 1 || lc_ctype_is_c(collation))
@@ -44,7 +44,7 @@ t_isspace(const char *ptr)
{
int clen = pg_mblen(ptr);
wchar_t character[2];
- Oid collation = DEFAULT_COLLATION_OID; /* TODO */
+ Oid collation = DEFAULT_COLLATION_OID; /* TODO */
pg_locale_t mylocale = 0; /* TODO */
if (clen == 1 || lc_ctype_is_c(collation))
@@ -60,7 +60,7 @@ t_isalpha(const char *ptr)
{
int clen = pg_mblen(ptr);
wchar_t character[2];
- Oid collation = DEFAULT_COLLATION_OID; /* TODO */
+ Oid collation = DEFAULT_COLLATION_OID; /* TODO */
pg_locale_t mylocale = 0; /* TODO */
if (clen == 1 || lc_ctype_is_c(collation))
@@ -76,7 +76,7 @@ t_isprint(const char *ptr)
{
int clen = pg_mblen(ptr);
wchar_t character[2];
- Oid collation = DEFAULT_COLLATION_OID; /* TODO */
+ Oid collation = DEFAULT_COLLATION_OID; /* TODO */
pg_locale_t mylocale = 0; /* TODO */
if (clen == 1 || lc_ctype_is_c(collation))
@@ -86,7 +86,7 @@ t_isprint(const char *ptr)
return iswprint((wint_t) character[0]);
}
-#endif /* USE_WIDE_UPPER_LOWER */
+#endif /* USE_WIDE_UPPER_LOWER */
/*
@@ -246,7 +246,7 @@ lowerstr_with_len(const char *str, int len)
char *out;
#ifdef USE_WIDE_UPPER_LOWER
- Oid collation = DEFAULT_COLLATION_OID; /* TODO */
+ Oid collation = DEFAULT_COLLATION_OID; /* TODO */
pg_locale_t mylocale = 0; /* TODO */
#endif
@@ -300,7 +300,7 @@ lowerstr_with_len(const char *str, int len)
Assert(wlen < len);
}
else
-#endif /* USE_WIDE_UPPER_LOWER */
+#endif /* USE_WIDE_UPPER_LOWER */
{
const char *ptr = str;
char *outptr;
diff --git a/src/backend/tsearch/ts_typanalyze.c b/src/backend/tsearch/ts_typanalyze.c
index f4298ca9aa..975623fa96 100644
--- a/src/backend/tsearch/ts_typanalyze.c
+++ b/src/backend/tsearch/ts_typanalyze.c
@@ -423,7 +423,7 @@ compute_tsvector_stats(VacAttrStats *stats,
stats->stats_valid = true;
stats->stanullfrac = 1.0;
stats->stawidth = 0; /* "unknown" */
- stats->stadistinct = 0.0; /* "unknown" */
+ stats->stadistinct = 0.0; /* "unknown" */
}
/*
diff --git a/src/backend/tsearch/wparser_def.c b/src/backend/tsearch/wparser_def.c
index 0cfc6552d7..0ce2e00eb2 100644
--- a/src/backend/tsearch/wparser_def.c
+++ b/src/backend/tsearch/wparser_def.c
@@ -199,10 +199,10 @@ typedef enum
/* forward declaration */
struct TParser;
-typedef int (*TParserCharTest) (struct TParser *); /* any p_is* functions
- * except p_iseq */
-typedef void (*TParserSpecial) (struct TParser *); /* special handler for
- * special cases... */
+typedef int (*TParserCharTest) (struct TParser *); /* any p_is* functions
+ * except p_iseq */
+typedef void (*TParserSpecial) (struct TParser *); /* special handler for
+ * special cases... */
typedef struct
{
@@ -302,7 +302,7 @@ TParserInit(char *str, int len)
if (prs->charmaxlen > 1)
{
Oid collation = DEFAULT_COLLATION_OID; /* TODO */
- pg_locale_t mylocale = 0; /* TODO */
+ pg_locale_t mylocale = 0; /* TODO */
prs->usewide = true;
if (lc_ctype_is_c(collation))
@@ -560,7 +560,7 @@ p_iseq(TParser *prs, char c)
p_iswhat(alnum)
p_iswhat(alpha)
-#endif /* USE_WIDE_UPPER_LOWER */
+#endif /* USE_WIDE_UPPER_LOWER */
p_iswhat(digit)
p_iswhat(lower)
@@ -1697,7 +1697,7 @@ static const TParserStateActionItem actionTPS_InHyphenUnsignedInt[] = {
*/
typedef struct
{
- const TParserStateActionItem *action; /* the actual state info */
+ const TParserStateActionItem *action; /* the actual state info */
TParserState state; /* only for Assert crosscheck */
#ifdef WPARSER_TRACE
const char *state_name; /* only for debug printout */