plug-ins: unify handling of return values

For consistency Use a static GParam array for the return values
in all plug-ins.
This commit is contained in:
Sven Neumann 2010-09-30 22:46:30 +02:00
parent cad6ba9b94
commit ec5fa2fb26
5 changed files with 6 additions and 10 deletions

View File

@ -185,7 +185,7 @@ run (const gchar *name,
{ {
GimpRunMode run_mode; GimpRunMode run_mode;
GimpPDBStatusType status; GimpPDBStatusType status;
GimpParam *values; static GimpParam values[1];
INIT_I18N (); INIT_I18N ();
@ -196,8 +196,6 @@ run (const gchar *name,
status = GIMP_PDB_SUCCESS; status = GIMP_PDB_SUCCESS;
run_mode = param[0].data.d_int32; run_mode = param[0].data.d_int32;
values = g_new (GimpParam, 1);
values[0].type = GIMP_PDB_STATUS; values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status; values[0].data.d_status = status;

View File

@ -336,7 +336,7 @@ run (const gchar *name,
gint *nreturn_vals, gint *nreturn_vals,
GimpParam **return_vals) GimpParam **return_vals)
{ {
GimpParam values[1]; static GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_SUCCESS; GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode; GimpRunMode run_mode;

View File

@ -130,9 +130,9 @@ run (const gchar *name,
gint *nreturn_vals, gint *nreturn_vals,
GimpParam **return_vals) GimpParam **return_vals)
{ {
static GimpParam values[1]; /* Return values */
GimpRunMode run_mode; /* Current run mode */ GimpRunMode run_mode; /* Current run mode */
GimpPDBStatusType status; /* Return status */ GimpPDBStatusType status; /* Return status */
GimpParam *values; /* Return values */
GimpDrawable *drawable; /* Current image */ GimpDrawable *drawable; /* Current image */
/* /*
@ -144,8 +144,6 @@ run (const gchar *name,
INIT_I18N (); INIT_I18N ();
values = g_new (GimpParam, 1);
*nreturn_vals = 1; *nreturn_vals = 1;
*return_vals = values; *return_vals = values;

View File

@ -211,8 +211,6 @@ query (void)
info_return_vals); info_return_vals);
} }
GimpParam values[5];
static void static void
run (const gchar *name, run (const gchar *name,
gint nparams, gint nparams,
@ -220,6 +218,7 @@ run (const gchar *name,
gint *nreturn_vals, gint *nreturn_vals,
GimpParam **return_vals) GimpParam **return_vals)
{ {
static GimpParam values[5];
GimpPDBStatusType status = GIMP_PDB_SUCCESS; GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode; GimpRunMode run_mode;
gint32 pc; gint32 pc;

View File

@ -147,11 +147,12 @@ run (const gchar *name,
gint *nreturn_vals, gint *nreturn_vals,
GimpParam **return_vals) GimpParam **return_vals)
{ {
GimpParam *values = g_new (GimpParam, 1); static GimpParam values[1];
GimpDrawable *drawable; GimpDrawable *drawable;
GimpRunMode run_mode; GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS; GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint pwidth, pheight; gint pwidth, pheight;
INIT_I18N (); INIT_I18N ();
gfig_context = g_new0 (GFigContext, 1); gfig_context = g_new0 (GFigContext, 1);