From dacb886eb3af8815036b84afa31ea6ff85973a93 Mon Sep 17 00:00:00 2001 From: Vik Fearing Date: Wed, 5 Feb 2020 09:32:42 +0100 Subject: [PATCH] Don't declare variable in for loop. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Certain compilers complain about this; per report from rpm packager Devrim Gündüz. --- periods.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/periods.c b/periods.c index b079e4d..843b035 100644 --- a/periods.c +++ b/periods.c @@ -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;