[gimp/gimp-2-10] app: convert gimp:mask-components to C++



commit 3925ae5fbb3f28e8c28e25fad24a95b044b258a4
Author: Ell <ell_se yahoo com>
Date:   Sat Feb 16 04:30:39 2019 -0500

    app: convert gimp:mask-components to C++
    
    ... in preperation for next commit.
    
    (cherry picked from commit a7f7a485bd68e45cab07fe3c730743f716b596cf)

 app/operations/Makefile.am                             |  2 +-
 ...maskcomponents.c => gimpoperationmaskcomponents.cc} | 18 ++++++++++++------
 2 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/app/operations/Makefile.am b/app/operations/Makefile.am
index de9a042a76..4e49a52dab 100644
--- a/app/operations/Makefile.am
+++ b/app/operations/Makefile.am
@@ -60,7 +60,7 @@ libappoperations_a_sources = \
        gimpoperationgrow.h                     \
        gimpoperationhistogramsink.c            \
        gimpoperationhistogramsink.h            \
-       gimpoperationmaskcomponents.c           \
+       gimpoperationmaskcomponents.cc          \
        gimpoperationmaskcomponents.h           \
        gimpoperationprofiletransform.c         \
        gimpoperationprofiletransform.h         \
diff --git a/app/operations/gimpoperationmaskcomponents.c b/app/operations/gimpoperationmaskcomponents.cc
similarity index 94%
rename from app/operations/gimpoperationmaskcomponents.c
rename to app/operations/gimpoperationmaskcomponents.cc
index 0cac310862..2b31c02607 100644
--- a/app/operations/gimpoperationmaskcomponents.c
+++ b/app/operations/gimpoperationmaskcomponents.cc
@@ -22,10 +22,15 @@
 
 #include <gegl.h>
 
+extern "C"
+{
+
 #include "operations-types.h"
 
 #include "gimpoperationmaskcomponents.h"
 
+} /* extern "C" */
+
 
 enum
 {
@@ -91,8 +96,9 @@ gimp_operation_mask_components_class_init (GimpOperationMaskComponentsClass *kla
                                                        "The component mask",
                                                        GIMP_TYPE_COMPONENT_MASK,
                                                        GIMP_COMPONENT_MASK_ALL,
-                                                       G_PARAM_READWRITE |
-                                                       G_PARAM_CONSTRUCT));
+                                                       (GParamFlags) (
+                                                         G_PARAM_READWRITE |
+                                                         G_PARAM_CONSTRUCT)));
 }
 
 static void
@@ -131,7 +137,7 @@ gimp_operation_mask_components_set_property (GObject      *object,
   switch (property_id)
     {
     case PROP_MASK:
-      self->mask = g_value_get_flags (value);
+      self->mask = (GimpComponentMask) g_value_get_flags (value);
       break;
 
    default:
@@ -205,9 +211,9 @@ gimp_operation_mask_components_process (GeglOperation       *operation,
                                         gint                 level)
 {
   GimpOperationMaskComponents *self = GIMP_OPERATION_MASK_COMPONENTS (operation);
-  gfloat                      *src  = in_buf;
-  gfloat                      *aux  = aux_buf;
-  gfloat                      *dest = out_buf;
+  const gfloat                *src  = (const gfloat *) in_buf;
+  const gfloat                *aux  = (const gfloat *) aux_buf;
+  gfloat                      *dest = (gfloat       *) out_buf;
   GimpComponentMask            mask = self->mask;
   static const gfloat          nothing[] = { 0.0, 0.0, 0.0, 1.0 };
 


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