From: Gurjeet Singh Date: Tue, 1 Jun 2010 21:55:50 +0000 (+0530) Subject: Get rid of some compile-time warnings; one still remains; added that to TODO list. X-Git-Url: http://git.postgresql.org/gitweb/%7B?a=commitdiff_plain;h=1a65ad111ceb9276e50c35160916c5248fbf099b;p=pg_adviser.git Get rid of some compile-time warnings; one still remains; added that to TODO list. --- diff --git a/index_adviser/TODO.txt b/index_adviser/TODO.txt index 401ba5e..a2bc345 100644 --- a/index_adviser/TODO.txt +++ b/index_adviser/TODO.txt @@ -1,6 +1,10 @@ TODO: ===== + +.) Get rid of the following warning: +index_adviser.c:920: warning: ‘resetSecondaryHooks’ was used with no prototype before its definition + .) Remove the newly added parameter to DefineIndex(); Done. .) Remove the newly added member to IndexInfo{}; Done. .) Remove the newly added member to IndexStmt{}; Done. diff --git a/index_adviser/index_adviser.c b/index_adviser/index_adviser.c index aa0c062..7951898 100644 --- a/index_adviser/index_adviser.c +++ b/index_adviser/index_adviser.c @@ -1350,8 +1350,10 @@ mark_used_candidates(const Node* const node, List* const candidates) case T_OpExpr: { - planNode = false; const OpExpr* const expr = (const OpExpr*)node; + + planNode = false; + foreach( cell, expr->args ) mark_used_candidates( (const Node*)lfirst( cell ), candidates ); } @@ -1360,17 +1362,20 @@ mark_used_candidates(const Node* const node, List* const candidates) case T_SubPlan: { /* scan the subplan */ - planNode = false; const SubPlan* const subPlan = (const SubPlan*)node; + planNode = false; + mark_used_candidates( (const Node*)&plannedStmtGlobal->subplans[subPlan->plan_id], candidates ); } break; case T_BoolExpr: { - planNode = false; const BoolExpr* const expr = (const BoolExpr*)node; + + planNode = false; + foreach( cell, expr->args ) { const Node* const nodeBool = (const Node*)lfirst( cell ); @@ -2026,6 +2031,8 @@ build_composite_candidates( List* list1, List* list2 ) */ if( !foundCommon ) { + signed int cmp; + /* composite candidate 1 is a combination of * candidates 1,2 AND * composite candidate 2 is a combination of @@ -2090,7 +2097,7 @@ build_composite_candidates( List* list1, List* list2 ) } /* add new composite candidates to list */ - signed int cmp = compare_candidates(cic1, cic2); + cmp = compare_candidates(cic1, cic2); if( cmp == 0 ) {