afa305e
From 012b0b019ede3cfa7df20bf60c7915a771ecff78 Mon Sep 17 00:00:00 2001
afa305e
From: Kalev Lember <kalevlember@gmail.com>
afa305e
Date: Thu, 4 Dec 2014 11:22:04 +0100
afa305e
Subject: [PATCH] matting-levin: Fix the build with recent suitesparse versions
afa305e
afa305e
Stop using the UF_long define that was deprecated previously and has
afa305e
completely disappeared in suitesparse 4.3.
afa305e
afa305e
https://bugzilla.gnome.org/show_bug.cgi?id=741105
afa305e
---
afa305e
 operations/external/matting-levin.c | 20 ++++++++++----------
afa305e
 1 file changed, 10 insertions(+), 10 deletions(-)
afa305e
afa305e
diff --git a/operations/external/matting-levin.c b/operations/external/matting-levin.c
afa305e
index 63e85d1..cf84699 100644
afa305e
--- a/operations/external/matting-levin.c
afa305e
+++ b/operations/external/matting-levin.c
afa305e
@@ -850,8 +850,8 @@ matting_sparse_new (guint cols, guint rows, guint elems)
afa305e
   sparse_t *s = g_new (sparse_t, 1);
afa305e
   s->columns  = cols;
afa305e
   s->rows     = rows;
afa305e
-  s->col_idx  = g_new  (UF_long, cols + 1);
afa305e
-  s->row_idx  = g_new  (UF_long, elems);
afa305e
+  s->col_idx  = g_new  (SuiteSparse_long, cols + 1);
afa305e
+  s->row_idx  = g_new  (SuiteSparse_long, elems);
afa305e
   s->values   = g_new0 (gdouble, elems);
afa305e
 
afa305e
   return s;
afa305e
@@ -964,8 +964,8 @@ matting_get_laplacian (const gdouble       *restrict image,
afa305e
             image_elems  = roi->width * roi->height,
afa305e
             i, j, k, x, y,
afa305e
             status;
afa305e
-  UF_long  *trip_col,
afa305e
-           *trip_row;
afa305e
+  SuiteSparse_long *trip_col,
afa305e
+                   *trip_row;
afa305e
   glong     trip_nz = 0,
afa305e
             trip_cursor = 0,
afa305e
             trip_masked = 0;
afa305e
@@ -995,8 +995,8 @@ matting_get_laplacian (const gdouble       *restrict image,
afa305e
   trip_nz   = trip_masked * window_elems * window_elems;
afa305e
   trip_nz  += image_elems; // Sparse diagonal and row summing at conclusion
afa305e
 
afa305e
-  trip_col  = g_new  (UF_long, trip_nz);
afa305e
-  trip_row  = g_new  (UF_long, trip_nz);
afa305e
+  trip_col  = g_new  (SuiteSparse_long, trip_nz);
afa305e
+  trip_row  = g_new  (SuiteSparse_long, trip_nz);
afa305e
   trip_val  = g_new0 (gdouble, trip_nz);
afa305e
 
afa305e
   /* Compute the contribution of each pixel in the image to the laplacian */
afa305e
@@ -1082,10 +1082,10 @@ matting_get_laplacian (const gdouble       *restrict image,
afa305e
           for (y = 0; y < window_elems; ++y)
afa305e
             for (x = 0; x < window_elems; ++x)
afa305e
               {
afa305e
-                UF_long yx = y % diameter,
afa305e
-                        yy = y / diameter,
afa305e
-                        xx = x % diameter,
afa305e
-                        xy = x / diameter;
afa305e
+                SuiteSparse_long yx = y % diameter,
afa305e
+                                 yy = y / diameter,
afa305e
+                                 xx = x % diameter,
afa305e
+                                 xy = x / diameter;
afa305e
 
afa305e
                 g_return_val_if_fail (trip_cursor < trip_nz, FALSE);
afa305e
                 trip_col[trip_cursor] = (i - radius + yx) + (j - radius + yy) * roi->width,
afa305e
-- 
afa305e
2.1.0
afa305e