From d69e93ceb100dcc00540d38b7c72ea43635516a0 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 29 Mar 2006 22:11:59 +0000 Subject: [PATCH] can't just cast the GPParamDefs to ProcArgs any more, their struct layouts 2006-03-30 Michael Natterer * app/plug-in/plug-in-params.c (plug_in_param_defs_check): can't just cast the GPParamDefs to ProcArgs any more, their struct layouts are different now. Convert them into temporary ProcArgs before calling plug_in_proc_args_check() --- ChangeLog | 7 +++++++ app/plug-in/plug-in-params.c | 36 +++++++++++++++++++++++++++--------- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index f947a01cd0..37e7f171f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-03-30 Michael Natterer + + * app/plug-in/plug-in-params.c (plug_in_param_defs_check): can't + just cast the GPParamDefs to ProcArgs any more, their struct + layouts are different now. Convert them into temporary ProcArgs + before calling plug_in_proc_args_check() + 2006-03-29 Michael Natterer * app/core/gimpparamspecs.[ch]: added GimpParamSpecEnum, which is diff --git a/app/plug-in/plug-in-params.c b/app/plug-in/plug-in-params.c index 4f70fcae0f..0a5ea17640 100644 --- a/app/plug-in/plug-in-params.c +++ b/app/plug-in/plug-in-params.c @@ -462,15 +462,33 @@ plug_in_param_defs_check (const gchar *plug_in_name, guint32 n_return_vals, GError **error) { - return plug_in_proc_args_check (plug_in_name, - plug_in_prog, - procedure_name, - menu_path, - (ProcArg *) params, - n_args, - (ProcArg *) return_vals, - n_return_vals, - error); + ProcArg *args; + ProcArg *return_args; + gboolean success; + gint i; + + args = g_new0 (ProcArg, n_args); + for (i = 0; i < n_args; i++) + args[i].arg_type = params[i].type; + + return_args = g_new0 (ProcArg, n_return_vals); + for (i = 0; i < n_return_vals; i++) + return_args[i].arg_type = return_vals[i].type; + + success = plug_in_proc_args_check (plug_in_name, + plug_in_prog, + procedure_name, + menu_path, + args, + n_args, + return_args, + n_return_vals, + error); + + g_free (args); + g_free (return_args); + + return success; } gboolean