[gtk+] builder: Cleanup
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] builder: Cleanup
- Date: Sat, 31 May 2014 03:20:34 +0000 (UTC)
commit 3df52ae6d56fc4c47db1b72b9441c43f3ff665c2
Author: Benjamin Otte <otte redhat com>
Date: Fri May 30 00:21:18 2014 +0200
builder: Cleanup
Use the usual way of providing user data to vfuncs:
- Don't allocate it, use the stack
- Use CamelCase for naming the struct
gtk/gtkbuilder.c | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index d7cadc4..1be1589 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -1547,7 +1547,7 @@ gtk_builder_expose_object (GtkBuilder *builder,
typedef struct {
GModule *module;
gpointer data;
-} connect_args;
+} ConnectArgs;
static void
gtk_builder_connect_signals_default (GtkBuilder *builder,
@@ -1559,7 +1559,7 @@ gtk_builder_connect_signals_default (GtkBuilder *builder,
gpointer user_data)
{
GCallback func;
- connect_args *args = (connect_args*)user_data;
+ ConnectArgs *args = (ConnectArgs*) user_data;
func = gtk_builder_lookup_callback_symbol (builder, handler_name);
@@ -1618,23 +1618,20 @@ void
gtk_builder_connect_signals (GtkBuilder *builder,
gpointer user_data)
{
- connect_args *args;
+ ConnectArgs args;
g_return_if_fail (GTK_IS_BUILDER (builder));
- args = g_slice_new0 (connect_args);
- args->data = user_data;
+ args.data = user_data;
if (g_module_supported ())
- args->module = g_module_open (NULL, G_MODULE_BIND_LAZY);
+ args.module = g_module_open (NULL, G_MODULE_BIND_LAZY);
gtk_builder_connect_signals_full (builder,
gtk_builder_connect_signals_default,
- args);
- if (args->module)
- g_module_close (args->module);
-
- g_slice_free (connect_args, args);
+ &args);
+ if (args.module)
+ g_module_close (args.module);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]