[gimp] plug-ins: unify handling of return values



commit ec5fa2fb26407ceaadd041ef9061312ab39e48cb
Author: Sven Neumann <sven gimp org>
Date:   Thu Sep 30 22:46:30 2010 +0200

    plug-ins: unify handling of return values
    
    For consistency Use a static GParam array for the return values
    in all plug-ins.

 plug-ins/common/despeckle.c   |    4 +---
 plug-ins/common/filter-pack.c |    2 +-
 plug-ins/common/sharpen.c     |    4 +---
 plug-ins/file-fli/fli-gimp.c  |    3 +--
 plug-ins/gfig/gfig.c          |    3 ++-
 5 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/plug-ins/common/despeckle.c b/plug-ins/common/despeckle.c
index 4364ed9..28f03c3 100644
--- a/plug-ins/common/despeckle.c
+++ b/plug-ins/common/despeckle.c
@@ -185,7 +185,7 @@ run (const gchar      *name,
 {
   GimpRunMode        run_mode;
   GimpPDBStatusType  status;
-  GimpParam          *values;
+  static GimpParam   values[1];
 
   INIT_I18N ();
 
@@ -196,8 +196,6 @@ run (const gchar      *name,
   status   = GIMP_PDB_SUCCESS;
   run_mode = param[0].data.d_int32;
 
-  values = g_new (GimpParam, 1);
-
   values[0].type          = GIMP_PDB_STATUS;
   values[0].data.d_status = status;
 
diff --git a/plug-ins/common/filter-pack.c b/plug-ins/common/filter-pack.c
index 4a8e7d0..837993d 100644
--- a/plug-ins/common/filter-pack.c
+++ b/plug-ins/common/filter-pack.c
@@ -336,7 +336,7 @@ run (const gchar      *name,
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  GimpParam         values[1];
+  static GimpParam  values[1];
   GimpPDBStatusType status = GIMP_PDB_SUCCESS;
   GimpRunMode       run_mode;
 
diff --git a/plug-ins/common/sharpen.c b/plug-ins/common/sharpen.c
index 2c14e43..db0b3bd 100644
--- a/plug-ins/common/sharpen.c
+++ b/plug-ins/common/sharpen.c
@@ -130,9 +130,9 @@ run (const gchar      *name,
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
+  static GimpParam   values[1]; /* Return values */
   GimpRunMode        run_mode;  /* Current run mode */
   GimpPDBStatusType  status;    /* Return status */
-  GimpParam         *values;    /* Return values */
   GimpDrawable      *drawable;  /* Current image */
 
   /*
@@ -144,8 +144,6 @@ run (const gchar      *name,
 
   INIT_I18N ();
 
-  values = g_new (GimpParam, 1);
-
   *nreturn_vals = 1;
   *return_vals  = values;
 
diff --git a/plug-ins/file-fli/fli-gimp.c b/plug-ins/file-fli/fli-gimp.c
index 47ad3e5..f343735 100644
--- a/plug-ins/file-fli/fli-gimp.c
+++ b/plug-ins/file-fli/fli-gimp.c
@@ -211,8 +211,6 @@ query (void)
                           info_return_vals);
 }
 
-GimpParam values[5];
-
 static void
 run (const gchar      *name,
      gint              nparams,
@@ -220,6 +218,7 @@ run (const gchar      *name,
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
+  static GimpParam   values[5];
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
   GimpRunMode        run_mode;
   gint32             pc;
diff --git a/plug-ins/gfig/gfig.c b/plug-ins/gfig/gfig.c
index e2179be..7ff8520 100644
--- a/plug-ins/gfig/gfig.c
+++ b/plug-ins/gfig/gfig.c
@@ -147,11 +147,12 @@ run (const gchar      *name,
      gint             *nreturn_vals,
      GimpParam       **return_vals)
 {
-  GimpParam         *values = g_new (GimpParam, 1);
+  static GimpParam   values[1];
   GimpDrawable      *drawable;
   GimpRunMode        run_mode;
   GimpPDBStatusType  status = GIMP_PDB_SUCCESS;
   gint               pwidth, pheight;
+
   INIT_I18N ();
 
   gfig_context = g_new0 (GFigContext, 1);



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