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



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

    app: convert gimppickable-contiguous-region to C++

 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 2cf3699bf2..8b21485793 100644
--- a/app/core/Makefile.am
+++ b/app/core/Makefile.am
@@ -411,7 +411,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 b326bc287c..4cdd1b94d7 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)
             {
@@ -766,7 +769,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);
@@ -971,3 +974,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]