@@ -1310,7 +1310,6 @@ exec_parse_message(const char *query_string, /* string to execute */
13101310 {
13111311 Query * query ;
13121312 bool snapshot_set = false;
1313- int i ;
13141313
13151314 raw_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 {
13711370 Oid ptype = paramTypes [i ];
13721371
@@ -1555,10 +1554,8 @@ exec_bind_message(StringInfo input_message)
15551554 numPFormats = pq_getmsgint (input_message , 2 );
15561555 if (numPFormats > 0 )
15571556 {
1558- int i ;
1559-
15601557 pformats = (int16 * ) palloc (numPFormats * sizeof (int16 ));
1561- for (i = 0 ; i < numPFormats ; i ++ )
1558+ for (int i = 0 ; i < numPFormats ; i ++ )
15621559 pformats [i ] = pq_getmsgint (input_message , 2 );
15631560 }
15641561
@@ -1641,8 +1638,6 @@ exec_bind_message(StringInfo input_message)
16411638 */
16421639 if (numParams > 0 )
16431640 {
1644- int paramno ;
1645-
16461641 params = (ParamListInfo ) palloc (offsetof(ParamListInfoData , params ) +
16471642 numParams * sizeof (ParamExternData ));
16481643 /* we have static list of params, so no hooks needed */
@@ -1654,7 +1649,7 @@ exec_bind_message(StringInfo input_message)
16541649 params -> parserSetupArg = NULL ;
16551650 params -> numParams = numParams ;
16561651
1657- for (paramno = 0 ; paramno < numParams ; paramno ++ )
1652+ for (int paramno = 0 ; paramno < numParams ; paramno ++ )
16581653 {
16591654 Oid ptype = psrc -> param_types [paramno ];
16601655 int32 plength ;
@@ -1782,10 +1777,8 @@ exec_bind_message(StringInfo input_message)
17821777 numRFormats = pq_getmsgint (input_message , 2 );
17831778 if (numRFormats > 0 )
17841779 {
1785- int i ;
1786-
17871780 rformats = (int16 * ) palloc (numRFormats * sizeof (int16 ));
1788- for (i = 0 ; i < numRFormats ; i ++ )
1781+ for (int i = 0 ; i < numRFormats ; i ++ )
17891782 rformats [i ] = pq_getmsgint (input_message , 2 );
17901783 }
17911784
@@ -2212,7 +2205,6 @@ errdetail_params(ParamListInfo params)
22122205 {
22132206 StringInfoData param_str ;
22142207 MemoryContext oldcontext ;
2215- int paramno ;
22162208
22172209 /* This code doesn't support dynamic param lists */
22182210 Assert (params -> paramFetch == NULL );
@@ -2222,7 +2214,7 @@ errdetail_params(ParamListInfo params)
22222214
22232215 initStringInfo (& param_str );
22242216
2225- for (paramno = 0 ; paramno < params -> numParams ; paramno ++ )
2217+ for (int paramno = 0 ; paramno < params -> numParams ; paramno ++ )
22262218 {
22272219 ParamExternData * prm = & params -> params [paramno ];
22282220 Oid typoutput ;
@@ -2325,7 +2317,6 @@ static void
23252317exec_describe_statement_message (const char * stmt_name )
23262318{
23272319 CachedPlanSource * 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 */
23852376 pq_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 {
23892380 Oid ptype = psrc -> param_types [i ];
23902381
@@ -4179,10 +4170,8 @@ PostgresMain(int argc, char *argv[],
41794170 numParams = pq_getmsgint (& input_message , 2 );
41804171 if (numParams > 0 )
41814172 {
4182- int i ;
4183-
41844173 paramTypes = (Oid * ) palloc (numParams * sizeof (Oid ));
4185- for (i = 0 ; i < numParams ; i ++ )
4174+ for (int i = 0 ; i < numParams ; i ++ )
41864175 paramTypes [i ] = pq_getmsgint (& input_message , 4 );
41874176 }
41884177 pq_getmsgend (& input_message );
0 commit comments