Commit c63a3dcc authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Make the args a flexible array inside the struct, and allocate them

2005-12-27  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkbindings.h (GtkBindingSignal):
	* gtk/gtkbindings.c (binding_signal_new): Make the
	args a flexible array inside the struct, and allocate them
	together.
parent c70c8cf6
2005-12-27 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkbindings.h (GtkBindingSignal):
* gtk/gtkbindings.c (binding_signal_new): Make the
args a flexible array inside the struct, and allocate them
together.
Wed Dec 28 00:45:46 2005 Tim Janik <timj@gtk.org>
* gtk/gtkctree.c (row_delete): delete GtkCTreeRow as GtkCTreeRow, not
......
2005-12-27 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkbindings.h (GtkBindingSignal):
* gtk/gtkbindings.c (binding_signal_new): Make the
args a flexible array inside the struct, and allocate them
together.
Wed Dec 28 00:45:46 2005 Tim Janik <timj@gtk.org>
* gtk/gtkctree.c (row_delete): delete GtkCTreeRow as GtkCTreeRow, not
......
......@@ -65,11 +65,10 @@ binding_signal_new (const gchar *signal_name,
{
GtkBindingSignal *signal;
signal = g_new (GtkBindingSignal, 1);
signal = (GtkBindingSignal *) g_malloc0 (sizeof (GtkBindingSignal) + (n_args - 1) * sizeof (GtkBindingArg));
signal->next = NULL;
signal->signal_name = g_intern_string (signal_name);
signal->signal_name = (gchar *)g_intern_string (signal_name);
signal->n_args = n_args;
signal->args = g_new0 (GtkBindingArg, n_args);
return signal;
}
......@@ -84,7 +83,6 @@ binding_signal_free (GtkBindingSignal *sig)
if (G_TYPE_FUNDAMENTAL (sig->args[i].arg_type) == G_TYPE_STRING)
g_free (sig->args[i].d.string_data);
}
g_free (sig->args);
g_free (sig);
}
......
......@@ -74,14 +74,6 @@ struct _GtkBindingEntry
GtkBindingSignal *signals;
};
struct _GtkBindingSignal
{
GtkBindingSignal *next;
gchar *signal_name;
guint n_args;
GtkBindingArg *args;
};
struct _GtkBindingArg
{
GType arg_type;
......@@ -92,6 +84,13 @@ struct _GtkBindingArg
} d;
};
struct _GtkBindingSignal
{
GtkBindingSignal *next;
gchar *signal_name;
guint n_args;
GtkBindingArg args[1]; /* flexible array */
};
/* Application-level methods */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment