Skip to content

Commit c0dc166

Browse files
committed
Use better named loop variable for large loop, rather than 'i'.
1 parent 635d42e commit c0dc166

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

src/backend/tcop/postgres.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.494 2006/08/04 18:53:46 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.495 2006/08/06 02:00:52 momjian Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1364,7 +1364,6 @@ exec_bind_message(StringInfo input_message)
13641364
int numParams;
13651365
int numRFormats;
13661366
int16 *rformats = NULL;
1367-
int i;
13681367
PreparedStatement *pstmt;
13691368
Portal portal;
13701369
ParamListInfo params;
@@ -1391,6 +1390,8 @@ exec_bind_message(StringInfo input_message)
13911390
numPFormats = pq_getmsgint(input_message, 2);
13921391
if (numPFormats > 0)
13931392
{
1393+
int i;
1394+
13941395
pformats = (int16 *) palloc(numPFormats * sizeof(int16));
13951396
for (i = 0; i < numPFormats; i++)
13961397
pformats[i] = pq_getmsgint(input_message, 2);
@@ -1463,6 +1464,7 @@ exec_bind_message(StringInfo input_message)
14631464
{
14641465
ListCell *l;
14651466
MemoryContext oldContext;
1467+
int paramno;
14661468

14671469
oldContext = MemoryContextSwitchTo(PortalGetHeapMemory(portal));
14681470

@@ -1471,7 +1473,7 @@ exec_bind_message(StringInfo input_message)
14711473
(numParams - 1) * sizeof(ParamExternData));
14721474
params->numParams = numParams;
14731475

1474-
i = 0;
1476+
paramno = 0;
14751477
foreach(l, pstmt->argtype_list)
14761478
{
14771479
Oid ptype = lfirst_oid(l);
@@ -1511,7 +1513,7 @@ exec_bind_message(StringInfo input_message)
15111513
}
15121514

15131515
if (numPFormats > 1)
1514-
pformat = pformats[i];
1516+
pformat = pformats[paramno];
15151517
else if (numPFormats > 0)
15161518
pformat = pformats[0];
15171519
else
@@ -1534,7 +1536,7 @@ exec_bind_message(StringInfo input_message)
15341536
else
15351537
pstring = pg_client_to_server(pbuf.data, plength);
15361538

1537-
params->params[i].value = OidInputFunctionCall(typinput,
1539+
params->params[paramno].value = OidInputFunctionCall(typinput,
15381540
pstring,
15391541
typioparam,
15401542
-1);
@@ -1558,7 +1560,7 @@ exec_bind_message(StringInfo input_message)
15581560
else
15591561
bufptr = &pbuf;
15601562

1561-
params->params[i].value = OidReceiveFunctionCall(typreceive,
1563+
params->params[paramno].value = OidReceiveFunctionCall(typreceive,
15621564
bufptr,
15631565
typioparam,
15641566
-1);
@@ -1568,7 +1570,7 @@ exec_bind_message(StringInfo input_message)
15681570
ereport(ERROR,
15691571
(errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
15701572
errmsg("incorrect binary data format in bind parameter %d",
1571-
i + 1)));
1573+
paramno + 1)));
15721574
}
15731575
else
15741576
{
@@ -1582,10 +1584,10 @@ exec_bind_message(StringInfo input_message)
15821584
if (!isNull)
15831585
pbuf.data[plength] = csave;
15841586

1585-
params->params[i].isnull = isNull;
1586-
params->params[i].ptype = ptype;
1587+
params->params[paramno].isnull = isNull;
1588+
params->params[paramno].ptype = ptype;
15871589

1588-
i++;
1590+
paramno++;
15891591
}
15901592

15911593
MemoryContextSwitchTo(oldContext);
@@ -1597,6 +1599,8 @@ exec_bind_message(StringInfo input_message)
15971599
numRFormats = pq_getmsgint(input_message, 2);
15981600
if (numRFormats > 0)
15991601
{
1602+
int i;
1603+
16001604
rformats = (int16 *) palloc(numRFormats * sizeof(int16));
16011605
for (i = 0; i < numRFormats; i++)
16021606
rformats[i] = pq_getmsgint(input_message, 2);

0 commit comments

Comments
 (0)