This patch adds proper prototypes to the walkers and mutators.
I changed the patch as Greg Stark suggested.
Kurt
Index: src/backend/catalog/dependency.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/catalog/dependency.c,v
retrieving revision 1.34
diff -u -b -r1.34 dependency.c
--- src/backend/catalog/dependency.c 29 Nov 2003 19:51:42 -0000 1.34
+++ src/backend/catalog/dependency.c 14 Dec 2003 15:56:35 -0000
@@ -108,8 +108,7 @@
ObjectAddresses *oktodelete,
Relation depRel);
static void doDeletion(const ObjectAddress *object);
-static bool find_expr_references_walker(Node *node,
- find_expr_references_context
*context);
+static bool find_expr_references_walker(Node *node, void *context);
static void eliminate_duplicate_dependencies(ObjectAddresses *addrs);
static int object_address_comparator(const void *a, const void *b);
static void init_object_addresses(ObjectAddresses *addrs);
@@ -973,9 +972,10 @@
* of the alias list when we find a reference to it.
*/
static bool
-find_expr_references_walker(Node *node,
- find_expr_references_context
*context)
+find_expr_references_walker(Node *node, void *vcontext)
{
+ find_expr_references_context *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Var))
Index: src/backend/commands/tablecmds.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/commands/tablecmds.c,v
retrieving revision 1.94
diff -u -b -r1.94 tablecmds.c
--- src/backend/commands/tablecmds.c 29 Nov 2003 19:51:47 -0000 1.94
+++ src/backend/commands/tablecmds.c 14 Dec 2003 15:56:37 -0000
@@ -77,7 +77,7 @@
static List *MergeAttributes(List *schema, List *supers, bool istemp,
List **supOids, List **supconstr, bool *supHasOids);
-static bool change_varattnos_of_a_node(Node *node, const AttrNumber *newattno);
+static bool change_varattnos_of_a_node(Node *node, AttrNumber *newattno);
static void StoreCatalogInheritance(Oid relationId, List *supers);
static int findAttrByName(const char *attributeName, List *schema);
static void setRelhassubclassInRelation(Oid relationId, bool relhassubclass);
@@ -833,8 +833,10 @@
* Note that the passed node tree is modified in place!
*/
static bool
-change_varattnos_walker(Node *node, const AttrNumber *newattno)
+change_varattnos_walker(Node *node, void *context)
{
+ const AttrNumber *newattno = context;
+
if (node == NULL)
return false;
if (IsA(node, Var))
@@ -855,11 +857,11 @@
return false;
}
return expression_tree_walker(node, change_varattnos_walker,
- (void *) newattno);
+ context);
}
static bool
-change_varattnos_of_a_node(Node *node, const AttrNumber *newattno)
+change_varattnos_of_a_node(Node *node, AttrNumber *newattno)
{
return change_varattnos_walker(node, newattno);
}
Index: src/backend/optimizer/path/costsize.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/optimizer/path/costsize.c,v
retrieving revision 1.117
diff -u -b -r1.117 costsize.c
--- src/backend/optimizer/path/costsize.c 3 Dec 2003 17:45:07 -0000 1.117
+++ src/backend/optimizer/path/costsize.c 14 Dec 2003 15:56:38 -0000
@@ -104,7 +104,7 @@
static Selectivity estimate_hash_bucketsize(Query *root, Var *var,
int nbuckets);
-static bool cost_qual_eval_walker(Node *node, QualCost *total);
+static bool cost_qual_eval_walker(Node *node, void *total);
static Selectivity approx_selectivity(Query *root, List *quals,
JoinType jointype);
static void set_rel_width(Query *root, RelOptInfo *rel);
@@ -1503,8 +1503,10 @@
}
static bool
-cost_qual_eval_walker(Node *node, QualCost *total)
+cost_qual_eval_walker(Node *node, void *context)
{
+ QualCost *total = context;
+
if (node == NULL)
return false;
Index: src/backend/optimizer/plan/setrefs.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/optimizer/plan/setrefs.c,v
retrieving revision 1.99
diff -u -b -r1.99 setrefs.c
--- src/backend/optimizer/plan/setrefs.c 29 Nov 2003 19:51:50 -0000 1.99
+++ src/backend/optimizer/plan/setrefs.c 14 Dec 2003 15:56:39 -0000
@@ -51,14 +51,12 @@
List *inner_tlist,
Index acceptable_rel,
bool tlists_have_non_vars);
-static Node *join_references_mutator(Node *node,
- join_references_context *context);
+static Node *join_references_mutator(Node *node, void *context);
static Node *replace_vars_with_subplan_refs(Node *node,
Index subvarno,
List *subplan_targetlist,
bool tlist_has_non_vars);
-static Node *replace_vars_with_subplan_refs_mutator(Node *node,
- replace_vars_with_subplan_refs_context
*context);
+static Node *replace_vars_with_subplan_refs_mutator(Node *node, void *context);
static bool fix_opfuncids_walker(Node *node, void *context);
static void set_sa_opfuncid(ScalarArrayOpExpr *opexpr);
@@ -533,9 +531,10 @@
}
static Node *
-join_references_mutator(Node *node,
- join_references_context *context)
+join_references_mutator(Node *node, void *vcontext)
{
+ join_references_context *context = vcontext;
+
if (node == NULL)
return NULL;
if (IsA(node, Var))
@@ -651,9 +650,10 @@
}
static Node *
-replace_vars_with_subplan_refs_mutator(Node *node,
-
replace_vars_with_subplan_refs_context *context)
+replace_vars_with_subplan_refs_mutator(Node *node, void *vcontext)
{
+ replace_vars_with_subplan_refs_context *context = vcontext;
+
if (node == NULL)
return NULL;
if (IsA(node, Var))
Index: src/backend/optimizer/plan/subselect.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/optimizer/plan/subselect.c,v
retrieving revision 1.86
diff -u -b -r1.86 subselect.c
--- src/backend/optimizer/plan/subselect.c 29 Nov 2003 19:51:50 -0000 1.86
+++ src/backend/optimizer/plan/subselect.c 14 Dec 2003 15:56:39 -0000
@@ -86,11 +86,11 @@
List **righthandIds);
static bool subplan_is_hashable(SubLink *slink, SubPlan *node);
static Node *replace_correlation_vars_mutator(Node *node, void *context);
-static Node *process_sublinks_mutator(Node *node, bool *isTopQual);
+static Node *process_sublinks_mutator(Node *node, void *isTopQual);
static Bitmapset *finalize_plan(Plan *plan, List *rtable,
Bitmapset *outer_params,
Bitmapset *valid_params);
-static bool finalize_primnode(Node *node, finalize_primnode_context *context);
+static bool finalize_primnode(Node *node, void *context);
/*
@@ -814,8 +814,9 @@
}
static Node *
-process_sublinks_mutator(Node *node, bool *isTopQual)
+process_sublinks_mutator(Node *node, void *context)
{
+ bool *isTopQual = context;
bool locTopQual;
if (node == NULL)
@@ -1078,8 +1079,10 @@
* expression tree to the result set.
*/
static bool
-finalize_primnode(Node *node, finalize_primnode_context *context)
+finalize_primnode(Node *node, void *vcontext)
{
+ finalize_primnode_context *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Param))
Index: src/backend/optimizer/prep/prepunion.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/optimizer/prep/prepunion.c,v
retrieving revision 1.105
diff -u -b -r1.105 prepunion.c
--- src/backend/optimizer/prep/prepunion.c 29 Nov 2003 19:51:51 -0000 1.105
+++ src/backend/optimizer/prep/prepunion.c 14 Dec 2003 15:56:40 -0000
@@ -61,8 +61,7 @@
List *input_plans,
List *refnames_tlist);
static bool tlist_same_datatypes(List *tlist, List *colTypes, bool junkOK);
-static Node *adjust_inherited_attrs_mutator(Node *node,
-
adjust_inherited_attrs_context *context);
+static Node *adjust_inherited_attrs_mutator(Node *node, void *context);
static Relids adjust_relid_set(Relids relids, Index oldrelid, Index newrelid);
static List *adjust_inherited_tlist(List *tlist, Oid old_relid, Oid new_relid);
@@ -797,9 +796,10 @@
}
static Node *
-adjust_inherited_attrs_mutator(Node *node,
-
adjust_inherited_attrs_context *context)
+adjust_inherited_attrs_mutator(Node *node, void *vcontext)
{
+ adjust_inherited_attrs_context *context = vcontext;
+
if (node == NULL)
return NULL;
if (IsA(node, Var))
Index: src/backend/optimizer/util/clauses.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/optimizer/util/clauses.c,v
retrieving revision 1.156
diff -u -b -r1.156 clauses.c
--- src/backend/optimizer/util/clauses.c 9 Dec 2003 01:56:20 -0000 1.156
+++ src/backend/optimizer/util/clauses.c 14 Dec 2003 15:56:41 -0000
@@ -54,13 +54,13 @@
static bool contain_agg_clause_walker(Node *node, void *context);
static bool contain_distinct_agg_clause_walker(Node *node, void *context);
-static bool count_agg_clause_walker(Node *node, int *count);
+static bool count_agg_clause_walker(Node *node, void *count);
static bool expression_returns_set_walker(Node *node, void *context);
static bool contain_subplans_walker(Node *node, void *context);
static bool contain_mutable_functions_walker(Node *node, void *context);
static bool contain_volatile_functions_walker(Node *node, void *context);
static bool contain_nonstrict_functions_walker(Node *node, void *context);
-static Node *eval_const_expressions_mutator(Node *node, List *active_fns);
+static Node *eval_const_expressions_mutator(Node *node, void *active_fns);
static Expr *simplify_function(Oid funcid, Oid result_type, List *args,
bool allow_inline, List *active_fns);
static Expr *evaluate_function(Oid funcid, Oid result_type, List *args,
@@ -69,8 +69,7 @@
HeapTuple func_tuple, List *active_fns);
static Node *substitute_actual_parameters(Node *expr, int nargs, List *args,
int *usecounts);
-static Node *substitute_actual_parameters_mutator(Node *node,
- substitute_actual_parameters_context
*context);
+static Node *substitute_actual_parameters_mutator(Node *node, void *context);
static void sql_inline_error_callback(void *arg);
static Expr *evaluate_expr(Expr *expr, Oid result_type);
@@ -392,8 +391,10 @@
}
static bool
-count_agg_clause_walker(Node *node, int *count)
+count_agg_clause_walker(Node *node, void *context)
{
+ int *count = context;
+
if (node == NULL)
return false;
if (IsA(node, Aggref))
@@ -1043,8 +1044,10 @@
}
static Node *
-eval_const_expressions_mutator(Node *node, List *active_fns)
+eval_const_expressions_mutator(Node *node, void *context)
{
+ List *active_fns = context;
+
if (node == NULL)
return NULL;
if (IsA(node, FuncExpr))
@@ -2001,9 +2004,10 @@
}
static Node *
-substitute_actual_parameters_mutator(Node *node,
-
substitute_actual_parameters_context *context)
+substitute_actual_parameters_mutator(Node *node, void *vcontext)
{
+ substitute_actual_parameters_context *context = vcontext;
+
if (node == NULL)
return NULL;
if (IsA(node, Param))
@@ -2197,8 +2201,7 @@
*/
bool
-expression_tree_walker(Node *node,
- bool (*walker) (),
+expression_tree_walker(Node *node, bool (*walker) (Node *node, void *context),
void *context)
{
List *temp;
@@ -2224,7 +2227,8 @@
/* primitive node types with no subnodes */
break;
case T_Aggref:
- return walker(((Aggref *) node)->target, context);
+ return walker((Node *)((Aggref *) node)->target,
+ context);
case T_ArrayRef:
{
ArrayRef *aref = (ArrayRef *) node;
@@ -2237,9 +2241,9 @@
walker, context))
return true;
/* walker must see the refexpr and refassgnexpr,
however */
- if (walker(aref->refexpr, context))
+ if (walker((Node *)aref->refexpr, context))
return true;
- if (walker(aref->refassgnexpr, context))
+ if (walker((Node *)aref->refassgnexpr, context))
return true;
}
break;
@@ -2318,9 +2322,11 @@
}
break;
case T_FieldSelect:
- return walker(((FieldSelect *) node)->arg, context);
+ return walker((Node *)((FieldSelect *) node)->arg,
+ context);
case T_RelabelType:
- return walker(((RelabelType *) node)->arg, context);
+ return walker((Node *)((RelabelType *) node)->arg,
+ context);
case T_CaseExpr:
{
CaseExpr *caseexpr = (CaseExpr *) node;
@@ -2331,32 +2337,41 @@
CaseWhen *when = (CaseWhen *) lfirst(temp);
Assert(IsA(when, CaseWhen));
- if (walker(when->expr, context))
+ if (walker((Node *)when->expr, context))
return true;
- if (walker(when->result, context))
+ if (walker((Node *)when->result,
+ context))
return true;
}
/* caseexpr->arg should be null, but we'll check it
anyway */
- if (walker(caseexpr->arg, context))
+ if (walker((Node *)caseexpr->arg, context))
return true;
- if (walker(caseexpr->defresult, context))
+ if (walker((Node *)caseexpr->defresult,
+ context))
return true;
}
break;
case T_ArrayExpr:
- return walker(((ArrayExpr *) node)->elements, context);
+ return walker((Node *)((ArrayExpr *) node)->elements,
+ context);
case T_CoalesceExpr:
- return walker(((CoalesceExpr *) node)->args, context);
+ return walker((Node *)((CoalesceExpr *) node)->args,
+ context);
case T_NullIfExpr:
- return walker(((NullIfExpr *) node)->args, context);
+ return walker((Node *)((NullIfExpr *) node)->args,
+ context);
case T_NullTest:
- return walker(((NullTest *) node)->arg, context);
+ return walker((Node *)((NullTest *) node)->arg,
+ context);
case T_BooleanTest:
- return walker(((BooleanTest *) node)->arg, context);
+ return walker((Node *)((BooleanTest *) node)->arg,
+ context);
case T_CoerceToDomain:
- return walker(((CoerceToDomain *) node)->arg, context);
+ return walker((Node *)((CoerceToDomain *) node)->arg,
+ context);
case T_TargetEntry:
- return walker(((TargetEntry *) node)->expr, context);
+ return walker((Node *)((TargetEntry *) node)->expr,
+ context);
case T_Query:
/* Do nothing with a sub-Query, per discussion above */
break;
@@ -2371,7 +2386,7 @@
{
FromExpr *from = (FromExpr *) node;
- if (walker(from->fromlist, context))
+ if (walker((Node *)from->fromlist, context))
return true;
if (walker(from->quals, context))
return true;
@@ -2446,10 +2461,8 @@
* indicated items. (More flag bits may be added as needed.)
*/
bool
-query_tree_walker(Query *query,
- bool (*walker) (),
- void *context,
- int flags)
+query_tree_walker(Query *query, bool (*walker) (Node *node, void *context),
+ void *context, int flags)
{
List *rt;
@@ -2467,7 +2480,7 @@
return true;
if (walker(query->limitCount, context))
return true;
- if (walker(query->in_info_list, context))
+ if (walker((Node *)query->in_info_list, context))
return true;
foreach(rt, query->rtable)
{
@@ -2481,12 +2494,14 @@
break;
case RTE_SUBQUERY:
if (!(flags & QTW_IGNORE_RT_SUBQUERIES))
- if (walker(rte->subquery, context))
+ if (walker((Node *)rte->subquery,
+ context))
return true;
break;
case RTE_JOIN:
if (!(flags & QTW_IGNORE_JOINALIASES))
- if (walker(rte->joinaliasvars, context))
+ if (walker((Node *)rte->joinaliasvars,
+ context))
return true;
break;
case RTE_FUNCTION:
@@ -2564,8 +2579,7 @@
Node *
expression_tree_mutator(Node *node,
- Node *(*mutator) (),
- void *context)
+ Node *(*mutator) (Node *node, void *context), void *context)
{
/*
* The mutator has already decided not to modify the current node, but
@@ -2929,10 +2943,8 @@
* modified substructure is safely copied in any case.
*/
Query *
-query_tree_mutator(Query *query,
- Node *(*mutator) (),
- void *context,
- int flags)
+query_tree_mutator(Query *query, Node *(*mutator) (Node *node, void *context),
+ void *context, int flags)
{
FastList newrt;
List *rt;
@@ -3000,9 +3012,7 @@
*/
bool
query_or_expression_tree_walker(Node *node,
- bool (*walker) (),
- void *context,
- int flags)
+ bool (*walker) (Node *node, void *context), void *context, int flags)
{
if (node && IsA(node, Query))
return query_tree_walker((Query *) node,
@@ -3023,9 +3033,7 @@
*/
Node *
query_or_expression_tree_mutator(Node *node,
- Node *(*mutator) (),
- void *context,
- int flags)
+ Node *(*mutator) (Node *node, void *context), void *context, int flags)
{
if (node && IsA(node, Query))
return (Node *) query_tree_mutator((Query *) node,
Index: src/backend/optimizer/util/var.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/optimizer/util/var.c,v
retrieving revision 1.55
diff -u -b -r1.55 var.c
--- src/backend/optimizer/util/var.c 29 Nov 2003 19:51:51 -0000 1.55
+++ src/backend/optimizer/util/var.c 14 Dec 2003 15:56:42 -0000
@@ -53,19 +53,14 @@
int sublevels_up;
} flatten_join_alias_vars_context;
-static bool pull_varnos_walker(Node *node,
- pull_varnos_context *context);
-static bool contain_var_reference_walker(Node *node,
- contain_var_reference_context
*context);
+static bool pull_varnos_walker(Node *node, void *context);
+static bool contain_var_reference_walker(Node *node, void *context);
static bool contain_var_clause_walker(Node *node, void *context);
-static bool contain_vars_of_level_walker(Node *node, int *sublevels_up);
-static bool contain_vars_above_level_walker(Node *node, int *sublevels_up);
-static bool find_minimum_var_level_walker(Node *node,
-
find_minimum_var_level_context *context);
-static bool pull_var_clause_walker(Node *node,
- pull_var_clause_context *context);
-static Node *flatten_join_alias_vars_mutator(Node *node,
-
flatten_join_alias_vars_context *context);
+static bool contain_vars_of_level_walker(Node *node, void *sublevels_up);
+static bool contain_vars_above_level_walker(Node *node, void *sublevels_up);
+static bool find_minimum_var_level_walker(Node *node, void *context);
+static bool pull_var_clause_walker(Node *node, void *context);
+static Node *flatten_join_alias_vars_mutator(Node *node, void *context);
static Relids alias_relid_set(Query *root, Relids relids);
@@ -100,8 +95,10 @@
}
static bool
-pull_varnos_walker(Node *node, pull_varnos_context *context)
+pull_varnos_walker(Node *node, void *vcontext)
{
+ pull_varnos_context *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Var))
@@ -159,9 +156,10 @@
}
static bool
-contain_var_reference_walker(Node *node,
- contain_var_reference_context
*context)
+contain_var_reference_walker(Node *node, void *vcontext)
{
+ contain_var_reference_context *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Var))
@@ -256,8 +254,10 @@
}
static bool
-contain_vars_of_level_walker(Node *node, int *sublevels_up)
+contain_vars_of_level_walker(Node *node, void *context)
{
+ int *sublevels_up = context;
+
if (node == NULL)
return false;
if (IsA(node, Var))
@@ -305,8 +305,10 @@
}
static bool
-contain_vars_above_level_walker(Node *node, int *sublevels_up)
+contain_vars_above_level_walker(Node *node, void *context)
{
+ int *sublevels_up = context;
+
if (node == NULL)
return false;
if (IsA(node, Var))
@@ -363,9 +365,10 @@
}
static bool
-find_minimum_var_level_walker(Node *node,
-
find_minimum_var_level_context *context)
+find_minimum_var_level_walker(Node *node, void *vcontext)
{
+ find_minimum_var_level_context *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Var))
@@ -467,8 +470,10 @@
}
static bool
-pull_var_clause_walker(Node *node, pull_var_clause_context *context)
+pull_var_clause_walker(Node *node, void *vcontext)
{
+ pull_var_clause_context *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Var))
@@ -503,9 +508,10 @@
}
static Node *
-flatten_join_alias_vars_mutator(Node *node,
-
flatten_join_alias_vars_context *context)
+flatten_join_alias_vars_mutator(Node *node, void *vcontext)
{
+ flatten_join_alias_vars_context *context = vcontext;
+
if (node == NULL)
return NULL;
if (IsA(node, Var))
Index: src/backend/parser/analyze.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/parser/analyze.c,v
retrieving revision 1.292
diff -u -b -r1.292 analyze.c
--- src/backend/parser/analyze.c 29 Nov 2003 19:51:51 -0000 1.292
+++ src/backend/parser/analyze.c 14 Dec 2003 15:56:51 -0000
@@ -134,8 +134,7 @@
static bool relationHasPrimaryKey(Oid relationOid);
static void release_pstate_resources(ParseState *pstate);
static FromExpr *makeFromExpr(List *fromlist, Node *quals);
-static bool check_parameter_resolution_walker(Node *node,
-
check_parameter_resolution_context *context);
+static bool check_parameter_resolution_walker(Node *node, void *context);
/*
@@ -3239,9 +3238,10 @@
* and yet other instances seen later might have gotten coerced.
*/
static bool
-check_parameter_resolution_walker(Node *node,
-
check_parameter_resolution_context *context)
+check_parameter_resolution_walker(Node *node, void *vcontext)
{
+ check_parameter_resolution_context *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Param))
Index: src/backend/parser/parse_agg.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/parser/parse_agg.c,v
retrieving revision 1.60
diff -u -b -r1.60 parse_agg.c
--- src/backend/parser/parse_agg.c 29 Nov 2003 19:51:51 -0000 1.60
+++ src/backend/parser/parse_agg.c 14 Dec 2003 15:56:51 -0000
@@ -35,8 +35,7 @@
static void check_ungrouped_columns(Node *node, ParseState *pstate,
List *groupClauses, bool
have_non_var_grouping);
-static bool check_ungrouped_columns_walker(Node *node,
-
check_ungrouped_columns_context *context);
+static bool check_ungrouped_columns_walker(Node *node, void *context);
/*
@@ -222,9 +221,10 @@
}
static bool
-check_ungrouped_columns_walker(Node *node,
-
check_ungrouped_columns_context *context)
+check_ungrouped_columns_walker(Node *node, void *vcontext)
{
+ check_ungrouped_columns_context *context = vcontext;
+
List *gl;
if (node == NULL)
Index: src/backend/rewrite/rewriteDefine.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/rewrite/rewriteDefine.c,v
retrieving revision 1.91
diff -u -b -r1.91 rewriteDefine.c
--- src/backend/rewrite/rewriteDefine.c 29 Nov 2003 19:51:55 -0000 1.91
+++ src/backend/rewrite/rewriteDefine.c 14 Dec 2003 15:56:51 -0000
@@ -34,7 +34,7 @@
static void setRuleCheckAsUser(Query *qry, AclId userid);
-static bool setRuleCheckAsUser_walker(Node *node, Oid *context);
+static bool setRuleCheckAsUser_walker(Node *node, void *context);
/*
@@ -528,8 +528,10 @@
* Expression-tree walker to find sublink queries
*/
static bool
-setRuleCheckAsUser_walker(Node *node, Oid *context)
+setRuleCheckAsUser_walker(Node *node, void *vcontext)
{
+ Oid *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Query))
Index: src/backend/rewrite/rewriteHandler.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/rewrite/rewriteHandler.c,v
retrieving revision 1.131
diff -u -b -r1.131 rewriteHandler.c
--- src/backend/rewrite/rewriteHandler.c 29 Nov 2003 19:51:55 -0000 1.131
+++ src/backend/rewrite/rewriteHandler.c 14 Dec 2003 15:56:51 -0000
@@ -740,7 +740,7 @@
* the SubLink's subselect link with the possibly-rewritten subquery.
*/
static bool
-fireRIRonSubLink(Node *node, List *activeRIRs)
+fireRIRonSubLink(Node *node, void *activeRIRs)
{
if (node == NULL)
return false;
Index: src/backend/rewrite/rewriteManip.c
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/backend/rewrite/rewriteManip.c,v
retrieving revision 1.81
diff -u -b -r1.81 rewriteManip.c
--- src/backend/rewrite/rewriteManip.c 29 Nov 2003 19:51:55 -0000 1.81
+++ src/backend/rewrite/rewriteManip.c 14 Dec 2003 15:56:51 -0000
@@ -27,8 +27,7 @@
int sublevels_up;
} checkExprHasAggs_context;
-static bool checkExprHasAggs_walker(Node *node,
- checkExprHasAggs_context *context);
+static bool checkExprHasAggs_walker(Node *node, void *context);
static bool checkExprHasSubLink_walker(Node *node, void *context);
static Relids offset_relid_set(Relids relids, int offset);
static Relids adjust_relid_set(Relids relids, int oldrelid, int newrelid);
@@ -63,8 +62,10 @@
}
static bool
-checkExprHasAggs_walker(Node *node, checkExprHasAggs_context *context)
+checkExprHasAggs_walker(Node *node, void *vcontext)
{
+ checkExprHasAggs_context *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Aggref))
@@ -140,8 +141,10 @@
} OffsetVarNodes_context;
static bool
-OffsetVarNodes_walker(Node *node, OffsetVarNodes_context *context)
+OffsetVarNodes_walker(Node *node, void *vcontext)
{
+ OffsetVarNodes_context *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Var))
@@ -274,8 +277,10 @@
} ChangeVarNodes_context;
static bool
-ChangeVarNodes_walker(Node *node, ChangeVarNodes_context *context)
+ChangeVarNodes_walker(Node *node, void *vcontext)
{
+ ChangeVarNodes_context *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Var))
@@ -425,9 +430,10 @@
} IncrementVarSublevelsUp_context;
static bool
-IncrementVarSublevelsUp_walker(Node *node,
-
IncrementVarSublevelsUp_context *context)
+IncrementVarSublevelsUp_walker(Node *node, void *vcontext)
{
+ IncrementVarSublevelsUp_context *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Var))
@@ -494,9 +500,10 @@
} rangeTableEntry_used_context;
static bool
-rangeTableEntry_used_walker(Node *node,
- rangeTableEntry_used_context
*context)
+rangeTableEntry_used_walker(Node *node, void *vcontext)
{
+ rangeTableEntry_used_context *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Var))
@@ -585,9 +592,10 @@
} attribute_used_context;
static bool
-attribute_used_walker(Node *node,
- attribute_used_context *context)
+attribute_used_walker(Node *node, void *vcontext)
{
+ attribute_used_context *context = vcontext;
+
if (node == NULL)
return false;
if (IsA(node, Var))
@@ -868,8 +876,10 @@
} ResolveNew_context;
static Node *
-ResolveNew_mutator(Node *node, ResolveNew_context *context)
+ResolveNew_mutator(Node *node, void *vcontext)
{
+ ResolveNew_context *context = vcontext;
+
if (node == NULL)
return NULL;
if (IsA(node, Var))
Index: src/include/optimizer/clauses.h
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/include/optimizer/clauses.h,v
retrieving revision 1.69
diff -u -b -r1.69 clauses.h
--- src/include/optimizer/clauses.h 29 Nov 2003 22:41:07 -0000 1.69
+++ src/include/optimizer/clauses.h 14 Dec 2003 15:56:54 -0000
@@ -64,24 +64,27 @@
extern Node *eval_const_expressions(Node *node);
-extern bool expression_tree_walker(Node *node, bool (*walker) (),
-
void *context);
-extern Node *expression_tree_mutator(Node *node, Node *(*mutator) (),
-
void *context);
+extern bool expression_tree_walker(Node *node,
+ bool (*walker) (Node *node, void *context), void *context);
+extern Node *expression_tree_mutator(Node *node,
+ Node *(*mutator) (Node *node, void *context), void *context);
/* flags bits for query_tree_walker and query_tree_mutator */
#define QTW_IGNORE_RT_SUBQUERIES 0x01 /* subqueries in rtable */
#define QTW_IGNORE_JOINALIASES 0x02 /* JOIN alias var lists */
#define QTW_DONT_COPY_QUERY 0x04 /* do not copy top
Query */
-extern bool query_tree_walker(Query *query, bool (*walker) (),
+extern bool query_tree_walker(Query *query,
+ bool (*walker) (Node *node, void *context),
void
*context, int flags);
-extern Query *query_tree_mutator(Query *query, Node *(*mutator) (),
+extern Query *query_tree_mutator(Query *query,
+ Node *(*mutator) (Node *node, void *context),
void *context, int flags);
-
-extern bool query_or_expression_tree_walker(Node *node, bool (*walker) (),
+extern bool query_or_expression_tree_walker(Node *node,
+ bool (*walker) (Node *node, void *context),
void *context, int flags);
-extern Node *query_or_expression_tree_mutator(Node *node, Node *(*mutator) (),
+extern Node *query_or_expression_tree_mutator(Node *node,
+ Node *(*mutator) (Node *node, void *context),
void *context, int flags);
#endif /* CLAUSES_H */
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly