[pygobject] Fix unused variables and results



commit 4a20bcb3f97614044d351f8e436a81d332db55ba
Author: Martin Pitt <martinpitt gnome org>
Date:   Tue Sep 25 09:10:10 2012 +0200

    Fix unused variables and results
    
    This gets rid of all warnings except the deprecated symbol ones.

 gi/_glib/pygiochannel.c |    9 +++------
 gi/pygi-argument.c      |    4 +---
 gi/pygi-callbacks.c     |    4 ----
 gi/pygi-ccallback.c     |    1 -
 gi/pygi-repository.c    |    3 +--
 5 files changed, 5 insertions(+), 16 deletions(-)
---
diff --git a/gi/_glib/pygiochannel.c b/gi/_glib/pygiochannel.c
index 2211355..0288145 100644
--- a/gi/_glib/pygiochannel.c
+++ b/gi/_glib/pygiochannel.c
@@ -266,14 +266,13 @@ py_io_channel_write_chars(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
     Py_ssize_t buf_len;
     gsize count;
     GError* error = NULL;
-    GIOStatus status;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s#:gi._glib.IOChannel.write",
                                      kwlist, &buf, &buf_len))
         return NULL;
 	
     pyglib_unblock_threads();
-    status = g_io_channel_write_chars(self->channel, buf, buf_len, &count, &error);
+    g_io_channel_write_chars(self->channel, buf, buf_len, &count, &error);
     pyglib_block_threads();
     if (pyglib_error_check(&error))
 	return NULL;
@@ -289,7 +288,6 @@ py_io_channel_write_lines(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
     Py_ssize_t buf_len;
     gsize count;
     GError* error = NULL;
-    GIOStatus status;
     PyObject *iter, *value, *pylines;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:gi._glib.IOChannel.writelines",
@@ -312,7 +310,7 @@ py_io_channel_write_lines(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
         }
         PYGLIB_PyUnicode_AsStringAndSize(value, &buf, &buf_len);
         pyglib_unblock_threads();
-        status = g_io_channel_write_chars(self->channel, buf, buf_len, &count, &error);
+        g_io_channel_write_chars(self->channel, buf, buf_len, &count, &error);
         pyglib_unblock_threads();
         Py_DECREF(value);
         if (pyglib_error_check(&error)) {
@@ -554,13 +552,12 @@ py_io_channel_read_line(PyGIOChannel* self, PyObject *args, PyObject *kwargs)
     gchar *str_return = NULL;
     GError *error = NULL;
     gint size_hint = -1;
-    GIOStatus status;
 
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i:gi._glib.IOChannel.readline", kwlist,
                                      &size_hint))
         return NULL;
 
-    status = g_io_channel_read_line(self->channel, &str_return, &length,
+    g_io_channel_read_line(self->channel, &str_return, &length,
                                     &terminator_pos, &error);
     if (pyglib_error_check(&error))
         return NULL;
diff --git a/gi/pygi-argument.c b/gi/pygi-argument.c
index 5140a63..ee53469 100644
--- a/gi/pygi-argument.c
+++ b/gi/pygi-argument.c
@@ -1260,9 +1260,7 @@ array_success:
 
                         arg.v_pointer = closure;
                     } else if (g_struct_info_is_foreign (info)) {
-                        PyObject *result;
-                        result = pygi_struct_foreign_convert_to_g_argument (
-                                     object, info, transfer, &arg);
+                        pygi_struct_foreign_convert_to_g_argument (object, info, transfer, &arg);
                     } else if (g_type_is_a (type, G_TYPE_BOXED)) {
                         if (pyg_boxed_check (object, type)) {
                             arg.v_pointer = pyg_boxed_get (object, void);
diff --git a/gi/pygi-callbacks.c b/gi/pygi-callbacks.c
index bae4001..32ddf63 100644
--- a/gi/pygi-callbacks.c
+++ b/gi/pygi-callbacks.c
@@ -77,7 +77,6 @@ _pygi_scan_for_callbacks (GIFunctionInfo *function_info,
 
     n_args = g_callable_info_get_n_args ( (GICallableInfo *) function_info);
     for (i = 0; i < n_args; i++) {
-        GIDirection direction;
         GIArgInfo *arg_info;
         GITypeInfo *type_info;
         guint8 destroy, closure;
@@ -111,7 +110,6 @@ _pygi_scan_for_callbacks (GIFunctionInfo *function_info,
         destroy = g_arg_info_get_destroy (arg_info);
         
         closure = g_arg_info_get_closure (arg_info);
-        direction = g_arg_info_get_direction (arg_info);
 
         if (destroy > 0 && destroy < n_args) {
             if (*destroy_notify_index != G_MAXUINT8) {
@@ -153,7 +151,6 @@ _pygi_create_callback (GIBaseInfo  *function_info,
     GIArgInfo *callback_arg;
     GITypeInfo *callback_type;
     GICallbackInfo *callback_info;
-    GIScopeType scope;
     gboolean found_py_function;
     PyObject *py_function;
     guint8 i, py_argv_pos;
@@ -161,7 +158,6 @@ _pygi_create_callback (GIBaseInfo  *function_info,
     gboolean allow_none;
 
     callback_arg = g_callable_info_get_arg ( (GICallableInfo*) function_info, callback_index);
-    scope = g_arg_info_get_scope (callback_arg);
     allow_none = g_arg_info_may_be_null (callback_arg);
 
     callback_type = g_arg_info_get_type (callback_arg);
diff --git a/gi/pygi-ccallback.c b/gi/pygi-ccallback.c
index bf3ec8a..82777fb 100644
--- a/gi/pygi-ccallback.c
+++ b/gi/pygi-ccallback.c
@@ -32,7 +32,6 @@ static PyObject *
 _ccallback_call(PyGICCallback *self, PyObject *args, PyObject *kwargs)
 {
     PyObject *result;
-    GCallback *func;
 
     if (self->cache == NULL) {
         self->cache = _pygi_callable_cache_new (self->info, TRUE);
diff --git a/gi/pygi-repository.c b/gi/pygi-repository.c
index c48d2ce..7de293a 100644
--- a/gi/pygi-repository.c
+++ b/gi/pygi-repository.c
@@ -89,7 +89,6 @@ _wrap_g_irepository_require (PyGIRepository *self,
     const char *version = NULL;
     PyObject *lazy = NULL;
     GIRepositoryLoadFlags flags = 0;
-    GTypelib *typelib;
     GError *error;
 
     if (!PyArg_ParseTupleAndKeywords (args, kwargs, "s|zO:Repository.require",
@@ -102,7 +101,7 @@ _wrap_g_irepository_require (PyGIRepository *self,
     }
 
     error = NULL;
-    typelib = g_irepository_require (self->repository, namespace_, version, flags, &error);
+    g_irepository_require (self->repository, namespace_, version, flags, &error);
     if (error != NULL) {
         PyErr_SetString (PyGIRepositoryError, error->message);
         g_error_free (error);



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