Commit eaf0380e authored by Tom Lane's avatar Tom Lane

Fix C++ compile failures in headers.

Avoid using "typeid" as a parameter name in header files, since that
is a C++ keyword.  These cases were introduced recently, in 04fe805a
and 586b98fd.

Since I'm an incurable neatnik, also rename these parameters in the
underlying function definitions.  That's not really necessary per
project rules, but I don't like function declarations that don't
quite agree with the underlying definitions.

Per src/tools/pginclude/cpluspluscheck.
parent a968d54c
...@@ -2589,13 +2589,13 @@ record_plan_function_dependency(PlannerInfo *root, Oid funcid) ...@@ -2589,13 +2589,13 @@ record_plan_function_dependency(PlannerInfo *root, Oid funcid)
* someday fix_expr_common might call it. * someday fix_expr_common might call it.
*/ */
void void
record_plan_type_dependency(PlannerInfo *root, Oid typeid) record_plan_type_dependency(PlannerInfo *root, Oid typid)
{ {
/* /*
* As in record_plan_function_dependency, ignore the possibility that * As in record_plan_function_dependency, ignore the possibility that
* someone would change a built-in domain. * someone would change a built-in domain.
*/ */
if (typeid >= (Oid) FirstBootstrapObjectId) if (typid >= (Oid) FirstBootstrapObjectId)
{ {
PlanInvalItem *inval_item = makeNode(PlanInvalItem); PlanInvalItem *inval_item = makeNode(PlanInvalItem);
...@@ -2606,7 +2606,7 @@ record_plan_type_dependency(PlannerInfo *root, Oid typeid) ...@@ -2606,7 +2606,7 @@ record_plan_type_dependency(PlannerInfo *root, Oid typeid)
*/ */
inval_item->cacheId = TYPEOID; inval_item->cacheId = TYPEOID;
inval_item->hashValue = GetSysCacheHashValue1(TYPEOID, inval_item->hashValue = GetSysCacheHashValue1(TYPEOID,
ObjectIdGetDatum(typeid)); ObjectIdGetDatum(typid));
root->glob->invalItems = lappend(root->glob->invalItems, inval_item); root->glob->invalItems = lappend(root->glob->invalItems, inval_item);
} }
......
...@@ -69,7 +69,7 @@ typedef struct ...@@ -69,7 +69,7 @@ typedef struct
int last_returned; /* Last comparison result (cache) */ int last_returned; /* Last comparison result (cache) */
bool cache_blob; /* Does buf2 contain strxfrm() blob, etc? */ bool cache_blob; /* Does buf2 contain strxfrm() blob, etc? */
bool collate_c; bool collate_c;
Oid typeid; /* Actual datatype (text/bpchar/bytea/name) */ Oid typid; /* Actual datatype (text/bpchar/bytea/name) */
hyperLogLogState abbr_card; /* Abbreviated key cardinality state */ hyperLogLogState abbr_card; /* Abbreviated key cardinality state */
hyperLogLogState full_card; /* Full key cardinality state */ hyperLogLogState full_card; /* Full key cardinality state */
double prop_card; /* Required cardinality proportion */ double prop_card; /* Required cardinality proportion */
...@@ -1835,7 +1835,7 @@ bttextsortsupport(PG_FUNCTION_ARGS) ...@@ -1835,7 +1835,7 @@ bttextsortsupport(PG_FUNCTION_ARGS)
* this will not work with any other collation, though. * this will not work with any other collation, though.
*/ */
void void
varstr_sortsupport(SortSupport ssup, Oid typeid, Oid collid) varstr_sortsupport(SortSupport ssup, Oid typid, Oid collid)
{ {
bool abbreviate = ssup->abbreviate; bool abbreviate = ssup->abbreviate;
bool collate_c = false; bool collate_c = false;
...@@ -1857,9 +1857,9 @@ varstr_sortsupport(SortSupport ssup, Oid typeid, Oid collid) ...@@ -1857,9 +1857,9 @@ varstr_sortsupport(SortSupport ssup, Oid typeid, Oid collid)
*/ */
if (lc_collate_is_c(collid)) if (lc_collate_is_c(collid))
{ {
if (typeid == BPCHAROID) if (typid == BPCHAROID)
ssup->comparator = bpcharfastcmp_c; ssup->comparator = bpcharfastcmp_c;
else if (typeid == NAMEOID) else if (typid == NAMEOID)
{ {
ssup->comparator = namefastcmp_c; ssup->comparator = namefastcmp_c;
/* Not supporting abbreviation with type NAME, for now */ /* Not supporting abbreviation with type NAME, for now */
...@@ -1910,7 +1910,7 @@ varstr_sortsupport(SortSupport ssup, Oid typeid, Oid collid) ...@@ -1910,7 +1910,7 @@ varstr_sortsupport(SortSupport ssup, Oid typeid, Oid collid)
/* /*
* We use varlenafastcmp_locale except for type NAME. * We use varlenafastcmp_locale except for type NAME.
*/ */
if (typeid == NAMEOID) if (typid == NAMEOID)
{ {
ssup->comparator = namefastcmp_locale; ssup->comparator = namefastcmp_locale;
/* Not supporting abbreviation with type NAME, for now */ /* Not supporting abbreviation with type NAME, for now */
...@@ -1983,7 +1983,7 @@ varstr_sortsupport(SortSupport ssup, Oid typeid, Oid collid) ...@@ -1983,7 +1983,7 @@ varstr_sortsupport(SortSupport ssup, Oid typeid, Oid collid)
*/ */
sss->cache_blob = true; sss->cache_blob = true;
sss->collate_c = collate_c; sss->collate_c = collate_c;
sss->typeid = typeid; sss->typid = typid;
ssup->ssup_extra = sss; ssup->ssup_extra = sss;
/* /*
...@@ -2160,7 +2160,7 @@ varstrfastcmp_locale(char *a1p, int len1, char *a2p, int len2, SortSupport ssup) ...@@ -2160,7 +2160,7 @@ varstrfastcmp_locale(char *a1p, int len1, char *a2p, int len2, SortSupport ssup)
return 0; return 0;
} }
if (sss->typeid == BPCHAROID) if (sss->typid == BPCHAROID)
{ {
/* Get true number of bytes, ignoring trailing spaces */ /* Get true number of bytes, ignoring trailing spaces */
len1 = bpchartruelen(a1p, len1); len1 = bpchartruelen(a1p, len1);
...@@ -2333,7 +2333,7 @@ varstr_abbrev_convert(Datum original, SortSupport ssup) ...@@ -2333,7 +2333,7 @@ varstr_abbrev_convert(Datum original, SortSupport ssup)
len = VARSIZE_ANY_EXHDR(authoritative); len = VARSIZE_ANY_EXHDR(authoritative);
/* Get number of bytes, ignoring trailing spaces */ /* Get number of bytes, ignoring trailing spaces */
if (sss->typeid == BPCHAROID) if (sss->typid == BPCHAROID)
len = bpchartruelen(authoritative_data, len); len = bpchartruelen(authoritative_data, len);
/* /*
......
...@@ -118,7 +118,7 @@ extern bool innerrel_is_unique(PlannerInfo *root, ...@@ -118,7 +118,7 @@ extern bool innerrel_is_unique(PlannerInfo *root,
*/ */
extern Plan *set_plan_references(PlannerInfo *root, Plan *plan); extern Plan *set_plan_references(PlannerInfo *root, Plan *plan);
extern void record_plan_function_dependency(PlannerInfo *root, Oid funcid); extern void record_plan_function_dependency(PlannerInfo *root, Oid funcid);
extern void record_plan_type_dependency(PlannerInfo *root, Oid typeid); extern void record_plan_type_dependency(PlannerInfo *root, Oid typid);
extern void extract_query_dependencies(Node *query, extern void extract_query_dependencies(Node *query,
List **relationOids, List **relationOids,
List **invalItems, List **invalItems,
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include "utils/sortsupport.h" #include "utils/sortsupport.h"
extern int varstr_cmp(const char *arg1, int len1, const char *arg2, int len2, Oid collid); extern int varstr_cmp(const char *arg1, int len1, const char *arg2, int len2, Oid collid);
extern void varstr_sortsupport(SortSupport ssup, Oid typeid, Oid collid); extern void varstr_sortsupport(SortSupport ssup, Oid typid, Oid collid);
extern int varstr_levenshtein(const char *source, int slen, extern int varstr_levenshtein(const char *source, int slen,
const char *target, int tlen, const char *target, int tlen,
int ins_c, int del_c, int sub_c, int ins_c, int del_c, int sub_c,
......
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