From 118c38b635c32482d330db6b32b99b726e95eef6 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Mon, 17 Sep 2007 16:10:50 +0000 Subject: [PATCH] C99 features removed [r15841] --- ir/adt/gaussseidel.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ir/adt/gaussseidel.c b/ir/adt/gaussseidel.c index 5b5aca55a..5811ead7d 100644 --- a/ir/adt/gaussseidel.c +++ b/ir/adt/gaussseidel.c @@ -145,7 +145,7 @@ void gs_matrix_set(gs_matrix_t *m, int row, int col, double val) { int min, max, c, i; if (row >= m->c_rows) { - int new_c_rows = ROW_INCREASE_FACTOR * row; + int new_c_rows = (int)(ROW_INCREASE_FACTOR * row); alloc_rows(m, new_c_rows, m->initial_col_increase, m->c_rows); } @@ -203,10 +203,13 @@ void gs_matrix_set(gs_matrix_t *m, int row, int col, double val) { } double gs_matrix_get(const gs_matrix_t *m, int row, int col) { + row_col_t *the_row; int c; + if (row >= m->c_rows) return 0.0; - row_col_t *the_row = &m->rows[row]; + + the_row = &m->rows[row]; if (row == col) return the_row->diag != 0.0 ? 1.0 / the_row->diag : 0.0; @@ -282,9 +285,10 @@ void gs_matrix_dump(const gs_matrix_t *m, int a, int b, FILE *out) { // The rows which have some content for (r=0; r < effective_rows; ++r) { + row_col_t *row = &m->rows[r]; + memset(elems, 0, b * sizeof(*elems)); - row_col_t *row = &m->rows[r]; for (c = 0; c < row->n_cols; ++c) { int col_idx = row->cols[c].col_idx; elems[col_idx] = row->cols[c].v; -- 2.20.1