[pygobject] Fix a few set-but-not-used warnings.
- From: Tomeu Vizoso <tomeuv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Fix a few set-but-not-used warnings.
- Date: Tue, 24 Jan 2012 15:30:22 +0000 (UTC)
commit a8408cfd68cd5e7cdb0b8a83e107d9a0d828e4bd
Author: Will Thompson <will thompson collabora co uk>
Date: Mon Jan 23 13:01:27 2012 +0000
Fix a few set-but-not-used warnings.
In a couple of cases, the variable in question was set to a value
spelled out again later in the function.
The 'sequence_cache' variable is re-declared five lines below.
The return value of 'read' was previously completely ignored. The
'gssize ret' variable was in fact added to squash an unused-result
warning.
https://bugzilla.gnome.org/show_bug.cgi?id=668497
gi/_glib/pygiochannel.c | 2 +-
gi/_glib/pygmainloop.c | 3 +--
gi/_gobject/pygobject.c | 2 +-
gi/pygi-marshal-cleanup.c | 2 --
4 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/gi/_glib/pygiochannel.c b/gi/_glib/pygiochannel.c
index 4f77e28..3921cac 100644
--- a/gi/_glib/pygiochannel.c
+++ b/gi/_glib/pygiochannel.c
@@ -477,7 +477,7 @@ py_io_channel_add_watch(PyObject *self, PyObject *args, PyObject *kwargs)
data->user_data = user_data; Py_XINCREF(user_data);
data->iochannel = self; Py_INCREF(self);
- handler_id = g_io_add_watch_full(((PyGIOChannel *) self)->channel,
+ handler_id = g_io_add_watch_full(iochannel,
priority, condition,
pyg_iowatch_marshal, data,
(GDestroyNotify) pyg_iowatch_data_free);
diff --git a/gi/_glib/pygmainloop.c b/gi/_glib/pygmainloop.c
index eb6775e..5dabef6 100644
--- a/gi/_glib/pygmainloop.c
+++ b/gi/_glib/pygmainloop.c
@@ -158,9 +158,8 @@ pyg_signal_watch_check(GSource *source)
PySignalWatchSource *real_source = (PySignalWatchSource *)source;
GPollFD *poll_fd = &real_source->fd;
unsigned char dummy;
- gssize ret;
if (poll_fd->revents & G_IO_IN)
- ret = read(poll_fd->fd, &dummy, 1);
+ (void) read(poll_fd->fd, &dummy, 1);
#endif
state = pyglib_gil_state_ensure();
diff --git a/gi/_gobject/pygobject.c b/gi/_gobject/pygobject.c
index 0f0e5e2..8020b40 100644
--- a/gi/_gobject/pygobject.c
+++ b/gi/_gobject/pygobject.c
@@ -1275,7 +1275,7 @@ pygobject_get_properties(PyGObject *self, PyObject *args)
property_name = PYGLIB_PyUnicode_AsString(py_property);
- pspec = g_object_class_find_property(G_OBJECT_GET_CLASS(self->obj),
+ pspec = g_object_class_find_property(class,
property_name);
if (!pspec) {
PyErr_Format(PyExc_TypeError,
diff --git a/gi/pygi-marshal-cleanup.c b/gi/pygi-marshal-cleanup.c
index f80ebfa..20c5b4a 100644
--- a/gi/pygi-marshal-cleanup.c
+++ b/gi/pygi-marshal-cleanup.c
@@ -356,8 +356,6 @@ _pygi_marshal_cleanup_to_py_array (PyGIInvokeState *state,
gpointer data,
gboolean was_processed)
{
- PyGISequenceCache *sequence_cache = (PyGISequenceCache *)arg_cache;
-
if (arg_cache->transfer == GI_TRANSFER_EVERYTHING ||
arg_cache->transfer == GI_TRANSFER_CONTAINER) {
GArray *array_;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]