Skip to content

Commit

Permalink
Don't declare variable in for loop.
Browse files Browse the repository at this point in the history
Certain compilers complain about this; per report from rpm packager
Devrim Gündüz.
Vik Fearing committed Feb 5, 2020
1 parent 90a80c3 commit dacb886
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions periods.c
Original file line number Diff line number Diff line change
@@ -138,6 +138,7 @@ static bool
OnlyExcludedColumnsChanged(Relation rel, HeapTuple old_row, HeapTuple new_row)
{
int ret;
int i;
Datum values[1];
TupleDesc tupdesc = RelationGetDescr(rel);
Bitmapset *excluded_attnums = NULL;
@@ -181,8 +182,9 @@ OnlyExcludedColumnsChanged(Relation rel, HeapTuple old_row, HeapTuple new_row)
{
TupleDesc spitupdesc = SPI_tuptable->tupdesc;
bool isnull;
int i;

for (int i = 0; i < SPI_processed; i++)
for (i = 0; i < SPI_processed; i++)
{
HeapTuple tuple = SPI_tuptable->vals[i];
Datum attdatum;
@@ -228,7 +230,7 @@ OnlyExcludedColumnsChanged(Relation rel, HeapTuple old_row, HeapTuple new_row)
if (excluded_attnums == NULL)
return false;

for (int i = 1; i <= tupdesc->natts; i++)
for (i = 1; i <= tupdesc->natts; i++)
{
Datum old_datum, new_datum;
bool old_isnull, new_isnull;

0 comments on commit dacb886

Please sign in to comment.