[gimp/gimp-2-10] app: convert gimppickable-contiguous-region to C++



commit cfd1d0463f43d940a7ac925c32608dcdbfb35d4d
Author: Ell <ell_se yahoo com>
Date:   Thu Jan 17 09:12:31 2019 -0500

    app: convert gimppickable-contiguous-region to C++
    
    (cherry picked from commit 9719dff9c55c2331a3bb5d01ecc96e8a825fce6a)

 app/core/Makefile.am                                        |  2 +-
 ...ontiguous-region.c => gimppickable-contiguous-region.cc} | 13 +++++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/app/core/Makefile.am b/app/core/Makefile.am
index 84dcf38394..c66629e8a4 100644
--- a/app/core/Makefile.am
+++ b/app/core/Makefile.am
@@ -401,7 +401,7 @@ libappcore_a_sources = \
        gimppickable.h                          \
        gimppickable-auto-shrink.c              \
        gimppickable-auto-shrink.h              \
-       gimppickable-contiguous-region.c        \
+       gimppickable-contiguous-region.cc       \
        gimppickable-contiguous-region.h        \
        gimpprogress.c                          \
        gimpprogress.h                          \
diff --git a/app/core/gimppickable-contiguous-region.c b/app/core/gimppickable-contiguous-region.cc
similarity index 99%
rename from app/core/gimppickable-contiguous-region.c
rename to app/core/gimppickable-contiguous-region.cc
index f3c676b358..ab87122596 100644
--- a/app/core/gimppickable-contiguous-region.c
+++ b/app/core/gimppickable-contiguous-region.cc
@@ -26,6 +26,9 @@
 #include "libgimpcolor/gimpcolor.h"
 #include "libgimpmath/gimpmath.h"
 
+extern "C"
+{
+
 #include "core-types.h"
 
 #include "gegl/gimp-babl.h"
@@ -240,8 +243,8 @@ gimp_pickable_contiguous_region_by_color (GimpPickable        *pickable,
 
   while (gegl_buffer_iterator_next (iter))
     {
-      const gfloat *src   = iter->items[0].data;
-      gfloat       *dest  = iter->items[1].data;
+      const gfloat *src   = (const gfloat *) iter->items[0].data;
+      gfloat       *dest  = (      gfloat *) iter->items[1].data;
       gint          count = iter->length;
 
       while (count--)
@@ -427,7 +430,7 @@ gimp_pickable_contiguous_region_by_line_art (GimpPickable *pickable,
                     NULL);
       while (! g_queue_is_empty (queue))
         {
-          BorderPixel *c = g_queue_pop_head (queue);
+          BorderPixel *c = (BorderPixel *) g_queue_pop_head (queue);
 
           if (mask[c->x + c->y * width] != 1.0)
             {
@@ -765,7 +768,7 @@ find_contiguous_segment (const gfloat        *col,
                    row, GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
   s = row + initial_x * n_components;
 #else
-  s = g_alloca (n_components * sizeof (gfloat));
+  s = (gfloat *) g_alloca (n_components * sizeof (gfloat));
 
   gegl_sampler_get (src_sampler,
                     initial_x, initial_y, NULL, s, GEGL_ABYSS_NONE);
@@ -970,3 +973,5 @@ line_art_queue_pixel (GQueue *queue,
 
   g_queue_push_head (queue, p);
 }
+
+} /* extern "C" */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]