From 8f57a003b7a5f1c3c4ed79bd81465ea7bcfd6944 Mon Sep 17 00:00:00 2001 From: seleznevae Date: Mon, 30 Nov 2020 20:23:43 +0300 Subject: [PATCH] [F] Fix compilation for old C compilers --- lib/fort.c | 3 ++- src/fort_impl.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/fort.c b/lib/fort.c index bffe8c1..c2c6baa 100644 --- a/lib/fort.c +++ b/lib/fort.c @@ -2832,9 +2832,10 @@ size_t ft_row_count(const ft_table_t *table) size_t ft_col_count(const ft_table_t *table) { assert(table && table->rows); + size_t i = 0; size_t cols_n = 0; size_t rows_n = vector_size(table->rows); - for (size_t i = 0; i < rows_n; ++i) { + for (i = 0; i < rows_n; ++i) { f_row_t *row = VECTOR_AT(table->rows, i, f_row_t *); size_t ncols = columns_in_row(row); cols_n = MAX(cols_n, ncols); diff --git a/src/fort_impl.c b/src/fort_impl.c index 065e891..ce364ca 100644 --- a/src/fort_impl.c +++ b/src/fort_impl.c @@ -236,9 +236,10 @@ size_t ft_row_count(const ft_table_t *table) size_t ft_col_count(const ft_table_t *table) { assert(table && table->rows); + size_t i = 0; size_t cols_n = 0; size_t rows_n = vector_size(table->rows); - for (size_t i = 0; i < rows_n; ++i) { + for (i = 0; i < rows_n; ++i) { f_row_t *row = VECTOR_AT(table->rows, i, f_row_t *); size_t ncols = columns_in_row(row); cols_n = MAX(cols_n, ncols);