File superlu_dist-3.1-sequence-point.patch of Package superlu_dist

diff -aruN SuperLU_DIST_3.1.orig/SRC/util.c SuperLU_DIST_3.1/SRC/util.c
--- SuperLU_DIST_3.1.orig/SRC/util.c	2012-05-19 00:48:30.000000000 +0200
+++ SuperLU_DIST_3.1/SRC/util.c	2012-09-06 22:44:16.011904085 +0200
@@ -653,7 +653,7 @@
 get_diag_procs(int_t n, Glu_persist_t *Glu_persist, gridinfo_t *grid,
 	       int_t *num_diag_procs, int_t **diag_procs, int_t **diag_len)
 {
-    int_t i, j, k, knsupc, nprow, npcol, nsupers, pkk;
+    int_t i, i_next, j, j_next, k, knsupc, nprow, npcol, nsupers, pkk;
     int_t *xsup;
 
     i = j = *num_diag_procs = pkk = 0;
@@ -664,8 +664,10 @@
 
     do {
 	++(*num_diag_procs);
-	i = (++i) % nprow;
-	j = (++j) % npcol;
+	i_next = i + 1;
+	i = (i_next) % nprow;
+	j_next = j +1;
+	j = (j_next) % npcol;
 	pkk = PNUM( i, j, grid );
     } while ( pkk != 0 ); /* Until wrap back to process 0 */
     if ( !(*diag_procs = intMalloc_dist(*num_diag_procs)) )
@@ -675,8 +677,10 @@
     for (i = j = k = 0; k < *num_diag_procs; ++k) {
 	pkk = PNUM( i, j, grid );
 	(*diag_procs)[k] = pkk;
-	i = (++i) % nprow;
-	j = (++j) % npcol;
+	i_next = i + 1;
+	i = (i_next) % nprow;
+	j_next = j +1;
+	j = (j_next) % npcol;
     }
     for (k = 0; k < nsupers; ++k) {
 	knsupc = SuperSize( k );
openSUSE Build Service is sponsored by