[seed] Fixing "unused code" warning



commit 32609fc19f7738846a919463054c49b3be13959b
Author: Danilo Cesar Lemes de Paula <danilo cesar collabora co uk>
Date:   Mon Jan 11 16:05:24 2016 -0200

    Fixing "unused code" warning
    
    Removed some code and use others to give some warnings if needed.

 libseed/seed-signals.c      |    7 +------
 libseed/seed-structs.c      |    4 ++++
 modules/dbus/dbus-exports.c |    3 ---
 modules/dbus/module.c       |   11 ++++-------
 4 files changed, 9 insertions(+), 16 deletions(-)
---
diff --git a/libseed/seed-signals.c b/libseed/seed-signals.c
index 46beb92..98c893f 100644
--- a/libseed/seed-signals.c
+++ b/libseed/seed-signals.c
@@ -88,7 +88,6 @@ seed_gobject_signal_connect_by_name (JSContextRef ctx,
                                     const JSValueRef arguments[],
                                     JSValueRef * exception)
 {
-  GType obj_type;
   JSObjectRef user_data = NULL;
   gchar *signal_name;
   GObject *obj;
@@ -120,7 +119,6 @@ seed_gobject_signal_connect_by_name (JSContextRef ctx,
 
   signal_name = seed_value_to_string (ctx, arguments[0], exception);
   obj = (GObject *) JSObjectGetPrivate (thisObject);
-  obj_type = G_OBJECT_TYPE (obj);
 
   id = seed_gobject_signal_connect (ctx, signal_name, obj,
                                    (JSObjectRef) arguments[1], NULL,
@@ -135,12 +133,9 @@ void
 seed_add_signals_to_object (JSContextRef ctx,
                            JSObjectRef object_ref, GObject * obj)
 {
-  GType type;
-  JSObjectRef signals_ref;
-
   g_assert (obj);
 
-  type = G_OBJECT_TYPE (obj);
+  JSObjectRef signals_ref;
 
   signals_ref = JSObjectMake (ctx, signal_holder_class, obj);
 
diff --git a/libseed/seed-structs.c b/libseed/seed-structs.c
index b1960f8..2e9600d 100644
--- a/libseed/seed-structs.c
+++ b/libseed/seed-structs.c
@@ -243,6 +243,10 @@ seed_union_set_property (JSContextRef context,
 
   seed_value_to_gi_argument (context, value, field_type, GI_TRANSFER_NOTHING, &field_value, exception);
   ret = g_field_info_set_field (field, priv->pointer, &field_value);
+  if (!ret) 
+    g_warning("Setting property failed on union of type: %s  "
+                       "with name %s \n",
+                       g_base_info_get_name (priv->info), cproperty_name);
 
   g_base_info_unref ((GIBaseInfo *) field_type);
   g_base_info_unref ((GIBaseInfo *) field);
diff --git a/modules/dbus/dbus-exports.c b/modules/dbus/dbus-exports.c
index f38be51..e3f91f6 100644
--- a/modules/dbus/dbus-exports.c
+++ b/modules/dbus/dbus-exports.c
@@ -443,7 +443,6 @@ invoke_js_async_from_dbus(SeedContext ctx,
 
     reply = NULL;
     thrown = FALSE;
-    argc = 0;
     argv = NULL;
 
     if (!seed_js_values_from_dbus(ctx, &arg_iter, &values, exception))
@@ -725,9 +724,7 @@ exports_new (SeedContext ctx,
             DBusBusType which_bus)
 {
   SeedObject exports;
-  SeedObject global;
 
-  global = seed_context_get_global_object (ctx);
   if (!seed_js_exports_class)
     {
       seed_class_definition def = seed_empty_class;
diff --git a/modules/dbus/module.c b/modules/dbus/module.c
index 2e7f3b7..57ccea0 100644
--- a/modules/dbus/module.c
+++ b/modules/dbus/module.c
@@ -310,12 +310,10 @@ noreply:
 static void
 pending_free_closure (void *data)
 {
-  GClosure *closure;
-
-  closure = data;
+  GClosure *closure = data;
 
-  g_closure_invalidate (data);
-  g_closure_unref (data);
+  g_closure_invalidate (closure);
+  g_closure_unref (closure);
 }
 
 
@@ -601,7 +599,6 @@ signal_handler_callback (DBusConnection * connection,
 {
   SeedContext ctx;
   SignalHandler *handler;
-  SeedValue ret_val;
   DBusMessageIter arg_iter;
   GArray *arguments;
   SeedException exception;
@@ -634,7 +631,7 @@ signal_handler_callback (DBusConnection * connection,
   SEED_NOTE(MODULE,
           "Invoking closure on signal received, %d args",
            arguments->len);
-  ret_val = seed_closure_invoke_with_context (ctx, handler->closure,
+  seed_closure_invoke_with_context (ctx, handler->closure,
                                              (SeedValue *) arguments->data,
                                              arguments->len, &exception);
 


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