@@ -1310,7 +1310,6 @@ exec_parse_message(const char *query_string,/* string to execute */
13101310{
13111311Query * query ;
13121312bool snapshot_set = false;
1313- int i ;
13141313
13151314raw_parse_tree = linitial_node (RawStmt ,parsetree_list );
13161315
@@ -1366,7 +1365,7 @@ exec_parse_message(const char *query_string,/* string to execute */
13661365/*
13671366 * Check all parameter types got determined.
13681367 */
1369- for (i = 0 ;i < numParams ;i ++ )
1368+ for (int i = 0 ;i < numParams ;i ++ )
13701369{
13711370Oid ptype = paramTypes [i ];
13721371
@@ -1555,10 +1554,8 @@ exec_bind_message(StringInfo input_message)
15551554numPFormats = pq_getmsgint (input_message ,2 );
15561555if (numPFormats > 0 )
15571556{
1558- int i ;
1559-
15601557pformats = (int16 * )palloc (numPFormats * sizeof (int16 ));
1561- for (i = 0 ;i < numPFormats ;i ++ )
1558+ for (int i = 0 ;i < numPFormats ;i ++ )
15621559pformats [i ]= pq_getmsgint (input_message ,2 );
15631560}
15641561
@@ -1641,8 +1638,6 @@ exec_bind_message(StringInfo input_message)
16411638 */
16421639if (numParams > 0 )
16431640{
1644- int paramno ;
1645-
16461641params = (ParamListInfo )palloc (offsetof(ParamListInfoData ,params )+
16471642numParams * sizeof (ParamExternData ));
16481643/* we have static list of params, so no hooks needed */
@@ -1654,7 +1649,7 @@ exec_bind_message(StringInfo input_message)
16541649params -> parserSetupArg = NULL ;
16551650params -> numParams = numParams ;
16561651
1657- for (paramno = 0 ;paramno < numParams ;paramno ++ )
1652+ for (int paramno = 0 ;paramno < numParams ;paramno ++ )
16581653{
16591654Oid ptype = psrc -> param_types [paramno ];
16601655int32 plength ;
@@ -1782,10 +1777,8 @@ exec_bind_message(StringInfo input_message)
17821777numRFormats = pq_getmsgint (input_message ,2 );
17831778if (numRFormats > 0 )
17841779{
1785- int i ;
1786-
17871780rformats = (int16 * )palloc (numRFormats * sizeof (int16 ));
1788- for (i = 0 ;i < numRFormats ;i ++ )
1781+ for (int i = 0 ;i < numRFormats ;i ++ )
17891782rformats [i ]= pq_getmsgint (input_message ,2 );
17901783}
17911784
@@ -2212,7 +2205,6 @@ errdetail_params(ParamListInfo params)
22122205{
22132206StringInfoData param_str ;
22142207MemoryContext oldcontext ;
2215- int paramno ;
22162208
22172209/* This code doesn't support dynamic param lists */
22182210Assert (params -> paramFetch == NULL );
@@ -2222,7 +2214,7 @@ errdetail_params(ParamListInfo params)
22222214
22232215initStringInfo (& param_str );
22242216
2225- for (paramno = 0 ;paramno < params -> numParams ;paramno ++ )
2217+ for (int paramno = 0 ;paramno < params -> numParams ;paramno ++ )
22262218{
22272219ParamExternData * prm = & params -> params [paramno ];
22282220Oid typoutput ;
@@ -2325,7 +2317,6 @@ static void
23252317exec_describe_statement_message (const char * stmt_name )
23262318{
23272319CachedPlanSource * psrc ;
2328- int i ;
23292320
23302321/*
23312322 * Start up a transaction command. (Note that this will normally change
@@ -2384,7 +2375,7 @@ exec_describe_statement_message(const char *stmt_name)
23842375 * message type */
23852376pq_sendint16 (& row_description_buf ,psrc -> num_params );
23862377
2387- for (i = 0 ;i < psrc -> num_params ;i ++ )
2378+ for (int i = 0 ;i < psrc -> num_params ;i ++ )
23882379{
23892380Oid ptype = psrc -> param_types [i ];
23902381
@@ -4179,10 +4170,8 @@ PostgresMain(int argc, char *argv[],
41794170numParams = pq_getmsgint (& input_message ,2 );
41804171if (numParams > 0 )
41814172{
4182- int i ;
4183-
41844173paramTypes = (Oid * )palloc (numParams * sizeof (Oid ));
4185- for (i = 0 ;i < numParams ;i ++ )
4174+ for (int i = 0 ;i < numParams ;i ++ )
41864175paramTypes [i ]= pq_getmsgint (& input_message ,4 );
41874176}
41884177pq_getmsgend (& input_message );